diff --git a/GPT_SoVITS/prepare_datasets/1-get-text.py b/GPT_SoVITS/prepare_datasets/1-get-text.py index 20a4564c..7e183103 100644 --- a/GPT_SoVITS/prepare_datasets/1-get-text.py +++ b/GPT_SoVITS/prepare_datasets/1-get-text.py @@ -12,6 +12,7 @@ opt_dir = os.environ.get("opt_dir") bert_pretrained_dir = os.environ.get("bert_pretrained_dir") import torch is_half = eval(os.environ.get("is_half", "True")) and torch.cuda.is_available() +version = os.environ.get('version', None) import sys, numpy as np, traceback, pdb import os.path from glob import glob @@ -84,7 +85,7 @@ if os.path.exists(txt_path) == False: name = os.path.basename(name) print(name) phones, word2ph, norm_text = clean_text( - text.replace("%", "-").replace("¥", ","), lan + text.replace("%", "-").replace("¥", ","), lan, version ) path_bert = "%s/%s.pt" % (bert_dir, name) if os.path.exists(path_bert) == False and lan == "zh": diff --git a/webui.py b/webui.py index 7a58d017..075f0f5c 100644 --- a/webui.py +++ b/webui.py @@ -62,7 +62,8 @@ else: from scipy.io import wavfile from tools.my_utils import load_audio from multiprocessing import cpu_count - +from text.g2pw import G2PWPinyin +g2pw = G2PWPinyin(model_dir="GPT_SoVITS/text/G2PWModel",model_source="GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",v_to_u=False, neutral_tone_with_five=True) # os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' # 当遇到mps不支持的步骤时使用cpu n_cpu=cpu_count()