Spaces:
Sleeping
Sleeping
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,9 @@ tokenizer = AutoTokenizer.from_pretrained("asg2024/vits-ar-sa-huba",token=api_ke
|
|
15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
16 |
def get_model(name_model):
|
17 |
global models
|
18 |
-
if name_model in
|
19 |
-
models[name_model]
|
|
|
20 |
return models[name_model]
|
21 |
|
22 |
def genrate_speech(text,name_model):
|
|
|
15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
16 |
def get_model(name_model):
|
17 |
global models
|
18 |
+
if name_model in models:
|
19 |
+
return models[name_model]
|
20 |
+
models[name_model]=VitsModel.from_pretrained(name_model,token=api_key).to(device)
|
21 |
return models[name_model]
|
22 |
|
23 |
def genrate_speech(text,name_model):
|