app.py update
Browse files- DDSP-SVC/pretrain/hubert/.gitignore +0 -2
- DDSP-SVC/pretrain/nsf_hifigan/.gitignore +0 -2
- app.py +15 -3
DDSP-SVC/pretrain/hubert/.gitignore
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
*
|
| 2 |
-
!.gitignore
|
|
|
|
|
|
|
|
|
DDSP-SVC/pretrain/nsf_hifigan/.gitignore
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
*
|
| 2 |
-
!.gitignore
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -1,7 +1,19 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from huggingface_hub import hf_hub_file_upload
|
| 3 |
+
from pydub import AudioSegment
|
| 4 |
|
| 5 |
+
def convert_to_opus(file):
|
| 6 |
+
# mp3 νμΌμ μ½μ΄λ€μ
λλ€.
|
| 7 |
+
audio = AudioSegment.from_file(file.name)
|
| 8 |
|
| 9 |
+
# opus νμΌλ‘ λ³νν©λλ€.
|
| 10 |
+
opus_file = file.name.replace(".mp3", ".opus")
|
| 11 |
+
audio.export(opus_file, format="opus")
|
| 12 |
+
|
| 13 |
+
# λ³νλ opus νμΌμ Hugging Face Spacesμ μ
λ‘λν©λλ€.
|
| 14 |
+
url = hf_hub_file_upload(opus_file)
|
| 15 |
+
|
| 16 |
+
return url
|
| 17 |
+
|
| 18 |
+
iface = gr.Interface(convert_to_opus, "file", "file")
|
| 19 |
iface.launch()
|