v1v2 Version Switching (#1391)

v1v2 Version Switching
This commit is contained in:
XXXXRT666
2024-08-06 12:00:51 +08:00
committed by GitHub
parent 4e34814c70
commit a3f5fb9614
26 changed files with 307 additions and 177 deletions

View File

@@ -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":

View File

@@ -8,6 +8,7 @@ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ.get("_CUDA_VISIBLE_DEVICES")
opt_dir = os.environ.get("opt_dir")
pretrained_s2G = os.environ.get("pretrained_s2G")
s2config_path = os.environ.get("s2config_path")
version=os.environ.get("version","v2")
import torch
is_half = eval(os.environ.get("is_half", "True")) and torch.cuda.is_available()
import math, traceback
@@ -50,6 +51,7 @@ if os.path.exists(semantic_path) == False:
hps.data.filter_length // 2 + 1,
hps.train.segment_size // hps.data.hop_length,
n_speakers=hps.data.n_speakers,
version=version,
**hps.model
)
if is_half == True: