Spaces:
Runtime error
Runtime error
Commit
·
612c776
1
Parent(s):
1d67713
Update app.py
Browse files
app.py
CHANGED
@@ -33,20 +33,20 @@ with gr.Blocks() as demo:
|
|
33 |
|
34 |
def user(user_message, history):
|
35 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
36 |
-
def bot(history):
|
37 |
# chat_history.append(message) # Initialize chat history
|
38 |
history[-1][1] = ""
|
39 |
bot_message = palm.chat(
|
40 |
context=context,
|
41 |
examples=examples,
|
42 |
-
messages=
|
43 |
)
|
44 |
for character in bot_message:
|
45 |
history[-1][1] += character
|
46 |
time.sleep(0.05)
|
47 |
yield history
|
48 |
response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
49 |
-
bot, chatbot, chatbot
|
50 |
)
|
51 |
response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
|
52 |
|
|
|
33 |
|
34 |
def user(user_message, history):
|
35 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
36 |
+
def bot(user_message, history):
|
37 |
# chat_history.append(message) # Initialize chat history
|
38 |
history[-1][1] = ""
|
39 |
bot_message = palm.chat(
|
40 |
context=context,
|
41 |
examples=examples,
|
42 |
+
messages=user_message
|
43 |
)
|
44 |
for character in bot_message:
|
45 |
history[-1][1] += character
|
46 |
time.sleep(0.05)
|
47 |
yield history
|
48 |
response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
49 |
+
bot, [msg, chatbot], [msg, chatbot]
|
50 |
)
|
51 |
response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
|
52 |
|