chores:warning

This commit is contained in:
XXXXRT666 2024-08-06 17:28:32 +08:00
parent 420b6c8252
commit dd850f357b

View File

@ -747,7 +747,7 @@ def switch_version(version_):
return {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2].replace("s2G","s2D")}, {'__type__':'update', 'value':pretrained_gpt_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_gpt_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2]} return {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2].replace("s2G","s2D")}, {'__type__':'update', 'value':pretrained_gpt_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_gpt_name[-int(version[-1])+2]}, {'__type__':'update', 'value':pretrained_sovits_name[-int(version[-1])+2]}
def check_for_exists(file_list=[],is_train=False): def check_for_exists(file_list=[],is_train=False):
_='' _=[]
if is_train == True and file_list: if is_train == True and file_list:
file_list.append(os.path.join(file_list[0],'2-name2text.txt')) file_list.append(os.path.join(file_list[0],'2-name2text.txt'))
file_list.append(os.path.join(file_list[0],'3-bert')) file_list.append(os.path.join(file_list[0],'3-bert'))
@ -756,8 +756,13 @@ def check_for_exists(file_list=[],is_train=False):
file_list.append(os.path.join(file_list[0],'6-name2semantic.tsv')) file_list.append(os.path.join(file_list[0],'6-name2semantic.tsv'))
for file in file_list: for file in file_list:
if os.path.exists(file):pass if os.path.exists(file):pass
else:_+=f'\n {file}' else:_.append(file)
if _:gr.Warning(i18n('以下文件不存在:')) if _:
for i in _:
if i != '':
gr.Warning(i)
gr.Warning(i18n('以下文件不存在:'))
from text.g2pw import G2PWPinyin 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) 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)