pdjdev commited on
Commit
1ded5ed
β€’
1 Parent(s): 5ccfd7d

app.py update

Browse files
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 greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
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()