mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-06 03:57:44 +08:00
chores
This commit is contained in:
parent
03a43edcd0
commit
1fca1ec17c
@ -182,6 +182,10 @@ class TTS_Config:
|
|||||||
|
|
||||||
|
|
||||||
def _load_configs(self, configs_path: str)->dict:
|
def _load_configs(self, configs_path: str)->dict:
|
||||||
|
if os.path.exists(configs_path):
|
||||||
|
...
|
||||||
|
else:
|
||||||
|
self.save_configs()
|
||||||
with open(configs_path, 'r') as f:
|
with open(configs_path, 'r') as f:
|
||||||
configs = yaml.load(f, Loader=yaml.FullLoader)
|
configs = yaml.load(f, Loader=yaml.FullLoader)
|
||||||
|
|
||||||
@ -748,7 +752,8 @@ class TTS:
|
|||||||
phones, bert_features, norm_text = \
|
phones, bert_features, norm_text = \
|
||||||
self.text_preprocessor.segment_and_extract_feature_for_text(
|
self.text_preprocessor.segment_and_extract_feature_for_text(
|
||||||
prompt_text,
|
prompt_text,
|
||||||
prompt_lang)
|
prompt_lang,
|
||||||
|
self.configs.version)
|
||||||
self.prompt_cache["phones"] = phones
|
self.prompt_cache["phones"] = phones
|
||||||
self.prompt_cache["bert_features"] = bert_features
|
self.prompt_cache["bert_features"] = bert_features
|
||||||
self.prompt_cache["norm_text"] = norm_text
|
self.prompt_cache["norm_text"] = norm_text
|
||||||
@ -760,7 +765,7 @@ class TTS:
|
|||||||
t1 = ttime()
|
t1 = ttime()
|
||||||
data:list = None
|
data:list = None
|
||||||
if not return_fragment:
|
if not return_fragment:
|
||||||
data = self.text_preprocessor.preprocess(text, text_lang, text_split_method)
|
data = self.text_preprocessor.preprocess(text, text_lang, text_split_method, self.configs.version)
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
yield self.configs.sampling_rate, np.zeros(int(self.configs.sampling_rate),
|
yield self.configs.sampling_rate, np.zeros(int(self.configs.sampling_rate),
|
||||||
dtype=np.int16)
|
dtype=np.int16)
|
||||||
|
@ -55,9 +55,9 @@ class TextPreprocessor:
|
|||||||
self.tokenizer = tokenizer
|
self.tokenizer = tokenizer
|
||||||
self.device = device
|
self.device = device
|
||||||
|
|
||||||
def preprocess(self, text:str, lang:str, text_split_method:str, version:str="v1")->List[Dict]:
|
def preprocess(self, text:str, lang:str, text_split_method:str, version:str="v2")->List[Dict]:
|
||||||
print(i18n("############ 切分文本 ############"))
|
print(i18n("############ 切分文本 ############"))
|
||||||
text = self.replace_consecutive_punctuation(text) # 变量命名应该是写错了
|
text = self.replace_consecutive_punctuation(text)
|
||||||
texts = self.pre_seg_text(text, lang, text_split_method)
|
texts = self.pre_seg_text(text, lang, text_split_method)
|
||||||
result = []
|
result = []
|
||||||
print(i18n("############ 提取文本Bert特征 ############"))
|
print(i18n("############ 提取文本Bert特征 ############"))
|
||||||
@ -204,7 +204,7 @@ class TextPreprocessor:
|
|||||||
phone_level_feature = torch.cat(phone_level_feature, dim=0)
|
phone_level_feature = torch.cat(phone_level_feature, dim=0)
|
||||||
return phone_level_feature.T
|
return phone_level_feature.T
|
||||||
|
|
||||||
def clean_text_inf(self, text:str, language:str, version:str="v1"):
|
def clean_text_inf(self, text:str, language:str, version:str="v2"):
|
||||||
phones, word2ph, norm_text = clean_text(text, language, version)
|
phones, word2ph, norm_text = clean_text(text, language, version)
|
||||||
phones = cleaned_text_to_sequence(phones, version)
|
phones = cleaned_text_to_sequence(phones, version)
|
||||||
return phones, word2ph, norm_text
|
return phones, word2ph, norm_text
|
||||||
|
1
GPT_SoVITS/configs/.gitignore
vendored
Normal file
1
GPT_SoVITS/configs/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.yaml
|
@ -1,24 +0,0 @@
|
|||||||
custom:
|
|
||||||
bert_base_path: GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large
|
|
||||||
cnhuhbert_base_path: GPT_SoVITS/pretrained_models/chinese-hubert-base
|
|
||||||
device: cuda
|
|
||||||
is_half: true
|
|
||||||
t2s_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt
|
|
||||||
version: v2
|
|
||||||
vits_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth
|
|
||||||
default:
|
|
||||||
bert_base_path: GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large
|
|
||||||
cnhuhbert_base_path: GPT_SoVITS/pretrained_models/chinese-hubert-base
|
|
||||||
device: cpu
|
|
||||||
is_half: false
|
|
||||||
t2s_weights_path: GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt
|
|
||||||
version: v1
|
|
||||||
vits_weights_path: GPT_SoVITS/pretrained_models/s2G488k.pth
|
|
||||||
default_v2:
|
|
||||||
bert_base_path: GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large
|
|
||||||
cnhuhbert_base_path: GPT_SoVITS/pretrained_models/chinese-hubert-base
|
|
||||||
device: cpu
|
|
||||||
is_half: false
|
|
||||||
t2s_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt
|
|
||||||
version: v2
|
|
||||||
vits_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth
|
|
Loading…
x
Reference in New Issue
Block a user