gradio/demo/progress_component/run.py
Ali Abdalla 02c7bfe1ed
Adding missing embedded components on docs (#3027)
* add embedded component for dataset

* add embedded component for examples

* add embedded component for progress

* remove make_waveform

* add embedded component for uploadbutton

* remove footer on lineplot embedded component

* remove broken image from gallery

* add embedded component for interpretation

* generated notebooks

* changelog

* change example component demo to images

* remove natgeo img in gallery demo

* regenerate notebooks
2023-01-24 13:15:06 -08:00

19 lines
481 B
Python

import gradio as gr
import time
import tqdm
css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}"
def load_set(progress=gr.Progress()):
imgs = [None] * 24
for img in progress.tqdm(imgs, desc="Loading..."):
time.sleep(0.1)
return "Loaded"
with gr.Blocks(css=css) as demo:
load = gr.Button("Load")
label = gr.Label(label="Loader")
load.click(load_set, outputs=label)
demo.queue(concurrency_count=20).launch()