Update app.py
Browse files
app.py
CHANGED
|
@@ -60,7 +60,7 @@ with gr.Blocks() as demo:
|
|
| 60 |
|
| 61 |
clear.click(clear_textbox)
|
| 62 |
|
| 63 |
-
def respond(audio,
|
| 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 |
-
|
| 92 |
-
|
| 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()
|