vishwask commited on
Commit
088c544
·
verified ·
1 Parent(s): 6784e74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -178,14 +178,16 @@ qa_chain = load_model(docs)
178
  if prompt := st.chat_input("How can I help you today?"):
179
  st.session_state.messages.append({"role": "user", "content": prompt})
180
  with st.chat_message("user"):
181
- english_prompt = hindi_to_english(prompt)
182
- st.markdown(english_prompt)
 
183
  with st.chat_message("assistant"):
184
  with st.spinner(text="Looking for relevant answer"):
185
  message_placeholder = st.empty()
186
  full_response = ""
187
  message_history = "\n".join(list(get_message_history())[-3:])
188
  result = qa_chain(prompt)
 
189
  output = [result['result']]
190
 
191
  def generate_pdf():
@@ -252,7 +254,9 @@ if prompt := st.chat_input("How can I help you today?"):
252
  # message_placeholder.markdown(write(stream_example))
253
 
254
  #write(stream_example)
255
- message_placeholder.markdown(english_to_hindi(result['result'])[0])
 
 
256
 
257
  # sound_file = BytesIO()
258
  # tts = gTTS(result['result'], lang='en')
 
178
  if prompt := st.chat_input("How can I help you today?"):
179
  st.session_state.messages.append({"role": "user", "content": prompt})
180
  with st.chat_message("user"):
181
+ #english_prompt = hindi_to_english(prompt)
182
+ #st.markdown(english_prompt)
183
+ st.markdown(prompt)
184
  with st.chat_message("assistant"):
185
  with st.spinner(text="Looking for relevant answer"):
186
  message_placeholder = st.empty()
187
  full_response = ""
188
  message_history = "\n".join(list(get_message_history())[-3:])
189
  result = qa_chain(prompt)
190
+ #result = qa_chain(english_prompt)
191
  output = [result['result']]
192
 
193
  def generate_pdf():
 
254
  # message_placeholder.markdown(write(stream_example))
255
 
256
  #write(stream_example)
257
+ #message_placeholder.markdown(english_to_hindi(result['result'])[0])
258
+ message_placeholder.markdown(result['result'])
259
+
260
 
261
  # sound_file = BytesIO()
262
  # tts = gTTS(result['result'], lang='en')