Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,13 +19,13 @@ def generate(message, history,temperature=0.9,max_tokens=768):
|
|
19 |
|
20 |
mychatbot = gr.Chatbot(
|
21 |
avatar_images=["user.png", "bots.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
22 |
-
def
|
23 |
# Remove the last user message from the history
|
24 |
history = history[:-1]
|
25 |
# Generate a new response using the updated history
|
26 |
return generate(message, history)
|
27 |
|
28 |
-
def
|
29 |
# Remove the last user message and the last bot response from the history
|
30 |
history = history[:-2]
|
31 |
# Return the updated history
|
|
|
19 |
|
20 |
mychatbot = gr.Chatbot(
|
21 |
avatar_images=["user.png", "bots.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
22 |
+
def Retry(message, history):
|
23 |
# Remove the last user message from the history
|
24 |
history = history[:-1]
|
25 |
# Generate a new response using the updated history
|
26 |
return generate(message, history)
|
27 |
|
28 |
+
def Undo(message, history):
|
29 |
# Remove the last user message and the last bot response from the history
|
30 |
history = history[:-2]
|
31 |
# Return the updated history
|