Spaces:
Runtime error
Runtime error
Commit
·
d6cd65d
1
Parent(s):
a5cb398
Update app.py
Browse files
app.py
CHANGED
@@ -30,9 +30,8 @@ with gr.Blocks() as demo:
|
|
30 |
msg = gr.Textbox()
|
31 |
clear = gr.ClearButton([msg, chatbot])
|
32 |
|
33 |
-
def respond(
|
34 |
-
|
35 |
-
user_input.append([messages[0]]) # Wrap user input in a list
|
36 |
bot_message = palm.chat(
|
37 |
**defaults,
|
38 |
context=context,
|
@@ -40,8 +39,8 @@ with gr.Blocks() as demo:
|
|
40 |
messages=user_input
|
41 |
)
|
42 |
time.sleep(2)
|
43 |
-
return
|
44 |
|
45 |
-
msg.submit(respond,msg,[msg,chatbot])
|
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 |
bot_message = palm.chat(
|
36 |
**defaults,
|
37 |
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()
|