Spaces:
Runtime error
Runtime error
Commit
·
6e0fd70
1
Parent(s):
8a83c76
Update app.py
Browse files
app.py
CHANGED
@@ -32,17 +32,17 @@ with gr.Blocks() as demo:
|
|
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=
|
40 |
)
|
41 |
bot_message = bot_message.last # Get the last response
|
42 |
-
chat_history.append(bot_message) # Append the bot's message to the chat history
|
43 |
time.sleep(2)
|
44 |
return chat_history, ""
|
45 |
|
46 |
-
msg.submit(respond,[msg,chatbot],[chatbot
|
47 |
|
48 |
demo.launch()
|
|
|
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=message
|
40 |
)
|
41 |
bot_message = bot_message.last # Get the last response
|
42 |
+
chat_history.append((message,bot_message)) # Append the bot's message to the chat history
|
43 |
time.sleep(2)
|
44 |
return chat_history, ""
|
45 |
|
46 |
+
msg.submit(respond,[msg,chatbot],[msg, chatbot])
|
47 |
|
48 |
demo.launch()
|