import gradio as gr from gradio_client import Client, handle_file def egyptian_tts(text, speaker_audio, temperature): client = Client("MohamedRashad/Egyptian-Arabic-TTS") result = client.predict( text=text, speaker_audio_path=handle_file(speaker_audio), temperature=temperature, api_name="/infer_EGTTS" ) return result # ملف الصوت الناتج iface = gr.Interface( fn=egyptian_tts, inputs=[ gr.Textbox(label="النص المراد تحويله إلى صوت"), gr.Audio(type="filepath", label="رفع عينة صوتية للمتحدث"), gr.Slider(minimum=0.1, maximum=1.0, value=0.75, label="درجة العشوائية") ], outputs=gr.Audio(label="الصوت الناتج"), title="نسخ الصوت بالذكاء الاصطناعي", description="" ) iface.launch()