keithhon's picture
Upload app.py with huggingface_hub
d28ba32
raw
history blame
1.27 kB
import gradio as gr
import os
import shlex
os.system('wget https://www.dropbox.com/s/luro5o8kjotkn70/synpretrained.pt')
os.system('wget https://www.dropbox.com/s/dv0ymnlqillecfw/encpretrained.pt')
os.system('wget https://www.dropbox.com/s/aiym2qfv7087bsc/vocpretrained.pt')
os.system('ls')
def inference(audio, text):
os.system("python demo_cli.py --no_sound --cpu --audio_path "+audio.name+" --text "+shlex.quote(text.strip()))
return 'demo_output_1.wav'
title = "Real-Time-Voice-Cloning"
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."
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>"
examples=[['test.wav',"This is real time voice cloning on huggingface spaces"]]
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()