Spaces:
Sleeping
Sleeping
clementsan commited on
Commit ·
04361a6
1
Parent(s): 138ca2e
Extract helpful answer only
Browse files194 unmodified lines195196197198199200194 unmodified lines# Generate response using QA chainresponse = qa_chain({"question": message, "chat_history": formatted_chat_history})response_answer = response["answer"]response_sources = response["source_documents"]response_source1 = response_sources[0].page_content.strip()response_source2 = response_sources[1].page_content.strip()194 unmodified lines195196197198199200201202194 unmodified lines# Generate response using QA chainresponse = qa_chain({"question": message, "chat_history": formatted_chat_history})response_answer = response["answer"]if response_answer.find("Helpful Answer:") != -1:response_answer = response_answer.split("Helpful Answer:")[-1]response_sources = response["source_documents"]response_source1 = response_sources[0].page_content.strip()response_source2 = response_sources[1].page_content.strip()
app.py+2