Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
|
|
5 |
|
6 |
def init_choices():
|
7 |
t = time.gmtime(time.time())
|
8 |
-
return
|
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 |
)
|