From 8c1b6c0f6a56f745169f0343baad5217ee270de1 Mon Sep 17 00:00:00 2001 From: Spr_Aachen <2835946988@qq.com> Date: Mon, 11 Nov 2024 22:37:36 +0800 Subject: [PATCH] Fix path retrieval issue for model_source --- GPT_SoVITS/text/chinese2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPT_SoVITS/text/chinese2.py b/GPT_SoVITS/text/chinese2.py index f716b410..7f4fb539 100644 --- a/GPT_SoVITS/text/chinese2.py +++ b/GPT_SoVITS/text/chinese2.py @@ -27,7 +27,9 @@ if is_g2pw: print("当前使用g2pw进行拼音推理") from text.g2pw import G2PWPinyin, correct_pronunciation parent_directory = os.path.dirname(current_file_path) - g2pw = G2PWPinyin(model_dir="GPT_SoVITS/text/G2PWModel",model_source=os.environ.get("bert_path","GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large"),v_to_u=False, neutral_tone_with_five=True) + g2pw = G2PWPinyin(model_dir="GPT_SoVITS/text/G2PWModel", + model_source=os.environ.get("bert_path") or os.environ.get("bert_pretrained_dir") or "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large", + v_to_u=False, neutral_tone_with_five=True) rep_map = { ":": ",",