rileho3909 commited on
Commit
3e74972
1 Parent(s): 50e240f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ import shlex
4
+
5
+ os.system('wget https://www.dropbox.com/s/luro5o8kjotkn70/synpretrained.pt')
6
+ os.system('wget https://www.dropbox.com/s/dv0ymnlqillecfw/encpretrained.pt')
7
+ os.system('wget https://www.dropbox.com/s/aiym2qfv7087bsc/vocpretrained.pt')
8
+ os.system('ls')
9
+
10
+
11
+ def inference(audio, text):
12
+ os.system("python demo_cli.py --no_sound --cpu --audio_path "+audio.name+" --text "+shlex.quote(text.strip()))
13
+ return 'demo_output_1.wav'
14
+
15
+
16
+ title = "Real-Time-Voice-Cloning"
17
+ description = "Gradio demo for Real-Time-Voice-Cloning: Clone a voice in 5 seconds to generate arbitrary speech in real-time. To use it, simply upload your audio, or click one of the examples to load them. Read more at the links below."
18
+ article = "<p style='text-align: center'><a href='https://matheo.uliege.be/handle/2268.2/6801' target='_blank'>Real-Time Voice Cloning</a> | <a href='https://github.com/CorentinJ/Real-Time-Voice-Cloning' target='_blank'>Github Repo</a></p>"
19
+
20
+ examples=[['test.wav',"This is real time voice cloning on huggingface spaces"]]
21
+ gr.Interface(inference, inputs=[gr.inputs.Audio(type="file"),"text"], outputs=gr.outputs.Audio(type="file"),enable_queue=True,title=title,description=description,article=article, examples=examples).launch()
22
+