vishwask commited on
Commit
7f2eefc
·
verified ·
1 Parent(s): 1d31b56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- #response_answer = response["answer"]
205
- response_answer = english_to_indian(response["answer"][:500])
206
- #print(english_to_indian(response["answer"][:500]))
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()