albertvillanova's picture
Update app.py
9cb3444 verified
raw
history blame
446 Bytes
import time
import gradio as gr
def init_choices():
t = time.gmtime(time.time())
return [f"{t.tm_min}:{t.tm_sec}"]
with gr.Blocks() as demo:
dropdown = gr.Dropdown(label="Select", multiselect=True)
choices = gr.State()
demo.load(
fn=init_choices,
outputs=choices,
).then(
fn=lambda choices: gr.Dropdown(choices=choices),
inputs=choices,
outputs=dropdown,
)
demo.launch()