Spaces:
Runtime error
Runtime error
Update app.py
Browse files7 unmodified lines89101112131415161718197 unmodified lines#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 GKwhile True:GK+=1model_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")7 unmodified lines8910111213141516171819202122232425262728297 unmodified lines#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 modelspeech(texts):inputs = tokenizer(texts, return_tensors="pt")#.cuda()wav = model_vits(input_ids=inputs["input_ids"]).waveform#.detach()# display(Audio(wav, rate=model.config.sampling_rate))return model_vits.config.sampling_rate,wav#remove_noise_nr(wav)def greet(id):global GKb=int(id)while True:GK+=1texts=['السلام عليكم']*bout=modelspeech(texts)yield f"namber is {GK}"demo = gr.Interface(fn=greet, inputs="text", outputs="text")
app.py+12-2