Skip to content

Commit a42330f

Browse files
authored
Add files via upload
1 parent bc5df2f commit a42330f

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

infer-web.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,12 @@ def change_sr2(sr2, if_f0_3, version19):
659659
if_pretrained_discriminator_exist = os.access(
660660
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2), os.F_OK
661661
)
662-
if if_pretrained_generator_exist is not False:
662+
if not if_pretrained_generator_exist:
663663
print(
664664
"pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2),
665665
"not exist, will not use pretrained model",
666666
)
667-
if if_pretrained_discriminator_exist is not False:
667+
if not if_pretrained_discriminator_exist:
668668
print(
669669
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2),
670670
"not exist, will not use pretrained model",
@@ -675,8 +675,7 @@ def change_sr2(sr2, if_f0_3, version19):
675675
else "",
676676
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
677677
if if_pretrained_discriminator_exist
678-
else "",
679-
{"visible": True, "__type__": "update"},
678+
else ""
680679
)
681680

682681

@@ -685,9 +684,9 @@ def change_version19(sr2, if_f0_3, version19):
685684
if sr2 == "32k" and version19 == "v1":
686685
sr2 = "40k"
687686
to_return_sr2 = (
688-
{"choices": ["40k", "48k"], "__type__": "update"}
687+
{"choices": ["40k", "48k"], "__type__": "update","value":sr2}
689688
if version19 == "v1"
690-
else {"choices": ["32k", "40k", "48k"], "__type__": "update"}
689+
else {"choices": ["40k", "48k","32k"], "__type__": "update","value":sr2}
691690
)
692691
f0_str = "f0" if if_f0_3 else ""
693692
if_pretrained_generator_exist = os.access(
@@ -713,7 +712,7 @@ def change_version19(sr2, if_f0_3, version19):
713712
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
714713
if if_pretrained_discriminator_exist
715714
else "",
716-
to_return_sr2,
715+
to_return_sr2
717716
)
718717

719718

@@ -1758,7 +1757,7 @@ def export_onnx(ModelPath, ExportedPath):
17581757
sr2.change(
17591758
change_sr2,
17601759
[sr2, if_f0_3, version19],
1761-
[pretrained_G14, pretrained_D15, version19],
1760+
[pretrained_G14, pretrained_D15],
17621761
)
17631762
version19.change(
17641763
change_version19,

0 commit comments

Comments
 (0)