Spaces:
Runtime error
Runtime error
Commit
·
e029e46
1
Parent(s):
aeb75e5
Update app.py
Browse files
app.py
CHANGED
@@ -34,14 +34,12 @@ with gr.Blocks() as demo:
|
|
34 |
def user(user_message, history):
|
35 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
36 |
def bot(history):
|
37 |
-
#
|
38 |
-
|
39 |
-
print(history)
|
40 |
-
print(history[:-2])
|
41 |
bot_message = palm.chat(
|
42 |
context=context,
|
43 |
examples=examples,
|
44 |
-
messages=history
|
45 |
)
|
46 |
history[-1][1] = ""
|
47 |
for character in bot_message:
|
|
|
34 |
def user(user_message, history):
|
35 |
return gr.update(value="", interactive=False), history + [[user_message,None]]
|
36 |
def bot(history):
|
37 |
+
# Remove the second element of the last element of the list
|
38 |
+
del history[-1][1]
|
|
|
|
|
39 |
bot_message = palm.chat(
|
40 |
context=context,
|
41 |
examples=examples,
|
42 |
+
messages=history
|
43 |
)
|
44 |
history[-1][1] = ""
|
45 |
for character in bot_message:
|