swapnil6969 commited on
Commit
e5b7959
·
verified ·
1 Parent(s): 96c6fd5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
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()