Arafath10 commited on
Commit
fcde1d7
·
1 Parent(s): c0f8af1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -60,7 +60,7 @@ with gr.Blocks() as demo:
60
 
61
  clear.click(clear_textbox)
62
 
63
- def respond(audio, message, chat_history):
64
  global chain, id
65
  if id < len(medical_questionnaire):
66
  if id == 0:
@@ -88,13 +88,7 @@ with gr.Blocks() as demo:
88
 
89
  return "", chat_history
90
 
91
- def submit_message():
92
- user_message = msg.value
93
- if user_message:
94
- chatbot.input(user_message)
95
- chatbot_output = chatbot.output()
96
- respond(audio_input, user_message, chatbot_output)
97
-
98
- send.click(submit_message)
99
 
100
  demo.launch()
 
60
 
61
  clear.click(clear_textbox)
62
 
63
+ def respond(audio,message,mschat_history):
64
  global chain, id
65
  if id < len(medical_questionnaire):
66
  if id == 0:
 
88
 
89
  return "", chat_history
90
 
91
+ audio_input.stop_recording(
92
+ respond, [audio_input,msg,chatbot], [audio_input,msg,chatbot])
 
 
 
 
 
 
93
 
94
  demo.launch()