Spaces:
Running
Running
import gradio as gr | |
import subprocess | |
def synthesize_text(text): | |
# Replace 'piper_cli_script.py' with the path to your Piper CLI script | |
command = ['python', 'piper_cli_script.py', '--model', 'model_path.onnx', '--text', text] | |
result = subprocess.run(command, capture_output=True, text=True) | |
# Handle result and output file path | |
return 'path_to_output_audio.wav' | |
iface = gr.Interface( | |
fn=synthesize_text, | |
inputs="text", | |
outputs="audio" | |
) | |
iface.launch() |