Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- README.md +7 -9
- audio/cantina.wav +0 -0
- audio/recording1.wav +0 -0
- gradio_cached_examples/12/log.csv +3 -0
- gradio_cached_examples/12/output/tmpivdj9c76rb3hkg71.wav +0 -0
- gradio_cached_examples/12/output/tmpvpwx1iv6qtln9h82.wav +0 -0
- run.ipynb +1 -0
- run.py +22 -0
- screenshot.png +0 -0
README.md
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
6 |
sdk: gradio
|
7 |
-
|
8 |
-
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: reverse_audio
|
3 |
+
app_file: run.py
|
4 |
+
emoji: 🤯
|
5 |
+
colorFrom: indigo
|
6 |
+
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
+
python_version: 3.8.9
|
9 |
+
sdk_version: 3.31.0
|
|
|
10 |
---
|
|
|
|
audio/cantina.wav
ADDED
Binary file (132 kB). View file
|
|
audio/recording1.wav
ADDED
Binary file (639 kB). View file
|
|
gradio_cached_examples/12/log.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
output,flag,username,timestamp
|
2 |
+
/Users/aliabid/projects/gradio/demo/reverse_audio/gradio_cached_examples/12/output/tmpvpwx1iv6qtln9h82.wav,,,2023-01-07 20:16:21.608600
|
3 |
+
/Users/aliabid/projects/gradio/demo/reverse_audio/gradio_cached_examples/12/output/tmpivdj9c76rb3hkg71.wav,,,2023-01-07 20:16:21.613905
|
gradio_cached_examples/12/output/tmpivdj9c76rb3hkg71.wav
ADDED
Binary file (639 kB). View file
|
|
gradio_cached_examples/12/output/tmpvpwx1iv6qtln9h82.wav
ADDED
Binary file (564 kB). View file
|
|
run.ipynb
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: reverse_audio"]}, {"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": ["# Downloading files from the demo repo\n", "import os\n", "os.mkdir('audio')\n", "!wget -q -O audio/cantina.wav https://github.com/gradio-app/gradio/raw/main/demo/reverse_audio/audio/cantina.wav\n", "!wget -q -O audio/recording1.wav https://github.com/gradio-app/gradio/raw/main/demo/reverse_audio/audio/recording1.wav"]}, {"cell_type": "code", "execution_count": null, "id": 44380577570523278879349135829904343037, "metadata": {}, "outputs": [], "source": ["import os\n", "\n", "import numpy as np\n", "\n", "import gradio as gr\n", "\n", "\n", "def reverse_audio(audio):\n", " sr, data = audio\n", " return (sr, np.flipud(data))\n", "\n", "\n", "demo = gr.Interface(fn=reverse_audio, \n", " inputs=\"microphone\", \n", " outputs=\"audio\", \n", " examples=[\n", " \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n", " os.path.join(os.path.abspath(''), \"audio/recording1.wav\")\n", " ], cache_examples=True)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
|
8 |
+
def reverse_audio(audio):
|
9 |
+
sr, data = audio
|
10 |
+
return (sr, np.flipud(data))
|
11 |
+
|
12 |
+
|
13 |
+
demo = gr.Interface(fn=reverse_audio,
|
14 |
+
inputs="microphone",
|
15 |
+
outputs="audio",
|
16 |
+
examples=[
|
17 |
+
"https://samplelib.com/lib/preview/mp3/sample-3s.mp3",
|
18 |
+
os.path.join(os.path.dirname(__file__), "audio/recording1.wav")
|
19 |
+
], cache_examples=True)
|
20 |
+
|
21 |
+
if __name__ == "__main__":
|
22 |
+
demo.launch(share=True)
|
screenshot.png
ADDED
![]() |