From 550c37528cf7ff5ca781c1ac10ef60fbcb2b4a74 Mon Sep 17 00:00:00 2001 From: samiabat Date: Mon, 24 Mar 2025 21:09:02 +0300 Subject: [PATCH] add all --- api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index d92d9c8b..6de3fa15 100644 --- a/api.py +++ b/api.py @@ -997,8 +997,10 @@ else: # 初始化模型 cnhubert.cnhubert_base_path = cnhubert_base_path -tokenizer = AutoTokenizer.from_pretrained(bert_path) -bert_model = AutoModelForMaskedLM.from_pretrained(bert_path) +# tokenizer = AutoTokenizer.from_pretrained(bert_path) +tokenizer = AutoTokenizer.from_pretrained(os.path.join(os.getcwd(), bert_path)) + +bert_model = AutoModelForMaskedLM.from_pretrained(os.path.join(os.getcwd(), bert_path)) ssl_model = cnhubert.get_model() if is_half: bert_model = bert_model.half().to(device)