Update app.py
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ def synthesize(text, selected_model, speaker_id, custom_model_url, speaker_wav_p
|
|
| 79 |
"speaker_used": speaker_info
|
| 80 |
}
|
| 81 |
|
| 82 |
-
# Gradio UI
|
| 83 |
with gr.Blocks() as demo:
|
| 84 |
gr.Markdown("## 🗣️ TTS App (Model, Speaker, Language, Cloning, API-ready)")
|
| 85 |
|
|
@@ -112,15 +112,24 @@ with gr.Blocks() as demo:
|
|
| 112 |
outputs=[output_audio, metadata_json]
|
| 113 |
)
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
#
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
"speaker_used": speaker_info
|
| 80 |
}
|
| 81 |
|
| 82 |
+
# Gradio UI
|
| 83 |
with gr.Blocks() as demo:
|
| 84 |
gr.Markdown("## 🗣️ TTS App (Model, Speaker, Language, Cloning, API-ready)")
|
| 85 |
|
|
|
|
| 112 |
outputs=[output_audio, metadata_json]
|
| 113 |
)
|
| 114 |
|
| 115 |
+
gr.Markdown("### 🔌 API Access Available")
|
| 116 |
+
|
| 117 |
+
# API Interface
|
| 118 |
+
api = gr.Interface(
|
| 119 |
+
fn=synthesize,
|
| 120 |
+
inputs=[
|
| 121 |
+
gr.Text(), # text
|
| 122 |
+
gr.Text(), # model
|
| 123 |
+
gr.Text(), # speaker id
|
| 124 |
+
gr.Text(), # custom model url
|
| 125 |
+
gr.Audio(type="filepath"), # speaker wav
|
| 126 |
+
gr.Text() # language
|
| 127 |
+
],
|
| 128 |
+
outputs=[gr.Audio(type="filepath"), gr.JSON()],
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
+
# Launch both
|
| 132 |
+
demo.queue()
|
| 133 |
+
api.queue()
|
| 134 |
+
demo.launch()
|
| 135 |
+
|