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