Fabrice-TIERCELIN commited on
Commit
9cbd094
·
verified ·
1 Parent(s): 4d9eed7

local_storage

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -986,6 +986,7 @@ with block:
986
  </big></big></big></p>
987
  """)
988
  gr.HTML(title_html)
 
989
  with gr.Row():
990
  with gr.Column():
991
  generation_mode = gr.Radio([["Text-to-Video", "text"], ["Image-to-Video", "image"], ["Video Extension", "video"]], elem_id="generation-mode", label="Generation mode", value = "image")
@@ -1210,12 +1211,12 @@ with block:
1210
  )
1211
 
1212
  # Load saved preferences when the page loads
1213
- #block.load(
1214
- # fn=load_preferences, inputs = [
1215
- # local_storage
1216
- #], outputs = [
1217
- # generation_mode
1218
- #]
1219
- #)
1220
 
1221
  block.launch(mcp_server=True, ssr_mode=False)
 
986
  </big></big></big></p>
987
  """)
988
  gr.HTML(title_html)
989
+ local_storage = gr.BrowserState(default_local_storage)
990
  with gr.Row():
991
  with gr.Column():
992
  generation_mode = gr.Radio([["Text-to-Video", "text"], ["Image-to-Video", "image"], ["Video Extension", "video"]], elem_id="generation-mode", label="Generation mode", value = "image")
 
1211
  )
1212
 
1213
  # Load saved preferences when the page loads
1214
+ block.load(
1215
+ fn=load_preferences, inputs = [
1216
+ local_storage
1217
+ ], outputs = [
1218
+ generation_mode
1219
+ ]
1220
+ )
1221
 
1222
  block.launch(mcp_server=True, ssr_mode=False)