2
0
mirror of https://github.com/gradio-app/gradio.git synced 2024-12-27 02:30:17 +08:00
gradio/demo/progress_component/run.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
342 B
Python
Raw Normal View History

import gradio as gr
import time
def load_set(progress=gr.Progress()):
imgs = [None] * 24
for img in progress.tqdm(imgs, desc="Loading..."):
time.sleep(0.1)
return "Loaded"
2023-07-08 00:44:16 +08:00
with gr.Blocks() as demo:
load = gr.Button("Load")
label = gr.Label(label="Loader")
load.click(load_set, outputs=label)
demo.launch()