Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,6 +173,15 @@ class XylariaChat:
|
|
| 173 |
outputs=[chatbot],
|
| 174 |
queue=False
|
| 175 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
return demo
|
| 178 |
|
|
|
|
| 173 |
outputs=[chatbot],
|
| 174 |
queue=False
|
| 175 |
)
|
| 176 |
+
|
| 177 |
+
# Add event listener to clear memory when browser tab is closed
|
| 178 |
+
demo.js("""
|
| 179 |
+
() => {
|
| 180 |
+
window.addEventListener('beforeunload', function() {
|
| 181 |
+
window.localStorage.clear();
|
| 182 |
+
});
|
| 183 |
+
}
|
| 184 |
+
""")
|
| 185 |
|
| 186 |
return demo
|
| 187 |
|