albertvillanova HF staff commited on
Commit
f1c5c38
1 Parent(s): ee10f76

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time
2
+
3
+ import gradio as gr
4
+
5
+
6
+ def init_choices():
7
+ t = time.gmtime(time.time())
8
+ return [f"{t.tm_min}:{t.tm_sec}"]
9
+
10
+
11
+ with gr.Blocks() as demo:
12
+ dropdown = gr.Dropdown(label="Select", multiselect=True)
13
+
14
+ demo.load(
15
+ fn=init_choices,
16
+ outputs=choices,
17
+ ).then(
18
+ fn=lambda choices: gr.Dropdown(choices=choices),
19
+ inputs=choices,
20
+ outputs=dropdown,
21
+ )
22
+
23
+ demo.launch()