diff --git a/api.py b/api.py index 3db2bc42..f34d86af 100644 --- a/api.py +++ b/api.py @@ -998,9 +998,9 @@ else: # 初始化模型 cnhubert.cnhubert_base_path = cnhubert_base_path # tokenizer = AutoTokenizer.from_pretrained(bert_path) -tokenizer = AutoTokenizer.from_pretrained(bert_path, weights_only=False) +tokenizer = AutoTokenizer.from_pretrained(bert_path) -bert_model = AutoModelForMaskedLM.from_pretrained(bert_path, weights_only=False) +bert_model = AutoModelForMaskedLM.from_pretrained(bert_path) ssl_model = cnhubert.get_model() if is_half: bert_model = bert_model.half().to(device)