Spaces:
Runtime error
Runtime error
Commit
·
294398a
1
Parent(s):
e8dd184
Update app.py
Browse files
app.py
CHANGED
@@ -31,16 +31,16 @@ with gr.Blocks() as demo:
|
|
31 |
msg = gr.Textbox()
|
32 |
clear = gr.ClearButton([msg, chatbot])
|
33 |
|
34 |
-
def respond(message, chat_history):
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
|
45 |
msg.submit(respond,[msg,chatbot],[msg, chatbot])
|
46 |
|
|
|
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
|
36 |
+
bot_message = palm.chat(
|
37 |
+
context=context,
|
38 |
+
examples=examples,
|
39 |
+
messages=chat_history
|
40 |
+
)
|
41 |
+
bot_message = [bot_message.last]
|
42 |
+
time.sleep(2)
|
43 |
+
return "", bot_message, chat_history
|
44 |
|
45 |
msg.submit(respond,[msg,chatbot],[msg, chatbot])
|
46 |
|