Update japanese_bert.py
This commit is contained in:
@@ -4,7 +4,7 @@ from transformers import AutoTokenizer, AutoModelForMaskedLM
|
|||||||
|
|
||||||
tokenizer = AutoTokenizer.from_pretrained("./bert/bert-base-japanese-v3")
|
tokenizer = AutoTokenizer.from_pretrained("./bert/bert-base-japanese-v3")
|
||||||
|
|
||||||
def get_bert_feature(text, word2ph):
|
def get_bert_feature(text, word2ph, device=None):
|
||||||
if sys.platform == "darwin" and torch.backends.mps.is_available() and device == "cpu":
|
if sys.platform == "darwin" and torch.backends.mps.is_available() and device == "cpu":
|
||||||
device = "mps"
|
device = "mps"
|
||||||
if not device:
|
if not device:
|
||||||
|
|||||||
Reference in New Issue
Block a user