Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from TTS.api import TTS
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
# Charger le modèle
|
5 |
+
tts = TTS(model_name="IbrahimSalah/F5-TTS-Arabic")
|
6 |
+
|
7 |
+
# Fonction de synthèse
|
8 |
+
def synthesize(text):
|
9 |
+
output_path = "output.wav"
|
10 |
+
tts.tts_to_file(text, file_path=output_path)
|
11 |
+
return output_path
|
12 |
+
|
13 |
+
# Interface Gradio
|
14 |
+
demo = gr.Interface(fn=synthesize,
|
15 |
+
inputs=gr.Textbox(label="Texte en arabe"),
|
16 |
+
outputs=gr.Audio(type="filepath"),
|
17 |
+
title="TTS Arabe avec F5")
|
18 |
+
|
19 |
+
demo.launch()
|