Update app.py
Browse files
app.py
CHANGED
|
@@ -1,26 +1,26 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from gradio_client import Client, handle_file
|
| 3 |
+
|
| 4 |
+
def egyptian_tts(text, speaker_audio, temperature):
|
| 5 |
+
client = Client("MohamedRashad/Egyptian-Arabic-TTS")
|
| 6 |
+
result = client.predict(
|
| 7 |
+
text=text,
|
| 8 |
+
speaker_audio_path=handle_file(speaker_audio),
|
| 9 |
+
temperature=temperature,
|
| 10 |
+
api_name="/infer_EGTTS"
|
| 11 |
+
)
|
| 12 |
+
return result # ملف الصوت الناتج
|
| 13 |
+
|
| 14 |
+
iface = gr.Interface(
|
| 15 |
+
fn=egyptian_tts,
|
| 16 |
+
inputs=[
|
| 17 |
+
gr.Textbox(label="النص المراد تحويله إلى صوت"),
|
| 18 |
+
gr.Audio(type="filepath", label="رفع عينة صوتية للمتحدث"),
|
| 19 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.75, label="درجة العشوائية")
|
| 20 |
+
],
|
| 21 |
+
outputs=gr.Audio(label="الصوت الناتج"),
|
| 22 |
+
title="نسخ الصوت بالذكاء الاصطناعي",
|
| 23 |
+
description=""
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
iface.launch()
|