Div99 commited on
Commit
a2eceba
·
1 Parent(s): 957e5a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -333,16 +333,16 @@ class ChatWrapper:
333
  text_to_display = hidden_text + "\n\n" + output
334
  history.append((inp, text_to_display))
335
 
336
- html_video, temp_file = do_html_video_speak(output)
337
- # html_audio, temp_file = None, None
338
- # if speak_text:
339
- # html_audio, temp_file = do_html_audio_speak(output, translate_to)
340
  except Exception as e:
341
  raise e
342
  finally:
343
  self.lock.release()
344
- return history, history, html_video, temp_file, ""
345
- # return history, history, html_audio, temp_file, ""
346
 
347
 
348
  chat = ChatWrapper()
@@ -663,8 +663,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
663
  anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
664
  surprise_level_state, sadness_level_state, disgust_level_state, anger_level_state,
665
  lang_level_state, translate_to_state, literary_style_state],
666
- outputs=[chatbot, history_state, video_html, my_file, message])
667
- # outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
668
 
669
  submit.click(chat, inputs=[openai_api_key_textbox, message, history_state, chain_state, trace_chain_state,
670
  speak_text_state, monologue_state,
@@ -672,8 +672,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
672
  anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
673
  surprise_level_state, sadness_level_state, disgust_level_state, anger_level_state,
674
  lang_level_state, translate_to_state, literary_style_state],
675
- outputs=[chatbot, history_state, video_html, my_file, message])
676
- # outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
677
 
678
  openai_api_key_textbox.change(set_openai_api_key,
679
  inputs=[openai_api_key_textbox],
 
333
  text_to_display = hidden_text + "\n\n" + output
334
  history.append((inp, text_to_display))
335
 
336
+ # html_video, temp_file = do_html_video_speak(output)
337
+ html_audio, temp_file = None, None
338
+ if speak_text:
339
+ html_audio, temp_file = do_html_audio_speak(output, translate_to)
340
  except Exception as e:
341
  raise e
342
  finally:
343
  self.lock.release()
344
+ # return history, history, html_video, temp_file, ""
345
+ return history, history, html_audio, temp_file, ""
346
 
347
 
348
  chat = ChatWrapper()
 
663
  anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
664
  surprise_level_state, sadness_level_state, disgust_level_state, anger_level_state,
665
  lang_level_state, translate_to_state, literary_style_state],
666
+ # outputs=[chatbot, history_state, video_html, my_file, message])
667
+ outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
668
 
669
  submit.click(chat, inputs=[openai_api_key_textbox, message, history_state, chain_state, trace_chain_state,
670
  speak_text_state, monologue_state,
 
672
  anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
673
  surprise_level_state, sadness_level_state, disgust_level_state, anger_level_state,
674
  lang_level_state, translate_to_state, literary_style_state],
675
+ # outputs=[chatbot, history_state, video_html, my_file, message])
676
+ outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
677
 
678
  openai_api_key_textbox.change(set_openai_api_key,
679
  inputs=[openai_api_key_textbox],