You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
################### bug code #################################
def get_bert_feature(text, word2ph, device=None, model_id='hfl/chinese-roberta-wwm-ext-large'):
if model_id not in models:
models[model_id] = AutoModelForMaskedLM.from_pretrained(
model_id
).to(device)
tokenizers[model_id] = AutoTokenizer.from_pretrained(model_id)
model = models[model_id]
tokenizer = tokenizers[model_id]
if (
sys.platform == "darwin"
and torch.backends.mps.is_available()
and device == "cpu"
):
device = "mps"
if not device:
device = "cuda"
################### fix code #################################
def get_bert_feature(text, word2ph, device=None, model_id='hfl/chinese-roberta-wwm-ext-large'):
global model
global tokenizer
if (
sys.platform == "darwin"
and torch.backends.mps.is_available()
and device == "cpu"
):
device = "mps"
if not device:
device = "cuda"
if model_id not in models:
models[model_id] = AutoModelForMaskedLM.from_pretrained(
model_id
).to(device)
tokenizers[model_id] = AutoTokenizer.from_pretrained(model_id)
model = models[model_id]
tokenizer = tokenizers[model_id]
After running this:
From the instructions: https://github.com/myshell-ai/MeloTTS/blob/main/docs/install.md
This error results:
Does anyone else experience this? Any tips on debugging?
The text was updated successfully, but these errors were encountered: