Spaces:
Runtime error
Runtime error
Commit
·
adcdc29
1
Parent(s):
833323a
Update app.py
Browse files
app.py
CHANGED
@@ -30,18 +30,17 @@ with gr.Blocks() as demo:
|
|
30 |
msg = gr.Textbox()
|
31 |
clear = gr.ClearButton([msg, chatbot])
|
32 |
|
33 |
-
def respond(
|
34 |
-
|
35 |
-
|
36 |
bot_message = palm.chat(
|
37 |
**defaults,
|
38 |
context=context,
|
39 |
-
examples=examples,
|
40 |
messages=user_input
|
41 |
)
|
42 |
time.sleep(2)
|
43 |
-
return
|
44 |
|
45 |
-
msg.submit(respond,
|
46 |
|
47 |
demo.launch()
|
|
|
30 |
msg = gr.Textbox()
|
31 |
clear = gr.ClearButton([msg, chatbot])
|
32 |
|
33 |
+
def respond(message,chat_history):
|
34 |
+
user_input.append([chat_history[0]])
|
35 |
+
|
36 |
bot_message = palm.chat(
|
37 |
**defaults,
|
38 |
context=context,
|
|
|
39 |
messages=user_input
|
40 |
)
|
41 |
time.sleep(2)
|
42 |
+
return "", chat_history
|
43 |
|
44 |
+
msg.submit(respond,[msg,chatbot],[msg,chatbot])
|
45 |
|
46 |
demo.launch()
|