albertvillanova HF Staff commited on
Commit
893d4cd
·
verified ·
1 Parent(s): 47322e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,14 +10,14 @@ def init_choices():
10
 
11
  with gr.Blocks() as demo:
12
  dropdown = gr.Dropdown(label="Select", multiselect=True, choices=["a0", "b0"])
13
- choices = gr.State()
14
 
15
  demo.load(
16
  fn=init_choices,
17
- outputs=choices,
18
  ).then(
19
- fn=lambda choices: gr.Dropdown(choices=["a", "b"]),
20
- inputs=choices,
21
  outputs=dropdown,
22
  )
23
 
 
10
 
11
  with gr.Blocks() as demo:
12
  dropdown = gr.Dropdown(label="Select", multiselect=True, choices=["a0", "b0"])
13
+ state = gr.State()
14
 
15
  demo.load(
16
  fn=init_choices,
17
+ outputs=state,
18
  ).then(
19
+ fn=lambda x: gr.Dropdown(choices=x),
20
+ inputs=state,
21
  outputs=dropdown,
22
  )
23