Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def load_model(_docs):
|
|
140 |
retriever=db.as_retriever(search_kwargs={"k": 3}),
|
141 |
return_source_documents=True,
|
142 |
chain_type_kwargs={"prompt": prompt,
|
143 |
-
"verbose":
|
144 |
|
145 |
print('load done')
|
146 |
return qa_chain
|
@@ -183,7 +183,7 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
183 |
message_placeholder = st.empty()
|
184 |
full_response = ""
|
185 |
message_history = "\n".join(list(get_message_history())[-3:])
|
186 |
-
result = qa_chain(
|
187 |
output = [result['result']]
|
188 |
|
189 |
def generate_pdf():
|
@@ -236,10 +236,10 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
236 |
# #yield word + " "
|
237 |
# time.sleep(0.1)
|
238 |
|
239 |
-
for item in output:
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
# message_placeholder.markdown(result['source_documents'])
|
244 |
|
245 |
#stream_example()
|
@@ -250,7 +250,7 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
250 |
# message_placeholder.markdown(write(stream_example))
|
251 |
|
252 |
#write(stream_example)
|
253 |
-
message_placeholder.markdown(english_to_hindi(
|
254 |
|
255 |
# sound_file = BytesIO()
|
256 |
# tts = gTTS(result['result'], lang='en')
|
|
|
140 |
retriever=db.as_retriever(search_kwargs={"k": 3}),
|
141 |
return_source_documents=True,
|
142 |
chain_type_kwargs={"prompt": prompt,
|
143 |
+
"verbose": True})
|
144 |
|
145 |
print('load done')
|
146 |
return qa_chain
|
|
|
183 |
message_placeholder = st.empty()
|
184 |
full_response = ""
|
185 |
message_history = "\n".join(list(get_message_history())[-3:])
|
186 |
+
result = qa_chain(english_prompt)
|
187 |
output = [result['result']]
|
188 |
|
189 |
def generate_pdf():
|
|
|
236 |
# #yield word + " "
|
237 |
# time.sleep(0.1)
|
238 |
|
239 |
+
# for item in output:
|
240 |
+
# full_response += english_to_hindi(item)[0]
|
241 |
+
# message_placeholder.markdown(full_response + "▌")
|
242 |
+
# message_placeholder.markdown(full_response)
|
243 |
# message_placeholder.markdown(result['source_documents'])
|
244 |
|
245 |
#stream_example()
|
|
|
250 |
# message_placeholder.markdown(write(stream_example))
|
251 |
|
252 |
#write(stream_example)
|
253 |
+
message_placeholder.markdown(english_to_hindi(output[0])[0])
|
254 |
|
255 |
# sound_file = BytesIO()
|
256 |
# tts = gTTS(result['result'], lang='en')
|