Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
markdown_description = """## Instructions:
|
| 4 |
+
1. Enter the text you want to synthesize.
|
| 5 |
+
2. Upload a 4-5 seconds audio file of the speaker you want to clone.
|
| 6 |
+
3. Click on the "Generate" button.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
with gr.Blocks(title="EGTTS") as app:
|
| 10 |
+
gr.HTML("<center><h1>Moroccan-Darija-TTS</h1></center>")
|
| 11 |
+
gr.Markdown(markdown_description)
|
| 12 |
+
with gr.Row():
|
| 13 |
+
with gr.Column():
|
| 14 |
+
text = gr.Textbox(label="Text to synthesize", value="السلام عليكم ورحمة الله", text_align="right", lines=3)
|
| 15 |
+
speaker_refrence = gr.Audio(label="Speaker reference", type="filepath")
|
| 16 |
+
temperature = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, value=0.75, step=0.05)
|
| 17 |
+
generate_btn = gr.Button(value="Generate", variant="primary")
|
| 18 |
+
output = gr.Audio(label="Synthesized audio")
|
| 19 |
+
|
| 20 |
+
generate_btn.click(lambda x, y, z: None, inputs=[text, speaker_refrence, temperature], outputs=output)
|
| 21 |
+
|
| 22 |
+
app.launch()
|