mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-26 15:30:43 +08:00
fix configs error (#2439)
* fix configs error * fix configs error --------- Co-authored-by: wangzeyuan <wangzeyuan@agora.io> Co-authored-by: wangzeyuan <wangzeyuan@shengwang.cn>
This commit is contained in:
parent
74e79ae6d6
commit
d6b78c927a
@ -214,7 +214,7 @@ v3v4set = {"v3", "v4"}
|
|||||||
|
|
||||||
|
|
||||||
def change_sovits_weights(sovits_path, prompt_language=None, text_language=None):
|
def change_sovits_weights(sovits_path, prompt_language=None, text_language=None):
|
||||||
if "!" in sovits_path:
|
if "!" in sovits_path or "!" in sovits_path:
|
||||||
sovits_path = name2sovits_path[sovits_path]
|
sovits_path = name2sovits_path[sovits_path]
|
||||||
global vq_model, hps, version, model_version, dict_language, if_lora_v3
|
global vq_model, hps, version, model_version, dict_language, if_lora_v3
|
||||||
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
||||||
@ -361,7 +361,7 @@ except:
|
|||||||
|
|
||||||
|
|
||||||
def change_gpt_weights(gpt_path):
|
def change_gpt_weights(gpt_path):
|
||||||
if "!" in gpt_path:
|
if "!" in gpt_path or "!" in gpt_path:
|
||||||
gpt_path = name2gpt_path[gpt_path]
|
gpt_path = name2gpt_path[gpt_path]
|
||||||
global hz, max_sec, t2s_model, config
|
global hz, max_sec, t2s_model, config
|
||||||
hz = 50
|
hz = 50
|
||||||
|
@ -114,11 +114,11 @@ tts_config.device = device
|
|||||||
tts_config.is_half = is_half
|
tts_config.is_half = is_half
|
||||||
tts_config.version = version
|
tts_config.version = version
|
||||||
if gpt_path is not None:
|
if gpt_path is not None:
|
||||||
if "!" in gpt_path:
|
if "!" in gpt_path or "!" in gpt_path:
|
||||||
gpt_path = name2gpt_path[gpt_path]
|
gpt_path = name2gpt_path[gpt_path]
|
||||||
tts_config.t2s_weights_path = gpt_path
|
tts_config.t2s_weights_path = gpt_path
|
||||||
if sovits_path is not None:
|
if sovits_path is not None:
|
||||||
if "!" in sovits_path:
|
if "!" in sovits_path or "!" in sovits_path:
|
||||||
sovits_path = name2sovits_path[sovits_path]
|
sovits_path = name2sovits_path[sovits_path]
|
||||||
tts_config.vits_weights_path = sovits_path
|
tts_config.vits_weights_path = sovits_path
|
||||||
if cnhubert_base_path is not None:
|
if cnhubert_base_path is not None:
|
||||||
@ -217,7 +217,7 @@ v3v4set = {"v3", "v4"}
|
|||||||
|
|
||||||
|
|
||||||
def change_sovits_weights(sovits_path, prompt_language=None, text_language=None):
|
def change_sovits_weights(sovits_path, prompt_language=None, text_language=None):
|
||||||
if "!" in sovits_path:
|
if "!" in sovits_path or "!" in sovits_path:
|
||||||
sovits_path = name2sovits_path[sovits_path]
|
sovits_path = name2sovits_path[sovits_path]
|
||||||
global version, model_version, dict_language, if_lora_v3
|
global version, model_version, dict_language, if_lora_v3
|
||||||
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
|
||||||
@ -283,6 +283,12 @@ def change_sovits_weights(sovits_path, prompt_language=None, text_language=None)
|
|||||||
f.write(json.dumps(data))
|
f.write(json.dumps(data))
|
||||||
|
|
||||||
|
|
||||||
|
def change_gpt_weights(gpt_path):
|
||||||
|
if "!" in gpt_path or "!" in gpt_path:
|
||||||
|
gpt_path = name2gpt_path[gpt_path]
|
||||||
|
tts_pipeline.init_t2s_weights(gpt_path)
|
||||||
|
|
||||||
|
|
||||||
with gr.Blocks(title="GPT-SoVITS WebUI", analytics_enabled=False, js=js, css=css) as app:
|
with gr.Blocks(title="GPT-SoVITS WebUI", analytics_enabled=False, js=js, css=css) as app:
|
||||||
gr.HTML(
|
gr.HTML(
|
||||||
top_html.format(
|
top_html.format(
|
||||||
@ -457,7 +463,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI", analytics_enabled=False, js=js, css=css
|
|||||||
inference_button,
|
inference_button,
|
||||||
],
|
],
|
||||||
) #
|
) #
|
||||||
GPT_dropdown.change(tts_pipeline.init_t2s_weights, [GPT_dropdown], [])
|
GPT_dropdown.change(change_gpt_weights, [GPT_dropdown], [])
|
||||||
|
|
||||||
with gr.Group():
|
with gr.Group():
|
||||||
gr.Markdown(
|
gr.Markdown(
|
||||||
|
@ -127,7 +127,7 @@ def get_sovits_version_from_path_fast(sovits_path):
|
|||||||
def load_sovits_new(sovits_path):
|
def load_sovits_new(sovits_path):
|
||||||
f = open(sovits_path, "rb")
|
f = open(sovits_path, "rb")
|
||||||
meta = f.read(2)
|
meta = f.read(2)
|
||||||
if meta != "PK":
|
if meta != b"PK":
|
||||||
data = b"PK" + f.read()
|
data = b"PK" + f.read()
|
||||||
bio = BytesIO()
|
bio = BytesIO()
|
||||||
bio.write(data)
|
bio.write(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user