File size: 633 Bytes
d85e329
 
7fef4b1
 
 
 
 
 
 
d85e329
 
 
4a3c8fc
 
7fef4b1
e996a0b
d85e329
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
GK=0
from transformers import AutoTokenizer,VitsModel
import torch
token=os.environ.get("key_")
tokenizer = AutoTokenizer.from_pretrained("wasmdashai/vits-ar-sa-huba",token=token)
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_vits=VitsModel.from_pretrained("wasmdashai/vits-ar-sa-huba",token=token)#.to(device)


def greet(name):
    global GK 
    while True:
        GK+=1
        model_vits=VitsModel.from_pretrained("wasmdashai/vits-ar-sa-huba",token=token)#.to(device)
        yield f"namber is {GK}"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()