Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,9 +62,9 @@ def generate_text(user_prompt, top_p, top_k, temperature):
|
|
62 |
return "\n".join(chat_history)
|
63 |
|
64 |
def reset_history():
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
|
69 |
# Define the Gradio interface
|
70 |
interface = gr.Interface(
|
@@ -78,6 +78,8 @@ interface = gr.Interface(
|
|
78 |
outputs="text",
|
79 |
description="Interact with ConvAI (Loaded with Hugging Face Transformers)",
|
80 |
live=True
|
|
|
|
|
81 |
)
|
82 |
|
83 |
# Add a button to reset the chat history
|
|
|
62 |
return "\n".join(chat_history)
|
63 |
|
64 |
def reset_history():
|
65 |
+
global chat_history
|
66 |
+
chat_history = []
|
67 |
+
return "Chat history reset."
|
68 |
|
69 |
# Define the Gradio interface
|
70 |
interface = gr.Interface(
|
|
|
78 |
outputs="text",
|
79 |
description="Interact with ConvAI (Loaded with Hugging Face Transformers)",
|
80 |
live=True
|
81 |
+
button = gr.Button(label="Reset Chat History")
|
82 |
+
interface.update(elem_id=button.elem_id, value=reset_history)
|
83 |
)
|
84 |
|
85 |
# Add a button to reset the chat history
|