Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve inconsistent sample rates and improve Train tab layout #2234

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions infer-web.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ def change_version19(sr2, if_f0_3, version19):
if sr2 == "32k" and version19 == "v1":
sr2 = "40k"
to_return_sr2 = (
{"choices": ["40k", "48k"], "__type__": "update", "value": sr2}
{"choices": ["32k", "40k", "48k"], "__type__": "update", "value": sr2}
if version19 == "v1"
else {"choices": ["40k", "48k", "32k"], "__type__": "update", "value": sr2}
else {"choices": ["32k", "40k", "48k"], "__type__": "update", "value": sr2}
)
f0_str = "f0" if if_f0_3 else ""
return (
Expand Down Expand Up @@ -552,7 +552,7 @@ def click_train(
logger.info("No pretrained Generator")
if pretrained_D15 == "":
logger.info("No pretrained Discriminator")
if version19 == "v1" or sr2 == "40k":
if version19 == "v1" or sr2 == "40k": # v2 40k falls back to v1
config_path = "v1/%s.json" % sr2
else:
config_path = "v2/%s.json" % sr2
Expand Down Expand Up @@ -1176,10 +1176,17 @@ def change_f0_method(f0method8):
)
with gr.Row():
exp_dir1 = gr.Textbox(label=i18n("输入实验名"), value="mi-test")
version19 = gr.Radio(
label=i18n("版本"),
choices=["v1", "v2"],
value="v2",
interactive=True,
visible=True,
)
sr2 = gr.Radio(
label=i18n("目标采样率"),
choices=["40k", "48k"],
value="40k",
choices=["32k", "40k", "48k"],
value="48k",
interactive=True,
)
if_f0_3 = gr.Radio(
Expand All @@ -1188,13 +1195,6 @@ def change_f0_method(f0method8):
value=True,
interactive=True,
)
version19 = gr.Radio(
label=i18n("版本"),
choices=["v1", "v2"],
value="v2",
interactive=True,
visible=True,
)
np7 = gr.Slider(
minimum=0,
maximum=config.n_cpu,
Expand Down Expand Up @@ -1339,12 +1339,12 @@ def change_f0_method(f0method8):
with gr.Row():
pretrained_G14 = gr.Textbox(
label=i18n("加载预训练底模G路径"),
value="assets/pretrained_v2/f0G40k.pth",
value="assets/pretrained_v2/f0G48k.pth",
interactive=True,
)
pretrained_D15 = gr.Textbox(
label=i18n("加载预训练底模D路径"),
value="assets/pretrained_v2/f0D40k.pth",
value="assets/pretrained_v2/f0D48k.pth",
interactive=True,
)
sr2.change(
Expand Down