From b8b57398f877722d8b854eaf1fb3901fa0618894 Mon Sep 17 00:00:00 2001 From: Omar Solano Date: Wed, 24 Jul 2024 16:09:01 -0400 Subject: [PATCH] remove cohere rerank temporarily --- scripts/custom_retriever.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/custom_retriever.py b/scripts/custom_retriever.py index 31e425e..1d8c126 100644 --- a/scripts/custom_retriever.py +++ b/scripts/custom_retriever.py @@ -6,7 +6,8 @@ from llama_index.core import QueryBundle from llama_index.core.retrievers import BaseRetriever, VectorIndexRetriever from llama_index.core.schema import NodeWithScore, TextNode -from llama_index.postprocessor.cohere_rerank import CohereRerank + +# from llama_index.postprocessor.cohere_rerank import CohereRerank logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) @@ -72,8 +73,8 @@ def filter_nodes_by_unique_doc_id(nodes): else: nodes_context.append(node) - reranker = CohereRerank(top_n=8, model="rerank-english-v3.0") - nodes_context = reranker.postprocess_nodes(nodes_context, query_bundle) - logfire.info(f"Cohere raranking to {len(nodes_context)} nodes") + # reranker = CohereRerank(top_n=8, model="rerank-english-v3.0") + # nodes_context = reranker.postprocess_nodes(nodes_context, query_bundle) + # logfire.info(f"Cohere raranking to {len(nodes_context)} nodes") return nodes_context