Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -5,7 +5,7 @@ emoji: 🔥
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
-
sdk_version: 6.
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
|
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
+
sdk_version: 6.3.0
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: audio_debugger"]}, {"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", "
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: audio_debugger"]}, {"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", "from gradio.media import get_audio, MEDIA_PATHS\n", "\n", "# get_audio returns the path to the audio file\n", "audio_file = get_audio(\"cantina.wav\")\n", "\n", "with gr.Blocks() as demo:\n", " with gr.Tab(\"Audio\"):\n", " gr.Audio(audio_file, buttons=[\"download\"])\n", " with gr.Tab(\"Interface\"):\n", " gr.Interface(\n", " lambda x: x,\n", " gr.Audio(),\n", " gr.Audio(),\n", " examples=[audio_file],\n", " cache_examples=True,\n", " api_name=\"predict\",\n", " )\n", " with gr.Tab(\"Streaming\"):\n", " gr.Interface(\n", " lambda x: x,\n", " gr.Audio(streaming=True),\n", " \"audio\",\n", " examples=[audio_file],\n", " cache_examples=True,\n", " api_name=\"predict\",\n", " )\n", " with gr.Tab(\"console\"):\n", " ip = gr.Textbox(label=\"User IP Address\")\n", " gr.Interface(\n", " lambda cmd: f\"You typed this command: {cmd}\",\n", " \"text\",\n", " \"text\",\n", " api_name=\"predict\",\n", " )\n", "\n", " def get_ip(request: gr.Request):\n", " return request.client.host\n", "\n", " demo.load(get_ip, None, ip)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch(allowed_paths=MEDIA_PATHS)\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import subprocess
|
| 3 |
from gradio.media import get_audio, MEDIA_PATHS
|
| 4 |
|
| 5 |
# get_audio returns the path to the audio file
|
|
@@ -29,11 +28,7 @@ with gr.Blocks() as demo:
|
|
| 29 |
with gr.Tab("console"):
|
| 30 |
ip = gr.Textbox(label="User IP Address")
|
| 31 |
gr.Interface(
|
| 32 |
-
lambda cmd:
|
| 33 |
-
[cmd], capture_output=True, shell=True, check=False
|
| 34 |
-
)
|
| 35 |
-
.stdout.decode("utf-8")
|
| 36 |
-
.strip(),
|
| 37 |
"text",
|
| 38 |
"text",
|
| 39 |
api_name="predict",
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from gradio.media import get_audio, MEDIA_PATHS
|
| 3 |
|
| 4 |
# get_audio returns the path to the audio file
|
|
|
|
| 28 |
with gr.Tab("console"):
|
| 29 |
ip = gr.Textbox(label="User IP Address")
|
| 30 |
gr.Interface(
|
| 31 |
+
lambda cmd: f"You typed this command: {cmd}",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
"text",
|
| 33 |
"text",
|
| 34 |
api_name="predict",
|