Spaces:
Runtime error
Runtime error
import os | |
import gradio as gr | |
os.system('ffmpeg-normalize $sample -nt rms -t=-27 -o $sample -ar 16000 -f') | |
def greet(text, audio_file_path): | |
text = "%s" % text | |
audio_file_path = "%s" % audio_file_path | |
out_path = "scripts/output/audio.wav" | |
os.system(f'python scripts/train.py --audio_path {audio_file_path}\ | |
--output_dir "models"') | |
os.system(f'python scripts/cloning_inference.py --model_path "models/microsoft_speecht5_tts_{audio_file_path[:-4]}"\ | |
--input_text {text} --output_path {out_path}') | |
return out_path | |
demo = gr.Interface( | |
fn=greet, | |
inputs=[gr.inputs.Textbox(label='What would you like the voice to say? (max. 2000 characters per request)'), | |
gr.Audio(type="filepath", source="upload", label='Upload a voice to clone (max. 50mb)')], | |
outputs="audio", | |
title="Deep Voice Cloning Tool" | |
) | |
demo.launch() | |