add submit button
Browse files
app.py
CHANGED
|
@@ -230,6 +230,7 @@ async def main_chatbot(message, history):
|
|
| 230 |
with gr.Blocks() as demo:
|
| 231 |
chatbot = gr.Chatbot()
|
| 232 |
msg = gr.Textbox()
|
|
|
|
| 233 |
clear = gr.Button("Clear")
|
| 234 |
audio_output = gr.Audio(label="Assistant's Voice")
|
| 235 |
|
|
@@ -249,6 +250,9 @@ with gr.Blocks() as demo:
|
|
| 249 |
history[-1][1] = bot_response
|
| 250 |
return history, audio_path
|
| 251 |
|
|
|
|
|
|
|
|
|
|
| 252 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 253 |
bot, chatbot, [chatbot, audio_output]
|
| 254 |
)
|
|
|
|
| 230 |
with gr.Blocks() as demo:
|
| 231 |
chatbot = gr.Chatbot()
|
| 232 |
msg = gr.Textbox()
|
| 233 |
+
submit = gr.Button("Submit")
|
| 234 |
clear = gr.Button("Clear")
|
| 235 |
audio_output = gr.Audio(label="Assistant's Voice")
|
| 236 |
|
|
|
|
| 250 |
history[-1][1] = bot_response
|
| 251 |
return history, audio_path
|
| 252 |
|
| 253 |
+
submit.click(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 254 |
+
bot, chatbot, [chatbot, audio_output]
|
| 255 |
+
)
|
| 256 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 257 |
bot, chatbot, [chatbot, audio_output]
|
| 258 |
)
|