Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed Dec 20, 2023
1 parent a5e526c commit 005b9d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/configuration/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
LEXICAL_RETRIEVER_PATH = "../models/api_lexical_retrieval.joblib"
CROSS_ENCODER_PATH = "cross-encoder/ms-marco-MiniLM-L-6-v2"
CROSS_ENCODER_THRESHOLD = 2.0
CROSS_ENCODER_MIN_TOP_K = 3
CROSS_ENCODER_MIN_TOP_K = 1
CROSS_ENCODER_MAX_TOP_K = 20

# Device parameters
Expand Down
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ async def websocket_endpoint(websocket: WebSocket):
answer_type = start_type if response_complete == "" else "stream"
response_complete += response_text
await send(websocket, response_text, answer_type)
# response_complete += "\n\nSource(s):\n" + "\n".join(sources)
logger.info("\n\nSource(s):\n".join(sources))
contextual_sources = "\n".join([f"<{src}>" for src in sources])
response_complete += "\n\nContextual source(s):\n" + contextual_sources
await send(websocket, response_complete, start_type)

await send(websocket, "", "end")
Expand Down
2 changes: 0 additions & 2 deletions ragger_duck/prompt/_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def __call__(self, query, **prompt_kwargs):
"[INST] Answer to the query related to scikit-learn using the following "
"pair of content and source. The context is provided from the most "
"relevant to the least relevant. Use this priority to answer to the query. "
"Finish your answer with the https link corresponding to the source to "
"provide more information to the user while answering the query. "
"Be succinct when providing the answer. \n"
f"query: {query}\n"
f"context: {context_query} [/INST]."
Expand Down

0 comments on commit 005b9d1

Please sign in to comment.