NCTCMumbai commited on
Commit
38b35fe
·
verified ·
1 Parent(s): 9719123

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -266,16 +266,16 @@ with gr.Blocks(theme='NoCrypt/miku') as CHATBOT:
266
 
267
  translated_textbox = gr.Textbox(label="Translated Response")
268
  def update_history_and_translate(txt, cross_encoder, history_state, language_dropdown):
269
- history = history_state.value
270
  history.append((txt, ""))
271
- history_state.value=(history)
272
 
273
  # Call bot function
274
  bot_output = list(bot(history, cross_encoder))
275
  history, prompt_html = bot_output[-1]
276
 
277
- # Update the history
278
- history_state.value=(history)
279
 
280
  # Translate text
281
  translated_text = translate_text(language_dropdown, history)
 
266
 
267
  translated_textbox = gr.Textbox(label="Translated Response")
268
  def update_history_and_translate(txt, cross_encoder, history_state, language_dropdown):
269
+ history = history_state
270
  history.append((txt, ""))
271
+ #history_state.value=(history)
272
 
273
  # Call bot function
274
  bot_output = list(bot(history, cross_encoder))
275
  history, prompt_html = bot_output[-1]
276
 
277
+ # Update the history state
278
+ history_state[:] = history
279
 
280
  # Translate text
281
  translated_text = translate_text(language_dropdown, history)