Update app.py
Browse files
app.py
CHANGED
@@ -201,11 +201,9 @@ def conversation(qa_chain, message, history):
|
|
201 |
|
202 |
# Generate response using QA chain
|
203 |
response = qa_chain({"question": message, "chat_history": formatted_chat_history})
|
204 |
-
|
205 |
-
response_answer
|
206 |
-
|
207 |
-
# if response_answer.find("Helpful Answer:") != -1:
|
208 |
-
# response_answer = response_answer.split("Helpful Answer:")[-1]
|
209 |
response_sources = response["source_documents"]
|
210 |
response_source1 = response_sources[0].page_content.strip()
|
211 |
response_source2 = response_sources[1].page_content.strip()
|
|
|
201 |
|
202 |
# Generate response using QA chain
|
203 |
response = qa_chain({"question": message, "chat_history": formatted_chat_history})
|
204 |
+
response_answer = response["answer"]
|
205 |
+
if response_answer.find("Helpful Answer:") != -1:
|
206 |
+
response_answer = response_answer.split("Helpful Answer:")[-1]
|
|
|
|
|
207 |
response_sources = response["source_documents"]
|
208 |
response_source1 = response_sources[0].page_content.strip()
|
209 |
response_source2 = response_sources[1].page_content.strip()
|