From f5c6b154273084179d2944aa7097d742475c4dc4 Mon Sep 17 00:00:00 2001 From: yanqiangmiffy <1185918903@qq.com> Date: Wed, 26 Jun 2024 01:44:20 +0800 Subject: [PATCH] feature@rag baseline --- gomate/applications/rag.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gomate/applications/rag.py b/gomate/applications/rag.py index 404f40f..99dd5e5 100644 --- a/gomate/applications/rag.py +++ b/gomate/applications/rag.py @@ -53,6 +53,7 @@ def add_document(self, file_path): def chat(self, question: str = '', top_k: int = 5): contents = self.retriever.retrieve(query=question, top_k=top_k) + contents=self.reranker.rerank(query=question,documents=[content['text'] for content in contents]) content = '\n'.join([content['text'] for content in contents]) print(contents) response, history = self.llm.chat(question, [], content)