Spaces:
Paused
Paused
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# app.py
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
from model_handler import call_model_with_timeout
|
5 |
+
|
6 |
+
def synthesize(text, ref_audio, ref_text):
|
7 |
+
if not ref_audio:
|
8 |
+
return "β Please upload a reference WAV file", None
|
9 |
+
|
10 |
+
status, output_path = call_model_with_timeout(text, ref_audio.name, ref_text)
|
11 |
+
return status, output_path
|
12 |
+
|
13 |
+
iface = gr.Interface(
|
14 |
+
fn=synthesize,
|
15 |
+
inputs=[
|
16 |
+
gr.Textbox(label="π Hindi Text to Synthesize"),
|
17 |
+
gr.Audio(label="π€ Reference Audio (.wav)", type="file"),
|
18 |
+
gr.Textbox(label="π Reference Text (Optional)", value="")
|
19 |
+
],
|
20 |
+
outputs=[
|
21 |
+
gr.Textbox(label="π Status"),
|
22 |
+
gr.Audio(label="π Synthesized Audio")
|
23 |
+
],
|
24 |
+
title="AI4Bharat Hindi TTS (IndicF5)",
|
25 |
+
description="Enter Hindi text, upload a reference audio file, and get synthesized output using the Hugging Face AI4Bharat/IndicF5 model."
|
26 |
+
)
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
iface.launch()
|