Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
run.ipynb
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: uploadbutton_component"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "def upload_file(files):\n", " file_paths = [file.name for file in files]\n", " return file_paths\n", "\n", "with gr.Blocks() as demo:\n", " file_output = gr.File()\n", " upload_button = gr.UploadButton(\"Click to Upload an Image or Video File\", file_types=[\"image\", \"video\"], file_count=\"multiple\")\n", " upload_button.upload(upload_file, upload_button, file_output)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
|
|
1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: uploadbutton_component"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "def upload_file(files):\n", " file_paths = [file.name for file in files]\n", " return file_paths\n", "\n", "with gr.Blocks() as demo:\n", " file_output = gr.File()\n", " upload_button = gr.UploadButton(\"Click to Upload an Image or Video File\", file_types=[\"image\", \"video\"], file_count=\"multiple\")\n", " upload_button.upload(upload_file, upload_button, file_output)\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
@@ -9,4 +9,4 @@ with gr.Blocks() as demo:
|
|
9 |
upload_button = gr.UploadButton("Click to Upload an Image or Video File", file_types=["image", "video"], file_count="multiple")
|
10 |
upload_button.upload(upload_file, upload_button, file_output)
|
11 |
|
12 |
-
demo.launch()
|
|
|
9 |
upload_button = gr.UploadButton("Click to Upload an Image or Video File", file_types=["image", "video"], file_count="multiple")
|
10 |
upload_button.upload(upload_file, upload_button, file_output)
|
11 |
|
12 |
+
demo.launch()
|