import gradio as gr from gradio_client import Client def ask_ai_asg(message ): clientasg = Client("wasmdashai/dash-asg") result = clientasg.predict( text=message, namn_model="Group", api_name="/t2t" ) return result from gradio_client import Client def ask_ai(message ): client = Client("wasmdashai/T2T") result = client.predict( text=message, key="AIzaSyC85_3TKmiXtOpwybhSFThZdF1nGKlxU5c", api_name="/predict" ) return result def ask_asgchat(txt): txt=ask_ai(txt) txt=ask_ai_asg(txt) txt=ask_ai(txt) return txt def text_to_speech(text): return ask_asgchat(text) def cleanup_file(file_path): if os.path.exists(file_path): os.remove(file_path) # إعداد واجهة Gradio demo = gr.Interface( fn=text_to_speech, inputs=gr.Textbox(label="أدخل نصاً"), outputs=['text']) demo.launch()