mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-06 03:57:44 +08:00
修复根据模型版本识别支持的语种滞后的问题
修复根据模型版本识别支持的语种滞后的问题
This commit is contained in:
parent
87a3b908ee
commit
16941a7c14
@ -223,6 +223,7 @@ def change_sovits_weights(sovits_path,prompt_language=None,text_language=None):
|
|||||||
version = "v2"
|
version = "v2"
|
||||||
model_version="v3"
|
model_version="v3"
|
||||||
|
|
||||||
|
dict_language = dict_language_v1 if version =='v1' else dict_language_v2
|
||||||
if prompt_language is not None and text_language is not None:
|
if prompt_language is not None and text_language is not None:
|
||||||
if prompt_language in list(dict_language.keys()):
|
if prompt_language in list(dict_language.keys()):
|
||||||
prompt_text_update, prompt_language_update = {'__type__':'update'}, {'__type__':'update', 'value':prompt_language}
|
prompt_text_update, prompt_language_update = {'__type__':'update'}, {'__type__':'update', 'value':prompt_language}
|
||||||
@ -277,7 +278,6 @@ def change_sovits_weights(sovits_path,prompt_language=None,text_language=None):
|
|||||||
vq_model = vq_model.to(device)
|
vq_model = vq_model.to(device)
|
||||||
vq_model.eval()
|
vq_model.eval()
|
||||||
print("loading sovits_%s"%model_version,vq_model.load_state_dict(dict_s2["weight"], strict=False))
|
print("loading sovits_%s"%model_version,vq_model.load_state_dict(dict_s2["weight"], strict=False))
|
||||||
dict_language = dict_language_v1 if version =='v1' else dict_language_v2
|
|
||||||
with open("./weight.json")as f:
|
with open("./weight.json")as f:
|
||||||
data=f.read()
|
data=f.read()
|
||||||
data=json.loads(data)
|
data=json.loads(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user