File size: 969 Bytes
fcd1b85
25e4206
 
29c48c6
25e4206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78d4a12
25e4206
 
 
 
78d4a12
 
 
 
 
 
 
 
 
 
 
 
fcd1b85
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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()