Spaces:
Running
Running
trying ot harness the model to avoid hallucinating due to the chat memory
Browse files
document_qa/document_qa_engine.py
CHANGED
@@ -169,7 +169,7 @@ class DocumentQAEngine:
|
|
169 |
relevant_documents = retriever.get_relevant_documents(query)
|
170 |
if self.memory and len(self.memory.buffer_as_messages) > 0:
|
171 |
relevant_documents.append(
|
172 |
-
Document(page_content="
|
173 |
)
|
174 |
return relevant_documents
|
175 |
|
|
|
169 |
relevant_documents = retriever.get_relevant_documents(query)
|
170 |
if self.memory and len(self.memory.buffer_as_messages) > 0:
|
171 |
relevant_documents.append(
|
172 |
+
Document(page_content="Following, the previous question and answers, use these information with care:\n{}\n\n".format(self.memory.buffer_as_str))
|
173 |
)
|
174 |
return relevant_documents
|
175 |
|