Commit
·
622b6ed
1
Parent(s):
2cb0f8a
update
Browse files- TTS_infer_pack/TTS.py +47 -47
- TTS_infer_pack/text_segmentation_method.py +1 -1
- download.py +2 -2
- export_torch_script.py +2 -2
- export_torch_script_v3v4.py +10 -10
- inference_webui.py +1 -1
- inference_webui_fast.py +1 -1
- onnx_export.py +1 -1
- prepare_datasets/2-get-sv.py +1 -1
- sv.py +2 -2
- text/chinese2.py +2 -2
TTS_infer_pack/TTS.py
CHANGED
@@ -149,45 +149,45 @@ class NO_PROMPT_ERROR(Exception):
|
|
149 |
# configs/tts_infer.yaml
|
150 |
"""
|
151 |
custom:
|
152 |
-
bert_base_path:
|
153 |
-
cnhuhbert_base_path:
|
154 |
device: cpu
|
155 |
is_half: false
|
156 |
-
t2s_weights_path:
|
157 |
-
vits_weights_path:
|
158 |
version: v2
|
159 |
v1:
|
160 |
-
bert_base_path:
|
161 |
-
cnhuhbert_base_path:
|
162 |
device: cpu
|
163 |
is_half: false
|
164 |
-
t2s_weights_path:
|
165 |
-
vits_weights_path:
|
166 |
version: v1
|
167 |
v2:
|
168 |
-
bert_base_path:
|
169 |
-
cnhuhbert_base_path:
|
170 |
device: cpu
|
171 |
is_half: false
|
172 |
-
t2s_weights_path:
|
173 |
-
vits_weights_path:
|
174 |
version: v2
|
175 |
v3:
|
176 |
-
bert_base_path:
|
177 |
-
cnhuhbert_base_path:
|
178 |
device: cpu
|
179 |
is_half: false
|
180 |
-
t2s_weights_path:
|
181 |
-
vits_weights_path:
|
182 |
version: v3
|
183 |
v4:
|
184 |
-
bert_base_path:
|
185 |
-
cnhuhbert_base_path:
|
186 |
device: cpu
|
187 |
is_half: false
|
188 |
-
t2s_weights_path:
|
189 |
version: v4
|
190 |
-
vits_weights_path:
|
191 |
"""
|
192 |
|
193 |
|
@@ -220,55 +220,55 @@ class TTS_Config:
|
|
220 |
"device": "cpu",
|
221 |
"is_half": False,
|
222 |
"version": "v1",
|
223 |
-
"t2s_weights_path": "
|
224 |
-
"vits_weights_path": "
|
225 |
-
"cnhuhbert_base_path": "
|
226 |
-
"bert_base_path": "
|
227 |
},
|
228 |
"v2": {
|
229 |
"device": "cpu",
|
230 |
"is_half": False,
|
231 |
"version": "v2",
|
232 |
-
"t2s_weights_path": "
|
233 |
-
"vits_weights_path": "
|
234 |
-
"cnhuhbert_base_path": "
|
235 |
-
"bert_base_path": "
|
236 |
},
|
237 |
"v3": {
|
238 |
"device": "cpu",
|
239 |
"is_half": False,
|
240 |
"version": "v3",
|
241 |
-
"t2s_weights_path": "
|
242 |
-
"vits_weights_path": "
|
243 |
-
"cnhuhbert_base_path": "
|
244 |
-
"bert_base_path": "
|
245 |
},
|
246 |
"v4": {
|
247 |
"device": "cpu",
|
248 |
"is_half": False,
|
249 |
"version": "v4",
|
250 |
-
"t2s_weights_path": "
|
251 |
-
"vits_weights_path": "
|
252 |
-
"cnhuhbert_base_path": "
|
253 |
-
"bert_base_path": "
|
254 |
},
|
255 |
"v2Pro": {
|
256 |
"device": "cpu",
|
257 |
"is_half": False,
|
258 |
"version": "v2Pro",
|
259 |
-
"t2s_weights_path": "
|
260 |
-
"vits_weights_path": "
|
261 |
-
"cnhuhbert_base_path": "
|
262 |
-
"bert_base_path": "
|
263 |
},
|
264 |
"v2ProPlus": {
|
265 |
"device": "cpu",
|
266 |
"is_half": False,
|
267 |
"version": "v2ProPlus",
|
268 |
-
"t2s_weights_path": "
|
269 |
-
"vits_weights_path": "
|
270 |
-
"cnhuhbert_base_path": "
|
271 |
-
"bert_base_path": "
|
272 |
},
|
273 |
}
|
274 |
configs: dict = None
|
@@ -289,7 +289,7 @@ class TTS_Config:
|
|
289 |
|
290 |
def __init__(self, configs: Union[dict, str] = None):
|
291 |
# 设置默认配置文件路径
|
292 |
-
configs_base_path: str = "
|
293 |
os.makedirs(configs_base_path, exist_ok=True)
|
294 |
self.configs_path: str = os.path.join(configs_base_path, "tts_infer.yaml")
|
295 |
|
@@ -602,7 +602,7 @@ class TTS:
|
|
602 |
self.empty_cache()
|
603 |
|
604 |
self.vocoder = BigVGAN.from_pretrained(
|
605 |
-
"%s/
|
606 |
use_cuda_kernel=False,
|
607 |
) # if True, RuntimeError: Ninja is required to load C++ extensions
|
608 |
# remove weight norm in the model and set to eval mode
|
@@ -635,7 +635,7 @@ class TTS:
|
|
635 |
)
|
636 |
self.vocoder.remove_weight_norm()
|
637 |
state_dict_g = torch.load(
|
638 |
-
"%s/
|
639 |
map_location="cpu",
|
640 |
weights_only=False,
|
641 |
)
|
|
|
149 |
# configs/tts_infer.yaml
|
150 |
"""
|
151 |
custom:
|
152 |
+
bert_base_path: pretrained_models/chinese-roberta-wwm-ext-large
|
153 |
+
cnhuhbert_base_path: pretrained_models/chinese-hubert-base
|
154 |
device: cpu
|
155 |
is_half: false
|
156 |
+
t2s_weights_path: pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt
|
157 |
+
vits_weights_path: pretrained_models/gsv-v2final-pretrained/s2G2333k.pth
|
158 |
version: v2
|
159 |
v1:
|
160 |
+
bert_base_path: pretrained_models/chinese-roberta-wwm-ext-large
|
161 |
+
cnhuhbert_base_path: pretrained_models/chinese-hubert-base
|
162 |
device: cpu
|
163 |
is_half: false
|
164 |
+
t2s_weights_path: pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt
|
165 |
+
vits_weights_path: pretrained_models/s2G488k.pth
|
166 |
version: v1
|
167 |
v2:
|
168 |
+
bert_base_path: pretrained_models/chinese-roberta-wwm-ext-large
|
169 |
+
cnhuhbert_base_path: pretrained_models/chinese-hubert-base
|
170 |
device: cpu
|
171 |
is_half: false
|
172 |
+
t2s_weights_path: pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt
|
173 |
+
vits_weights_path: pretrained_models/gsv-v2final-pretrained/s2G2333k.pth
|
174 |
version: v2
|
175 |
v3:
|
176 |
+
bert_base_path: pretrained_models/chinese-roberta-wwm-ext-large
|
177 |
+
cnhuhbert_base_path: pretrained_models/chinese-hubert-base
|
178 |
device: cpu
|
179 |
is_half: false
|
180 |
+
t2s_weights_path: pretrained_models/s1v3.ckpt
|
181 |
+
vits_weights_path: pretrained_models/s2Gv3.pth
|
182 |
version: v3
|
183 |
v4:
|
184 |
+
bert_base_path: pretrained_models/chinese-roberta-wwm-ext-large
|
185 |
+
cnhuhbert_base_path: pretrained_models/chinese-hubert-base
|
186 |
device: cpu
|
187 |
is_half: false
|
188 |
+
t2s_weights_path: pretrained_models/s1v3.ckpt
|
189 |
version: v4
|
190 |
+
vits_weights_path: pretrained_models/gsv-v4-pretrained/s2Gv4.pth
|
191 |
"""
|
192 |
|
193 |
|
|
|
220 |
"device": "cpu",
|
221 |
"is_half": False,
|
222 |
"version": "v1",
|
223 |
+
"t2s_weights_path": "pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt",
|
224 |
+
"vits_weights_path": "pretrained_models/s2G488k.pth",
|
225 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
226 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
227 |
},
|
228 |
"v2": {
|
229 |
"device": "cpu",
|
230 |
"is_half": False,
|
231 |
"version": "v2",
|
232 |
+
"t2s_weights_path": "pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt",
|
233 |
+
"vits_weights_path": "pretrained_models/gsv-v2final-pretrained/s2G2333k.pth",
|
234 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
235 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
236 |
},
|
237 |
"v3": {
|
238 |
"device": "cpu",
|
239 |
"is_half": False,
|
240 |
"version": "v3",
|
241 |
+
"t2s_weights_path": "pretrained_models/s1v3.ckpt",
|
242 |
+
"vits_weights_path": "pretrained_models/s2Gv3.pth",
|
243 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
244 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
245 |
},
|
246 |
"v4": {
|
247 |
"device": "cpu",
|
248 |
"is_half": False,
|
249 |
"version": "v4",
|
250 |
+
"t2s_weights_path": "pretrained_models/s1v3.ckpt",
|
251 |
+
"vits_weights_path": "pretrained_models/gsv-v4-pretrained/s2Gv4.pth",
|
252 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
253 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
254 |
},
|
255 |
"v2Pro": {
|
256 |
"device": "cpu",
|
257 |
"is_half": False,
|
258 |
"version": "v2Pro",
|
259 |
+
"t2s_weights_path": "pretrained_models/s1v3.ckpt",
|
260 |
+
"vits_weights_path": "pretrained_models/v2Pro/s2Gv2Pro.pth",
|
261 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
262 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
263 |
},
|
264 |
"v2ProPlus": {
|
265 |
"device": "cpu",
|
266 |
"is_half": False,
|
267 |
"version": "v2ProPlus",
|
268 |
+
"t2s_weights_path": "pretrained_models/s1v3.ckpt",
|
269 |
+
"vits_weights_path": "pretrained_models/v2Pro/s2Gv2ProPlus.pth",
|
270 |
+
"cnhuhbert_base_path": "pretrained_models/chinese-hubert-base",
|
271 |
+
"bert_base_path": "pretrained_models/chinese-roberta-wwm-ext-large",
|
272 |
},
|
273 |
}
|
274 |
configs: dict = None
|
|
|
289 |
|
290 |
def __init__(self, configs: Union[dict, str] = None):
|
291 |
# 设置默认配置文件路径
|
292 |
+
configs_base_path: str = "configs/"
|
293 |
os.makedirs(configs_base_path, exist_ok=True)
|
294 |
self.configs_path: str = os.path.join(configs_base_path, "tts_infer.yaml")
|
295 |
|
|
|
602 |
self.empty_cache()
|
603 |
|
604 |
self.vocoder = BigVGAN.from_pretrained(
|
605 |
+
"%s/pretrained_models/models--nvidia--bigvgan_v2_24khz_100band_256x" % (now_dir,),
|
606 |
use_cuda_kernel=False,
|
607 |
) # if True, RuntimeError: Ninja is required to load C++ extensions
|
608 |
# remove weight norm in the model and set to eval mode
|
|
|
635 |
)
|
636 |
self.vocoder.remove_weight_norm()
|
637 |
state_dict_g = torch.load(
|
638 |
+
"%s/pretrained_models/gsv-v4-pretrained/vocoder.pth" % (now_dir,),
|
639 |
map_location="cpu",
|
640 |
weights_only=False,
|
641 |
)
|
TTS_infer_pack/text_segmentation_method.py
CHANGED
@@ -158,7 +158,7 @@ def cut4(inp):
|
|
158 |
|
159 |
|
160 |
# 按标点符号切
|
161 |
-
# contributed by https://github.com/AI-Hobbyist/GPT-SoVITS/blob/main/
|
162 |
@register_method("cut5")
|
163 |
def cut5(inp):
|
164 |
inp = inp.strip("\n")
|
|
|
158 |
|
159 |
|
160 |
# 按标点符号切
|
161 |
+
# contributed by https://github.com/AI-Hobbyist/GPT-SoVITS/blob/main/inference_webui.py
|
162 |
@register_method("cut5")
|
163 |
def cut5(inp):
|
164 |
inp = inp.strip("\n")
|
download.py
CHANGED
@@ -6,8 +6,8 @@ sys.path.insert(0, now_dir)
|
|
6 |
from text.g2pw import G2PWPinyin
|
7 |
|
8 |
g2pw = G2PWPinyin(
|
9 |
-
model_dir="
|
10 |
-
model_source="
|
11 |
v_to_u=False,
|
12 |
neutral_tone_with_five=True,
|
13 |
)
|
|
|
6 |
from text.g2pw import G2PWPinyin
|
7 |
|
8 |
g2pw = G2PWPinyin(
|
9 |
+
model_dir="text/G2PWModel",
|
10 |
+
model_source="pretrained_models/chinese-roberta-wwm-ext-large",
|
11 |
v_to_u=False,
|
12 |
neutral_tone_with_five=True,
|
13 |
)
|
export_torch_script.py
CHANGED
@@ -561,8 +561,8 @@ class T2SModel(nn.Module):
|
|
561 |
return y[:, -idx:].unsqueeze(0)
|
562 |
|
563 |
|
564 |
-
bert_path = os.environ.get("bert_path", "
|
565 |
-
cnhubert_base_path = "
|
566 |
cnhubert.cnhubert_base_path = cnhubert_base_path
|
567 |
|
568 |
|
|
|
561 |
return y[:, -idx:].unsqueeze(0)
|
562 |
|
563 |
|
564 |
+
bert_path = os.environ.get("bert_path", "pretrained_models/chinese-roberta-wwm-ext-large")
|
565 |
+
cnhubert_base_path = "pretrained_models/chinese-hubert-base"
|
566 |
cnhubert.cnhubert_base_path = cnhubert_base_path
|
567 |
|
568 |
|
export_torch_script_v3v4.py
CHANGED
@@ -505,7 +505,7 @@ def init_bigvgan():
|
|
505 |
from BigVGAN import bigvgan
|
506 |
|
507 |
bigvgan_model = bigvgan.BigVGAN.from_pretrained(
|
508 |
-
"%s/
|
509 |
use_cuda_kernel=False,
|
510 |
) # if True, RuntimeError: Ninja is required to load C++ extensions
|
511 |
# remove weight norm in the model and set to eval mode
|
@@ -533,7 +533,7 @@ def init_hifigan():
|
|
533 |
hifigan_model.eval()
|
534 |
hifigan_model.remove_weight_norm()
|
535 |
state_dict_g = torch.load(
|
536 |
-
"%s/
|
537 |
)
|
538 |
print("loading vocoder", hifigan_model.load_state_dict(state_dict_g))
|
539 |
if is_half == True:
|
@@ -584,7 +584,7 @@ v3v4set = {"v3", "v4"}
|
|
584 |
|
585 |
|
586 |
def get_sovits_weights(sovits_path):
|
587 |
-
path_sovits_v3 = "
|
588 |
is_exist_s2gv3 = os.path.exists(path_sovits_v3)
|
589 |
|
590 |
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
@@ -707,13 +707,13 @@ def export_cfm(
|
|
707 |
|
708 |
def export_1(ref_wav_path, ref_wav_text, version="v3"):
|
709 |
if version == "v3":
|
710 |
-
sovits = get_sovits_weights("
|
711 |
init_bigvgan()
|
712 |
else:
|
713 |
-
sovits = get_sovits_weights("
|
714 |
init_hifigan()
|
715 |
|
716 |
-
dict_s1 = torch.load("
|
717 |
raw_t2s = get_raw_t2s_model(dict_s1).to(device)
|
718 |
print("#### get_raw_t2s_model ####")
|
719 |
print(raw_t2s.config)
|
@@ -1124,10 +1124,10 @@ import time
|
|
1124 |
|
1125 |
def export_2(version="v3"):
|
1126 |
if version == "v3":
|
1127 |
-
sovits = get_sovits_weights("
|
1128 |
# init_bigvgan()
|
1129 |
else:
|
1130 |
-
sovits = get_sovits_weights("
|
1131 |
# init_hifigan()
|
1132 |
|
1133 |
# cfm = ExportCFM(sovits.cfm)
|
@@ -1142,9 +1142,9 @@ def export_2(version="v3"):
|
|
1142 |
|
1143 |
logger.info("cfm ok")
|
1144 |
|
1145 |
-
dict_s1 = torch.load("
|
1146 |
# v2 的 gpt 也可以用
|
1147 |
-
# dict_s1 = torch.load("
|
1148 |
raw_t2s = get_raw_t2s_model(dict_s1).to(device)
|
1149 |
print("#### get_raw_t2s_model ####")
|
1150 |
print(raw_t2s.config)
|
|
|
505 |
from BigVGAN import bigvgan
|
506 |
|
507 |
bigvgan_model = bigvgan.BigVGAN.from_pretrained(
|
508 |
+
"%s/pretrained_models/models--nvidia--bigvgan_v2_24khz_100band_256x" % (now_dir,),
|
509 |
use_cuda_kernel=False,
|
510 |
) # if True, RuntimeError: Ninja is required to load C++ extensions
|
511 |
# remove weight norm in the model and set to eval mode
|
|
|
533 |
hifigan_model.eval()
|
534 |
hifigan_model.remove_weight_norm()
|
535 |
state_dict_g = torch.load(
|
536 |
+
"%s/pretrained_models/gsv-v4-pretrained/vocoder.pth" % (now_dir,), map_location="cpu"
|
537 |
)
|
538 |
print("loading vocoder", hifigan_model.load_state_dict(state_dict_g))
|
539 |
if is_half == True:
|
|
|
584 |
|
585 |
|
586 |
def get_sovits_weights(sovits_path):
|
587 |
+
path_sovits_v3 = "pretrained_models/s2Gv3.pth"
|
588 |
is_exist_s2gv3 = os.path.exists(path_sovits_v3)
|
589 |
|
590 |
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
|
|
707 |
|
708 |
def export_1(ref_wav_path, ref_wav_text, version="v3"):
|
709 |
if version == "v3":
|
710 |
+
sovits = get_sovits_weights("pretrained_models/s2Gv3.pth")
|
711 |
init_bigvgan()
|
712 |
else:
|
713 |
+
sovits = get_sovits_weights("pretrained_models/gsv-v4-pretrained/s2Gv4.pth")
|
714 |
init_hifigan()
|
715 |
|
716 |
+
dict_s1 = torch.load("pretrained_models/s1v3.ckpt")
|
717 |
raw_t2s = get_raw_t2s_model(dict_s1).to(device)
|
718 |
print("#### get_raw_t2s_model ####")
|
719 |
print(raw_t2s.config)
|
|
|
1124 |
|
1125 |
def export_2(version="v3"):
|
1126 |
if version == "v3":
|
1127 |
+
sovits = get_sovits_weights("pretrained_models/s2Gv3.pth")
|
1128 |
# init_bigvgan()
|
1129 |
else:
|
1130 |
+
sovits = get_sovits_weights("pretrained_models/gsv-v4-pretrained/s2Gv4.pth")
|
1131 |
# init_hifigan()
|
1132 |
|
1133 |
# cfm = ExportCFM(sovits.cfm)
|
|
|
1142 |
|
1143 |
logger.info("cfm ok")
|
1144 |
|
1145 |
+
dict_s1 = torch.load("pretrained_models/s1v3.ckpt")
|
1146 |
# v2 的 gpt 也可以用
|
1147 |
+
# dict_s1 = torch.load("pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt")
|
1148 |
raw_t2s = get_raw_t2s_model(dict_s1).to(device)
|
1149 |
print("#### get_raw_t2s_model ####")
|
1150 |
print(raw_t2s.config)
|
inference_webui.py
CHANGED
@@ -1063,7 +1063,7 @@ def cut4(inp):
|
|
1063 |
return "\n".join(opts)
|
1064 |
|
1065 |
|
1066 |
-
# contributed by https://github.com/AI-Hobbyist/GPT-SoVITS/blob/main/
|
1067 |
def cut5(inp):
|
1068 |
inp = inp.strip("\n")
|
1069 |
punds = {",", ".", ";", "?", "!", "、", ",", "。", "?", "!", ";", ":", "…"}
|
|
|
1063 |
return "\n".join(opts)
|
1064 |
|
1065 |
|
1066 |
+
# contributed by https://github.com/AI-Hobbyist/GPT-SoVITS/blob/main/inference_webui.py
|
1067 |
def cut5(inp):
|
1068 |
inp = inp.strip("\n")
|
1069 |
punds = {",", ".", ";", "?", "!", "、", ",", "。", "?", "!", ";", ":", "…"}
|
inference_webui_fast.py
CHANGED
@@ -109,7 +109,7 @@ path_sovits_v4 = pretrained_sovits_name["v4"]
|
|
109 |
is_exist_s2gv3 = os.path.exists(path_sovits_v3)
|
110 |
is_exist_s2gv4 = os.path.exists(path_sovits_v4)
|
111 |
|
112 |
-
tts_config = TTS_Config("
|
113 |
tts_config.device = device
|
114 |
tts_config.is_half = is_half
|
115 |
tts_config.version = version
|
|
|
109 |
is_exist_s2gv3 = os.path.exists(path_sovits_v3)
|
110 |
is_exist_s2gv4 = os.path.exists(path_sovits_v4)
|
111 |
|
112 |
+
tts_config = TTS_Config("configs/tts_infer.yaml")
|
113 |
tts_config.device = device
|
114 |
tts_config.is_half = is_half
|
115 |
tts_config.version = version
|
onnx_export.py
CHANGED
@@ -5,7 +5,7 @@ from feature_extractor import cnhubert
|
|
5 |
from module.models_onnx import SynthesizerTrn, symbols_v1, symbols_v2
|
6 |
from torch import nn
|
7 |
|
8 |
-
cnhubert_base_path = "
|
9 |
cnhubert.cnhubert_base_path = cnhubert_base_path
|
10 |
ssl_model = cnhubert.get_model()
|
11 |
import json
|
|
|
5 |
from module.models_onnx import SynthesizerTrn, symbols_v1, symbols_v2
|
6 |
from torch import nn
|
7 |
|
8 |
+
cnhubert_base_path = "pretrained_models/chinese-hubert-base"
|
9 |
cnhubert.cnhubert_base_path = cnhubert_base_path
|
10 |
ssl_model = cnhubert.get_model()
|
11 |
import json
|
prepare_datasets/2-get-sv.py
CHANGED
@@ -22,7 +22,7 @@ import torchaudio
|
|
22 |
|
23 |
now_dir = os.getcwd()
|
24 |
sys.path.append(now_dir)
|
25 |
-
sys.path.append(f"{now_dir}/
|
26 |
from tools.my_utils import clean_path
|
27 |
from time import time as ttime
|
28 |
import shutil
|
|
|
22 |
|
23 |
now_dir = os.getcwd()
|
24 |
sys.path.append(now_dir)
|
25 |
+
sys.path.append(f"{now_dir}/eres2net")
|
26 |
from tools.my_utils import clean_path
|
27 |
from time import time as ttime
|
28 |
import shutil
|
sv.py
CHANGED
@@ -2,8 +2,8 @@ import sys
|
|
2 |
import os
|
3 |
import torch
|
4 |
|
5 |
-
sys.path.append(f"{os.getcwd()}/
|
6 |
-
sv_path = "
|
7 |
from ERes2NetV2 import ERes2NetV2
|
8 |
import kaldi as Kaldi
|
9 |
|
|
|
2 |
import os
|
3 |
import torch
|
4 |
|
5 |
+
sys.path.append(f"{os.getcwd()}/eres2net")
|
6 |
+
sv_path = "pretrained_models/sv/pretrained_eres2netv2w24s4ep4.ckpt"
|
7 |
from ERes2NetV2 import ERes2NetV2
|
8 |
import kaldi as Kaldi
|
9 |
|
text/chinese2.py
CHANGED
@@ -32,8 +32,8 @@ if is_g2pw:
|
|
32 |
|
33 |
parent_directory = os.path.dirname(current_file_path)
|
34 |
g2pw = G2PWPinyin(
|
35 |
-
model_dir="
|
36 |
-
model_source=os.environ.get("bert_path", "
|
37 |
v_to_u=False,
|
38 |
neutral_tone_with_five=True,
|
39 |
)
|
|
|
32 |
|
33 |
parent_directory = os.path.dirname(current_file_path)
|
34 |
g2pw = G2PWPinyin(
|
35 |
+
model_dir="text/G2PWModel",
|
36 |
+
model_source=os.environ.get("bert_path", "pretrained_models/chinese-roberta-wwm-ext-large"),
|
37 |
v_to_u=False,
|
38 |
neutral_tone_with_five=True,
|
39 |
)
|