Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: progress_component"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio tqdm"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import time
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: progress_component"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio tqdm"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import time\n", "\n", "def load_set(progress=gr.Progress()):\n", " imgs = [None] * 24\n", " for img in progress.tqdm(imgs, desc=\"Loading...\"):\n", " time.sleep(0.1)\n", " return \"Loaded\"\n", "\n", "with gr.Blocks() as demo:\n", " load = gr.Button(\"Load\")\n", " label = gr.Label(label=\"Loader\")\n", " load.click(load_set, outputs=label)\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import time
|
| 3 |
|
| 4 |
def load_set(progress=gr.Progress()):
|
| 5 |
imgs = [None] * 24
|
|
@@ -7,10 +7,9 @@ def load_set(progress=gr.Progress()):
|
|
| 7 |
time.sleep(0.1)
|
| 8 |
return "Loaded"
|
| 9 |
|
| 10 |
-
|
| 11 |
with gr.Blocks() as demo:
|
| 12 |
load = gr.Button("Load")
|
| 13 |
label = gr.Label(label="Loader")
|
| 14 |
load.click(load_set, outputs=label)
|
| 15 |
|
| 16 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
|
| 4 |
def load_set(progress=gr.Progress()):
|
| 5 |
imgs = [None] * 24
|
|
|
|
| 7 |
time.sleep(0.1)
|
| 8 |
return "Loaded"
|
| 9 |
|
|
|
|
| 10 |
with gr.Blocks() as demo:
|
| 11 |
load = gr.Button("Load")
|
| 12 |
label = gr.Label(label="Loader")
|
| 13 |
load.click(load_set, outputs=label)
|
| 14 |
|
| 15 |
+
demo.launch()
|