Skip to content

Commit

Permalink
revert: use cohere v2 model since v3 has not been evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
parambharat committed Apr 24, 2024
1 parent f6085d0 commit c73e2de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/wandbot/rag/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from langchain.retrievers.document_compressors import CohereRerank
from langchain_core.documents import Document
from langchain_core.runnables import Runnable, RunnablePassthrough

from wandbot.rag.utils import get_web_contexts
from wandbot.retriever.base import VectorStore
from wandbot.retriever.web_search import YouSearch, YouSearchConfig
Expand Down Expand Up @@ -44,9 +43,9 @@ def rerank_results(
language: str = "en",
):
if language == "en":
reranker = CohereRerank(top_n=top_k, model="rerank-english-v3.0")
reranker = CohereRerank(top_n=top_k, model="rerank-english-v2.0")
else:
reranker = CohereRerank(top_n=top_k, model="rerank-multilingual-v3.0")
reranker = CohereRerank(top_n=top_k, model="rerank-multilingual-v2.0")

query = "\n".join(queries)
ranked_results = reranker.compress_documents(documents=context, query=query)
Expand Down

0 comments on commit c73e2de

Please sign in to comment.