Ahsen Khaliq
Update app.py
465145b
raw
history blame
799 Bytes
import gradio as gr
import os
import shlex
os.system('wget https://www.dropbox.com/s/luro5o8kjotkn70/pretrained.pt')
os.system('wget https://www.dropbox.com/s/dv0ymnlqillecfw/pretrained.pt')
os.system('wget https://www.dropbox.com/s/aiym2qfv7087bsc/pretrained.pt')
os.system('ls')
os.rename("pretrained.pt", "synthesizer/saved_models/pretrained/pretrained.pt")
os.rename("pretrained.pt.1", "encoder/saved_models/pretrained.pt")
os.rename("pretrained.pt.2", "vocoder/saved_models/pretrained/pretrained.pt")
def inference(audio, text):
os.system("python demo_cli.py --audio_path "+audio.name+" --text "+shlex.quote(text.strip()))
return 'demo_output_1.wav'
iface = gr.Interface(inference, inputs=[gr.inputs.Audio(type="file"),"text"], outputs=gr.outputs.Audio(type="file"))
iface.launch()