Spaces:
Runtime error
Runtime error
Commit
·
0c6b528
1
Parent(s):
61c9c77
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,9 @@ chat_history = ['']
|
|
27 |
|
28 |
|
29 |
with gr.Blocks() as demo:
|
30 |
-
chatbot = gr.Chatbot(
|
31 |
-
|
|
|
32 |
|
33 |
def respond(message, chat_history):
|
34 |
chat_history.append(message) # Initialize chat history
|
@@ -42,6 +43,6 @@ with gr.Blocks() as demo:
|
|
42 |
time.sleep(2)
|
43 |
return "", chat_history
|
44 |
|
45 |
-
|
46 |
|
47 |
-
demo.launch()
|
|
|
27 |
|
28 |
|
29 |
with gr.Blocks() as demo:
|
30 |
+
chatbot = gr.Chatbot()
|
31 |
+
msg = gr.Textbox()
|
32 |
+
clear = gr.ClearButton([msg, chatbot])
|
33 |
|
34 |
def respond(message, chat_history):
|
35 |
chat_history.append(message) # Initialize chat history
|
|
|
43 |
time.sleep(2)
|
44 |
return "", chat_history
|
45 |
|
46 |
+
msg.submit(respond,[msg,chatbot],[msg,chatbot])
|
47 |
|
48 |
+
demo.launch()
|