Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,15 @@ get_local_storage = """
|
|
| 11 |
globalThis.getStorage = (key, value)=>{
|
| 12 |
return JSON.parse(localStorage.getItem(key))
|
| 13 |
}
|
| 14 |
-
const local_data =
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
"""
|
| 18 |
|
|
@@ -159,7 +166,7 @@ with gr.Blocks() as block:
|
|
| 159 |
block.load(
|
| 160 |
None,
|
| 161 |
inputs=None,
|
| 162 |
-
outputs=[local_data],
|
| 163 |
_js=get_local_storage,
|
| 164 |
)
|
| 165 |
|
|
|
|
| 11 |
globalThis.getStorage = (key, value)=>{
|
| 12 |
return JSON.parse(localStorage.getItem(key))
|
| 13 |
}
|
| 14 |
+
const local_data = getStorage('local_data')
|
| 15 |
+
const history = []
|
| 16 |
+
|
| 17 |
+
if(local_data !== undefinfed) {
|
| 18 |
+
local_data[0].pingpongs.forEach(element =>
|
| 19 |
+
history.push([element.ping, element.pong]))
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
return [local_data, history];
|
| 23 |
}
|
| 24 |
"""
|
| 25 |
|
|
|
|
| 166 |
block.load(
|
| 167 |
None,
|
| 168 |
inputs=None,
|
| 169 |
+
outputs=[local_data, chatbot],
|
| 170 |
_js=get_local_storage,
|
| 171 |
)
|
| 172 |
|