Spaces:
Runtime error
Runtime error
alistairmcleay
commited on
Commit
Β·
d75062c
1
Parent(s):
046b89e
Handle client-side refresh
Browse files
app.py
CHANGED
@@ -120,15 +120,16 @@ def self_play():
|
|
120 |
return self_play_history
|
121 |
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
# Initialise demo render
|
124 |
block = gr.Blocks()
|
125 |
|
126 |
with block:
|
127 |
-
# Reset state when app is refreshed client-side
|
128 |
-
ds_history = []
|
129 |
-
us_history = []
|
130 |
-
self_play_history = []
|
131 |
-
|
132 |
gr.Markdown("# π¬ Jointly Optimized Task-Oriented Dialogue System And User Simulator π¬")
|
133 |
gr.Markdown(
|
134 |
"Created by [Alistair McLeay](https://alistairmcleay.com) for the [Masters in Machine Learning & Machine Intelligence at Cambridge University](https://www.mlmi.eng.cam.ac.uk/). <br/>\
|
|
|
120 |
return self_play_history
|
121 |
|
122 |
|
123 |
+
# Reset state upon client-side refresh
|
124 |
+
reset_ds_state()
|
125 |
+
reset_us_state()
|
126 |
+
reset_self_play_state()
|
127 |
+
|
128 |
+
|
129 |
# Initialise demo render
|
130 |
block = gr.Blocks()
|
131 |
|
132 |
with block:
|
|
|
|
|
|
|
|
|
|
|
133 |
gr.Markdown("# π¬ Jointly Optimized Task-Oriented Dialogue System And User Simulator π¬")
|
134 |
gr.Markdown(
|
135 |
"Created by [Alistair McLeay](https://alistairmcleay.com) for the [Masters in Machine Learning & Machine Intelligence at Cambridge University](https://www.mlmi.eng.cam.ac.uk/). <br/>\
|