Commit 2: Add 49 file(s)
Browse files- demos/kitchen_sink/run.ipynb +1 -1
- demos/kitchen_sink/run.py +4 -4
- demos/model3D/run.ipynb +1 -1
- demos/model3D/run.py +2 -2
- demos/zip_files/run.ipynb +1 -1
- demos/zip_files/run.py +6 -7
- requirements.txt +2 -2
- run.py +2 -1
demos/kitchen_sink/run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: kitchen_sink"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio numpy "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import os\n", "import json\n", "\n", "import numpy as np\n", "\n", "import gradio as gr\n", "from gradio.media import get_image, get_video, get_audio\n", "\n", "CHOICES = [\"foo\", \"bar\", \"baz\"]\n", "JSONOBJ = \"\"\"{\"items\":{\"item\":[{\"id\": \"0001\",\"type\": null,\"is_good\": false,\"ppu\": 0.55,\"batters\":{\"batter\":[{ \"id\": \"1001\", \"type\": \"Regular\" },{ \"id\": \"1002\", \"type\": \"Chocolate\" },{ \"id\": \"1003\", \"type\": \"Blueberry\" },{ \"id\": \"1004\", \"type\": \"Devil's Food\" }]},\"topping\":[{ \"id\": \"5001\", \"type\": \"None\" },{ \"id\": \"5002\", \"type\": \"Glazed\" },{ \"id\": \"5005\", \"type\": \"Sugar\" },{ \"id\": \"5007\", \"type\": \"Powdered Sugar\" },{ \"id\": \"5006\", \"type\": \"Chocolate with Sprinkles\" },{ \"id\": \"5003\", \"type\": \"Chocolate\" },{ \"id\": \"5004\", \"type\": \"Maple\" }]}]}}\"\"\"\n", "\n", "def fn(\n", " text1,\n", " text2,\n", " num,\n", " slider1,\n", " slider2,\n", " single_checkbox,\n", " checkboxes,\n", " radio,\n", " dropdown,\n", " multi_dropdown,\n", " im1,\n", " # im2,\n", " # im3,\n", " im4,\n", " video,\n", " audio1,\n", " audio2,\n", " file,\n", " df1,\n", " time,\n", "):\n", " return (\n", " (text1 if single_checkbox else text2)\n", " + \", selected:\"\n", " + \", \".join(checkboxes), # Text\n", " {\n", " \"positive\": num / (num + slider1 + slider2),\n", " \"negative\": slider1 / (num + slider1 + slider2),\n", " \"neutral\": slider2 / (num + slider1 + slider2),\n", " }, # Label\n", " (audio1[0], np.flipud(audio1[1]))\n", " if audio1 is not None\n", " else
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: kitchen_sink"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio numpy "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import os\n", "import json\n", "\n", "import numpy as np\n", "\n", "import gradio as gr\n", "from gradio.media import get_image, get_video, get_audio, get_file\n", "\n", "CHOICES = [\"foo\", \"bar\", \"baz\"]\n", "JSONOBJ = \"\"\"{\"items\":{\"item\":[{\"id\": \"0001\",\"type\": null,\"is_good\": false,\"ppu\": 0.55,\"batters\":{\"batter\":[{ \"id\": \"1001\", \"type\": \"Regular\" },{ \"id\": \"1002\", \"type\": \"Chocolate\" },{ \"id\": \"1003\", \"type\": \"Blueberry\" },{ \"id\": \"1004\", \"type\": \"Devil's Food\" }]},\"topping\":[{ \"id\": \"5001\", \"type\": \"None\" },{ \"id\": \"5002\", \"type\": \"Glazed\" },{ \"id\": \"5005\", \"type\": \"Sugar\" },{ \"id\": \"5007\", \"type\": \"Powdered Sugar\" },{ \"id\": \"5006\", \"type\": \"Chocolate with Sprinkles\" },{ \"id\": \"5003\", \"type\": \"Chocolate\" },{ \"id\": \"5004\", \"type\": \"Maple\" }]}]}}\"\"\"\n", "\n", "def fn(\n", " text1,\n", " text2,\n", " num,\n", " slider1,\n", " slider2,\n", " single_checkbox,\n", " checkboxes,\n", " radio,\n", " dropdown,\n", " multi_dropdown,\n", " im1,\n", " # im2,\n", " # im3,\n", " im4,\n", " video,\n", " audio1,\n", " audio2,\n", " file,\n", " df1,\n", " time,\n", "):\n", " return (\n", " (text1 if single_checkbox else text2)\n", " + \", selected:\"\n", " + \", \".join(checkboxes), # Text\n", " {\n", " \"positive\": num / (num + slider1 + slider2),\n", " \"negative\": slider1 / (num + slider1 + slider2),\n", " \"neutral\": slider2 / (num + slider1 + slider2),\n", " }, # Label\n", " (audio1[0], np.flipud(audio1[1]))\n", " if audio1 is not None\n", " else get_audio(\"cantina.wav\"), # Audio\n", " np.flipud(im1)\n", " if im1 is not None\n", " else get_image(\"cheetah1.jpg\"), # Image\n", " video\n", " if video is not None\n", " else get_video(\"world.mp4\"), # Video\n", " [\n", " (\"The\", \"art\"),\n", " (\"quick brown\", \"adj\"),\n", " (\"fox\", \"nn\"),\n", " (\"jumped\", \"vrb\"),\n", " (\"testing testing testing\", None),\n", " (\"over\", \"prp\"),\n", " (\"the\", \"art\"),\n", " (\"testing\", None),\n", " (\"lazy\", \"adj\"),\n", " (\"dogs\", \"nn\"),\n", " (\".\", \"punc\"),\n", " ]\n", " + [(f\"test {x}\", f\"test {x}\") for x in range(10)], # HighlightedText\n", " # [(\"The testing testing testing\", None), (\"quick brown\", 0.2), (\"fox\", 1), (\"jumped\", -1), (\"testing testing testing\", 0), (\"over\", 0), (\"the\", 0), (\"testing\", 0), (\"lazy\", 1), (\"dogs\", 0), (\".\", 1)] + [(f\"test {x}\", x/10) for x in range(-10, 10)], # HighlightedText\n", " [\n", " (\"The testing testing testing\", None),\n", " (\"over\", 0.6),\n", " (\"the\", 0.2),\n", " (\"testing\", None),\n", " (\"lazy\", -0.1),\n", " (\"dogs\", 0.4),\n", " (\".\", 0),\n", " ]\n", " + [(\"test\", x / 10) for x in range(-10, 10)], # HighlightedText\n", " json.loads(JSONOBJ), # JSON\n", " \"<button style='background-color: red'>Click Me: \"\n", " + radio\n", " + \"</button>\", # HTML\n", " get_file(\"titanic.csv\"), # File\n", " df1, # Dataframe\n", " np.random.randint(0, 10, (4, 4)), # Dataframe\n", " time, # DateTime\n", " )\n", "\n", "demo = gr.Interface(\n", " fn,\n", " inputs=[\n", " gr.Textbox(value=\"Lorem ipsum\", label=\"Textbox\"),\n", " gr.Textbox(lines=3, placeholder=\"Type here..\", label=\"Textbox 2\"),\n", " gr.Number(label=\"Number\", value=42),\n", " gr.Slider(10, 20, value=15, label=\"Slider: 10 - 20\"),\n", " gr.Slider(maximum=20, step=0.04, label=\"Slider: step @ 0.04\"),\n", " gr.Checkbox(label=\"Checkbox\"),\n", " gr.CheckboxGroup(label=\"CheckboxGroup\", choices=CHOICES, value=CHOICES[0:2]),\n", " gr.Radio(label=\"Radio\", choices=CHOICES, value=CHOICES[2]),\n", " gr.Dropdown(label=\"Dropdown\", choices=CHOICES),\n", " gr.Dropdown(\n", " label=\"Multiselect Dropdown (Max choice: 2)\",\n", " choices=CHOICES,\n", " multiselect=True,\n", " max_choices=2,\n", " ),\n", " gr.Image(label=\"Image\"),\n", " # gr.Image(label=\"Image w/ Cropper\", tool=\"select\"),\n", " # gr.Image(label=\"Sketchpad\", source=\"canvas\"),\n", " gr.Image(label=\"Webcam\", sources=[\"webcam\"]),\n", " gr.Video(label=\"Video\"),\n", " gr.Audio(label=\"Audio\"),\n", " gr.Audio(label=\"Microphone\", sources=[\"microphone\"]),\n", " gr.File(label=\"File\"),\n", " gr.Dataframe(label=\"Dataframe\", headers=[\"Name\", \"Age\", \"Gender\"]),\n", " gr.DateTime(label=\"DateTime\"),\n", " ],\n", " outputs=[\n", " gr.Textbox(label=\"Textbox\"),\n", " gr.Label(label=\"Label\"),\n", " gr.Audio(label=\"Audio\"),\n", " gr.Image(label=\"Image\", elem_id=\"output-img\"),\n", " gr.Video(label=\"Video\"),\n", " gr.HighlightedText(\n", " label=\"HighlightedText\", color_map={\"punc\": \"pink\", \"test 0\": \"blue\"}\n", " ),\n", " gr.HighlightedText(label=\"HighlightedText\", show_legend=True),\n", " gr.JSON(label=\"JSON\", show_indices=True),\n", " gr.HTML(label=\"HTML\"),\n", " gr.File(label=\"File\"),\n", " gr.Dataframe(label=\"Dataframe\"),\n", " gr.Dataframe(label=\"Numpy\"),\n", " gr.DateTime(label=\"DateTime\"),\n", " ],\n", " examples=[\n", " [\n", " \"the quick brown fox\",\n", " \"jumps over the lazy dog\",\n", " 10,\n", " 12,\n", " 4,\n", " True,\n", " [\"foo\", \"baz\"],\n", " \"baz\",\n", " \"bar\",\n", " [\"foo\", \"bar\"],\n", " get_image(\"cheetah1.jpg\"),\n", " # get_image(\"cheetah1.jpg\"),\n", " # get_image(\"cheetah1.jpg\"),\n", " get_image(\"cheetah1.jpg\"),\n", " get_video(\"world.mp4\"),\n", " get_audio(\"cantina.wav\"),\n", " get_audio(\"cantina.wav\"),\n", " get_file(\"titanic.csv\"),\n", " [[1, 2, 3, 4], [4, 5, 6, 7], [8, 9, 1, 2], [3, 4, 5, 6]],\n", " \"2025-06-10 12:00:00\",\n", " ]\n", " ]\n", " * 3,\n", " title=\"Kitchen Sink\",\n", " description=\"Try out all the components!\",\n", " article=\"Learn more about [Gradio](http://gradio.app)\",\n", " cache_examples=True,\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
demos/kitchen_sink/run.py
CHANGED
|
@@ -4,7 +4,7 @@ import json
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
-
from gradio.media import get_image, get_video, get_audio
|
| 8 |
|
| 9 |
CHOICES = ["foo", "bar", "baz"]
|
| 10 |
JSONOBJ = """{"items":{"item":[{"id": "0001","type": null,"is_good": false,"ppu": 0.55,"batters":{"batter":[{ "id": "1001", "type": "Regular" },{ "id": "1002", "type": "Chocolate" },{ "id": "1003", "type": "Blueberry" },{ "id": "1004", "type": "Devil's Food" }]},"topping":[{ "id": "5001", "type": "None" },{ "id": "5002", "type": "Glazed" },{ "id": "5005", "type": "Sugar" },{ "id": "5007", "type": "Powdered Sugar" },{ "id": "5006", "type": "Chocolate with Sprinkles" },{ "id": "5003", "type": "Chocolate" },{ "id": "5004", "type": "Maple" }]}]}}"""
|
|
@@ -42,7 +42,7 @@ def fn(
|
|
| 42 |
}, # Label
|
| 43 |
(audio1[0], np.flipud(audio1[1]))
|
| 44 |
if audio1 is not None
|
| 45 |
-
else
|
| 46 |
np.flipud(im1)
|
| 47 |
if im1 is not None
|
| 48 |
else get_image("cheetah1.jpg"), # Image
|
|
@@ -78,7 +78,7 @@ def fn(
|
|
| 78 |
"<button style='background-color: red'>Click Me: "
|
| 79 |
+ radio
|
| 80 |
+ "</button>", # HTML
|
| 81 |
-
|
| 82 |
df1, # Dataframe
|
| 83 |
np.random.randint(0, 10, (4, 4)), # Dataframe
|
| 84 |
time, # DateTime
|
|
@@ -149,7 +149,7 @@ demo = gr.Interface(
|
|
| 149 |
get_video("world.mp4"),
|
| 150 |
get_audio("cantina.wav"),
|
| 151 |
get_audio("cantina.wav"),
|
| 152 |
-
|
| 153 |
[[1, 2, 3, 4], [4, 5, 6, 7], [8, 9, 1, 2], [3, 4, 5, 6]],
|
| 154 |
"2025-06-10 12:00:00",
|
| 155 |
]
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
+
from gradio.media import get_image, get_video, get_audio, get_file
|
| 8 |
|
| 9 |
CHOICES = ["foo", "bar", "baz"]
|
| 10 |
JSONOBJ = """{"items":{"item":[{"id": "0001","type": null,"is_good": false,"ppu": 0.55,"batters":{"batter":[{ "id": "1001", "type": "Regular" },{ "id": "1002", "type": "Chocolate" },{ "id": "1003", "type": "Blueberry" },{ "id": "1004", "type": "Devil's Food" }]},"topping":[{ "id": "5001", "type": "None" },{ "id": "5002", "type": "Glazed" },{ "id": "5005", "type": "Sugar" },{ "id": "5007", "type": "Powdered Sugar" },{ "id": "5006", "type": "Chocolate with Sprinkles" },{ "id": "5003", "type": "Chocolate" },{ "id": "5004", "type": "Maple" }]}]}}"""
|
|
|
|
| 42 |
}, # Label
|
| 43 |
(audio1[0], np.flipud(audio1[1]))
|
| 44 |
if audio1 is not None
|
| 45 |
+
else get_audio("cantina.wav"), # Audio
|
| 46 |
np.flipud(im1)
|
| 47 |
if im1 is not None
|
| 48 |
else get_image("cheetah1.jpg"), # Image
|
|
|
|
| 78 |
"<button style='background-color: red'>Click Me: "
|
| 79 |
+ radio
|
| 80 |
+ "</button>", # HTML
|
| 81 |
+
get_file("titanic.csv"), # File
|
| 82 |
df1, # Dataframe
|
| 83 |
np.random.randint(0, 10, (4, 4)), # Dataframe
|
| 84 |
time, # DateTime
|
|
|
|
| 149 |
get_video("world.mp4"),
|
| 150 |
get_audio("cantina.wav"),
|
| 151 |
get_audio("cantina.wav"),
|
| 152 |
+
get_file("titanic.csv"),
|
| 153 |
[[1, 2, 3, 4], [4, 5, 6, 7], [8, 9, 1, 2], [3, 4, 5, 6]],
|
| 154 |
"2025-06-10 12:00:00",
|
| 155 |
]
|
demos/model3D/run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: model3D"]}, {"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": ["
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: model3D"]}, {"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", "# get_model3d() returns the file path to sample 3D models included with Gradio\n", "from gradio.media import get_model3d, MEDIA_ROOT\n", "\n", "\n", "def load_mesh(mesh_file_name):\n", " return mesh_file_name\n", "\n", "\n", "demo = gr.Interface(\n", " fn=load_mesh,\n", " inputs=gr.Model3D(label=\"Other name\", display_mode=\"wireframe\"),\n", " outputs=gr.Model3D(\n", " clear_color=(0.0, 0.0, 0.0, 0.0), label=\"3D Model\", display_mode=\"wireframe\"\n", " ),\n", " examples=[\n", " [get_model3d(\"Bunny.obj\")],\n", " [get_model3d(\"Duck.glb\")],\n", " [get_model3d(\"Fox.gltf\")],\n", " [get_model3d(\"face.obj\")],\n", " [get_model3d(\"sofia.stl\")],\n", " [\n", " \"https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k-mini.splat\"\n", " ],\n", " [\n", " \"https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/luigi/luigi.ply\"\n", " ],\n", " ],\n", " cache_examples=True,\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch(allowed_paths=[str(MEDIA_ROOT)])\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
demos/model3D/run.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
# get_model3d() returns the file path to sample 3D models included with Gradio
|
| 3 |
-
from gradio.media import get_model3d
|
| 4 |
|
| 5 |
|
| 6 |
def load_mesh(mesh_file_name):
|
|
@@ -30,4 +30,4 @@ demo = gr.Interface(
|
|
| 30 |
)
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
# get_model3d() returns the file path to sample 3D models included with Gradio
|
| 3 |
+
from gradio.media import get_model3d, MEDIA_ROOT
|
| 4 |
|
| 5 |
|
| 6 |
def load_mesh(mesh_file_name):
|
|
|
|
| 30 |
)
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
+
demo.launch(allowed_paths=[str(MEDIA_ROOT)])
|
demos/zip_files/run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: zip_files"]}, {"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": ["
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: zip_files"]}, {"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": ["from zipfile import ZipFile\n", "\n", "import gradio as gr\n", "\n", "def zip_files(files):\n", " with ZipFile(\"tmp.zip\", \"w\") as zip_obj:\n", " for file in files:\n", " zip_obj.write(file.name, file.name.split(\"/\")[-1])\n", " return \"tmp.zip\"\n", "\n", "demo = gr.Interface(\n", " zip_files,\n", " gr.File(file_count=\"multiple\", file_types=[\"text\", \".json\", \".csv\"]),\n", " \"file\",\n", " examples=[[[gr.get_file(\"titanic.csv\"),\n", " gr.get_file(\"titanic.csv\"),\n", " gr.get_file(\"titanic.csv\")]]],\n", " cache_examples=True\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
demos/zip_files/run.py
CHANGED
|
@@ -1,21 +1,20 @@
|
|
| 1 |
-
import os
|
| 2 |
from zipfile import ZipFile
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
def zip_files(files):
|
| 7 |
-
with ZipFile("tmp.zip", "w") as
|
| 8 |
-
for
|
| 9 |
-
|
| 10 |
return "tmp.zip"
|
| 11 |
|
| 12 |
demo = gr.Interface(
|
| 13 |
zip_files,
|
| 14 |
gr.File(file_count="multiple", file_types=["text", ".json", ".csv"]),
|
| 15 |
"file",
|
| 16 |
-
examples=[[[
|
| 17 |
-
|
| 18 |
-
|
| 19 |
cache_examples=True
|
| 20 |
)
|
| 21 |
|
|
|
|
|
|
|
| 1 |
from zipfile import ZipFile
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
def zip_files(files):
|
| 6 |
+
with ZipFile("tmp.zip", "w") as zip_obj:
|
| 7 |
+
for file in files:
|
| 8 |
+
zip_obj.write(file.name, file.name.split("/")[-1])
|
| 9 |
return "tmp.zip"
|
| 10 |
|
| 11 |
demo = gr.Interface(
|
| 12 |
zip_files,
|
| 13 |
gr.File(file_count="multiple", file_types=["text", ".json", ".csv"]),
|
| 14 |
"file",
|
| 15 |
+
examples=[[[gr.get_file("titanic.csv"),
|
| 16 |
+
gr.get_file("titanic.csv"),
|
| 17 |
+
gr.get_file("titanic.csv")]]],
|
| 18 |
cache_examples=True
|
| 19 |
)
|
| 20 |
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
| 2 |
-
https://gradio-pypi-previews.s3.amazonaws.com/
|
| 3 |
pypistats==1.1.0
|
| 4 |
plotly
|
| 5 |
matplotlib
|
|
|
|
| 1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@5731ff93cc4c8f53e33fa18fcfbe397815a7d81b#subdirectory=client/python
|
| 2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/5731ff93cc4c8f53e33fa18fcfbe397815a7d81b/gradio-5.49.0-py3-none-any.whl
|
| 3 |
pypistats==1.1.0
|
| 4 |
plotly
|
| 5 |
matplotlib
|
run.py
CHANGED
|
@@ -4,6 +4,7 @@ import os
|
|
| 4 |
import sys
|
| 5 |
import copy
|
| 6 |
import pathlib
|
|
|
|
| 7 |
|
| 8 |
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
|
| 9 |
|
|
@@ -42,4 +43,4 @@ for demo_name, demo, _ in all_demos:
|
|
| 42 |
# app = gr.mount_gradio_app(app, demo, f"/demo/{demo_name}")
|
| 43 |
|
| 44 |
if __name__ == "__main__":
|
| 45 |
-
app.launch()
|
|
|
|
| 4 |
import sys
|
| 5 |
import copy
|
| 6 |
import pathlib
|
| 7 |
+
from gradio.media import MEDIA_ROOT
|
| 8 |
|
| 9 |
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
|
| 10 |
|
|
|
|
| 43 |
# app = gr.mount_gradio_app(app, demo, f"/demo/{demo_name}")
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
| 46 |
+
app.launch(allowed_paths=[str(MEDIA_ROOT)])
|