GPT-SoVITS/GPT_SoVITS/download.py
Spr_Aachen 35fac290ba Improve G2PWPinyin model handling
- Add 'bert_pretrained_dir' environment variable as the highest priority for model_source
- Replace redundant g2pw initialization in chinese2.py with import from download.py
- Remove unused 'parent_directory' variable
2025-11-10 15:00:00 +08:00

14 lines
372 B
Python

import os
import sys
now_dir = os.getcwd()
sys.path.insert(0, now_dir)
from text.g2pw import G2PWPinyin
g2pw = G2PWPinyin(
model_dir="GPT_SoVITS/text/G2PWModel",
model_source=os.environ.get("bert_pretrained_dir") or os.environ.get("bert_path") or "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",
v_to_u=False,
neutral_tone_with_five=True,
)