From d8adfe5c90d364989ffc8f166322ffd4cd6d702e Mon Sep 17 00:00:00 2001 From: Spr_Aachen <2835946988@qq.com> Date: Sun, 6 Apr 2025 22:27:03 +0800 Subject: [PATCH] Fix bert path retrieval issue when initializing G2PWPinyin --- api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api.py b/api.py index 0f34149f..c8a1f5d6 100644 --- a/api.py +++ b/api.py @@ -1007,6 +1007,7 @@ else: logger.info(f"数据类型: int16") # 初始化模型 +os.environ["bert_path"] = bert_path cnhubert.cnhubert_base_path = cnhubert_base_path tokenizer = AutoTokenizer.from_pretrained(bert_path) bert_model = AutoModelForMaskedLM.from_pretrained(bert_path)