Spaces:
Runtime error
Runtime error
Commit
·
722bf42
1
Parent(s):
1eef3cf
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ with gr.Blocks() as demo:
|
|
30 |
chatbot = gr.Chatbot()
|
31 |
msg = gr.Textbox()
|
32 |
clear = gr.ClearButton([msg, chatbot])
|
|
|
33 |
|
34 |
def user(user_message, history):
|
35 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
@@ -49,6 +50,9 @@ with gr.Blocks() as demo:
|
|
49 |
response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
50 |
bot, chatbot, chatbot
|
51 |
)
|
|
|
|
|
|
|
52 |
response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
|
53 |
|
54 |
demo.queue()
|
|
|
30 |
chatbot = gr.Chatbot()
|
31 |
msg = gr.Textbox()
|
32 |
clear = gr.ClearButton([msg, chatbot])
|
33 |
+
btn = gr.Button("Submit")
|
34 |
|
35 |
def user(user_message, history):
|
36 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
|
|
50 |
response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
51 |
bot, chatbot, chatbot
|
52 |
)
|
53 |
+
response = btn.click(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
54 |
+
bot, chatbot, chatbot
|
55 |
+
)
|
56 |
response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
|
57 |
|
58 |
demo.queue()
|