Skip to content

Commit

Permalink
feature@rag baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
yanqiangmiffy committed Jun 25, 2024
1 parent a5ecef3 commit f5c6b15
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gomate/applications/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5c6b15

Please sign in to comment.