Spaces:
Configuration error
Configuration error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
from inference import infer_main # This should already exist in your repo
|
| 4 |
+
|
| 5 |
+
def generate_voice(text, reference_audio):
|
| 6 |
+
output_path = infer_main(reference_audio.name, text)
|
| 7 |
+
return output_path
|
| 8 |
+
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=generate_voice,
|
| 11 |
+
inputs=[
|
| 12 |
+
gr.Textbox(label="Text"),
|
| 13 |
+
gr.Audio(label="Reference Speaker Audio", type="filepath")
|
| 14 |
+
],
|
| 15 |
+
outputs=gr.Audio(label="Generated Voice", type="filepath"),
|
| 16 |
+
title="OpenVoice (Orpheus) - Real-time Voice Cloning",
|
| 17 |
+
description="Upload a short reference audio (2–5 sec), type any text, and get the cloned voice output."
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
iface.launch()
|