Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,8 +207,10 @@ with gr.Blocks(title="BPE Visualization Demo") as demo:
|
|
| 207 |
# inputs=index_slider,
|
| 208 |
# outputs=[heatmap, bpe_display]
|
| 209 |
# )
|
| 210 |
-
current_vis = gr.State(
|
| 211 |
-
current_bpe = gr.State(
|
|
|
|
|
|
|
| 212 |
index_slider.change(
|
| 213 |
update_slider_index,
|
| 214 |
inputs=[index_slider,current_vis,current_bpe],
|
|
|
|
| 207 |
# inputs=index_slider,
|
| 208 |
# outputs=[heatmap, bpe_display]
|
| 209 |
# )
|
| 210 |
+
current_vis = gr.State(value=3) # 初始化状态
|
| 211 |
+
current_bpe = gr.State(value=['abc', 'eee', 'asx']) # 初始化状态
|
| 212 |
+
set_vis_state(3)
|
| 213 |
+
|
| 214 |
index_slider.change(
|
| 215 |
update_slider_index,
|
| 216 |
inputs=[index_slider,current_vis,current_bpe],
|