albertvillanova HF Staff commited on
Commit
3fc461e
·
verified ·
1 Parent(s): d93f52e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
5
 
6
  def init_choices():
7
  t = time.gmtime(time.time())
8
- return ["a", "b", f"{t.tm_min}:{t.tm_sec}"]
9
 
10
 
11
  with gr.Blocks() as demo:
@@ -17,7 +17,7 @@ with gr.Blocks() as demo:
17
  fn=init_choices,
18
  outputs=state,
19
  ).then(
20
- fn=lambda x: gr.Dropdown(choices=x),
21
  inputs=state,
22
  outputs=dropdown2,
23
  )
 
5
 
6
  def init_choices():
7
  t = time.gmtime(time.time())
8
+ return {"a": 1, "b": 2, f"{t.tm_min}:{t.tm_sec}": 3}
9
 
10
 
11
  with gr.Blocks() as demo:
 
17
  fn=init_choices,
18
  outputs=state,
19
  ).then(
20
+ fn=lambda x: gr.Dropdown(choices=list(x.keys())),
21
  inputs=state,
22
  outputs=dropdown2,
23
  )