Spaces:
Runtime error
Runtime error
Commit
•
1719196
1
Parent(s):
30f4d4c
context merging improvements
Browse files- qa_engine/qa_engine.py +3 -2
qa_engine/qa_engine.py
CHANGED
@@ -292,8 +292,9 @@ class QAEngine():
|
|
292 |
)
|
293 |
]
|
294 |
relevant_docs = relevant_docs[:self.num_relevant_docs]
|
295 |
-
context += '\
|
296 |
-
|
|
|
297 |
metadata = [doc.metadata for doc in relevant_docs]
|
298 |
response.set_sources(sources=[str(m['source']) for m in metadata])
|
299 |
|
|
|
292 |
)
|
293 |
]
|
294 |
relevant_docs = relevant_docs[:self.num_relevant_docs]
|
295 |
+
context += '\nEXTRACTED DOCUMENTS:\n'
|
296 |
+
for i, (doc) in enumerate(relevant_docs):
|
297 |
+
context += f'\n\n<DOCUMENT_{i}>\n {doc.page_content} \n</DOCUMENT_{i}>'
|
298 |
metadata = [doc.metadata for doc in relevant_docs]
|
299 |
response.set_sources(sources=[str(m['source']) for m in metadata])
|
300 |
|