Skip to content

Commit 6ca9c85

Browse files
authored
v2-48k-32k-support
v2-48k-32k-support
1 parent 44426b1 commit 6ca9c85

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

infer-web.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ def change_sr2(sr2, if_f0_3, version19):
664664

665665
def change_version19(sr2, if_f0_3, version19):
666666
path_str = "" if version19 == "v1" else "_v2"
667+
if(sr2=="32k"and version19=="v1"):sr2="40k"
668+
to_return_sr2= {"choices": ["40k","48k"], "__type__": "update"} if version19=="v1"else {"choices": ["32k","40k","48k"], "__type__": "update"}
667669
f0_str = "f0" if if_f0_3 else ""
668670
if_pretrained_generator_exist = os.access(
669671
"pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2), os.F_OK
@@ -688,6 +690,7 @@ def change_version19(sr2, if_f0_3, version19):
688690
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
689691
if if_pretrained_discriminator_exist
690692
else "",
693+
to_return_sr2
691694
)
692695

693696

@@ -1589,7 +1592,7 @@ def export_onnx(ModelPath, ExportedPath):
15891592
interactive=True,
15901593
)
15911594
version19 = gr.Radio(
1592-
label=i18n("版本(目前仅40k支持了v2)"),
1595+
label=i18n("版本"),
15931596
choices=["v1", "v2"],
15941597
value="v1",
15951598
interactive=True,
@@ -1718,7 +1721,7 @@ def export_onnx(ModelPath, ExportedPath):
17181721
version19.change(
17191722
change_version19,
17201723
[sr2, if_f0_3, version19],
1721-
[pretrained_G14, pretrained_D15],
1724+
[pretrained_G14, pretrained_D15,sr2],
17221725
)
17231726
if_f0_3.change(
17241727
change_f0,
@@ -1795,7 +1798,7 @@ def export_onnx(ModelPath, ExportedPath):
17951798
with gr.Row():
17961799
sr_ = gr.Radio(
17971800
label=i18n("目标采样率"),
1798-
choices=["32k", "40k", "48k"],
1801+
choices=["40k", "48k"],
17991802
value="40k",
18001803
interactive=True,
18011804
)

0 commit comments

Comments
 (0)