OuroborosM commited on
Commit
359c2b8
·
1 Parent(s): 0d54f87

update error

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -794,7 +794,7 @@ def clearall():
794
  # memory.clear()
795
  global Filename_Chatbot
796
  Filename_Chatbot = []
797
- return []
798
 
799
  def retry(history3):
800
  global last_request
@@ -852,9 +852,10 @@ def playsound():
852
  if Filename_Chatbot.split(".")[1] == 'wav':
853
  soundfilename = Filename_Chatbot
854
  print("soundfilename:", soundfilename)
855
- return gr.update(value = soundfilename)
 
856
  except Exception as e:
857
- print("error:", e)
858
  return None
859
 
860
 
@@ -923,8 +924,8 @@ with gr.Blocks() as demo:
923
  frash_logs = gr.Button("Update Logs ...")
924
  logs = gr.Textbox(max_lines = 25)
925
  # upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
926
- clear_button.click(clearall, None, chatbot)
927
- retry_button.click(retry, chatbot, chatbot)
928
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
929
  # then(playsound, None, voice_output)
930
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
 
794
  # memory.clear()
795
  global Filename_Chatbot
796
  Filename_Chatbot = []
797
+ return [[], gr.update(visible=True), gr.update(visible=False)]
798
 
799
  def retry(history3):
800
  global last_request
 
852
  if Filename_Chatbot.split(".")[1] == 'wav':
853
  soundfilename = Filename_Chatbot
854
  print("soundfilename:", soundfilename)
855
+ return None
856
+ # return gr.update(value = soundfilename)
857
  except Exception as e:
858
+ print("playsound error:", e)
859
  return None
860
 
861
 
 
924
  frash_logs = gr.Button("Update Logs ...")
925
  logs = gr.Textbox(max_lines = 25)
926
  # upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
927
+ clear_button.click(clearall, None, [chatbot, submit_button, stop_button])
928
+ retry_button.click(retry, chatbot, chatbot).then(HMI_Wait, None, [submit_button, stop_button])
929
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\
930
  # then(playsound, None, voice_output)
931
  # inf1 = inputtext.submit(chathmi3, [inputtext, chatbot], [inputtext, chatbot]).\