mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-02-07 06:02:49 +08:00
Add files via upload
This commit is contained in:
parent
bc5df2ff8e
commit
a42330f0ae
15
infer-web.py
15
infer-web.py
@ -659,12 +659,12 @@ def change_sr2(sr2, if_f0_3, version19):
|
|||||||
if_pretrained_discriminator_exist = os.access(
|
if_pretrained_discriminator_exist = os.access(
|
||||||
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2), os.F_OK
|
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2), os.F_OK
|
||||||
)
|
)
|
||||||
if if_pretrained_generator_exist is not False:
|
if not if_pretrained_generator_exist:
|
||||||
print(
|
print(
|
||||||
"pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2),
|
"pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2),
|
||||||
"not exist, will not use pretrained model",
|
"not exist, will not use pretrained model",
|
||||||
)
|
)
|
||||||
if if_pretrained_discriminator_exist is not False:
|
if not if_pretrained_discriminator_exist:
|
||||||
print(
|
print(
|
||||||
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2),
|
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2),
|
||||||
"not exist, will not use pretrained model",
|
"not exist, will not use pretrained model",
|
||||||
@ -675,8 +675,7 @@ def change_sr2(sr2, if_f0_3, version19):
|
|||||||
else "",
|
else "",
|
||||||
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
|
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
|
||||||
if if_pretrained_discriminator_exist
|
if if_pretrained_discriminator_exist
|
||||||
else "",
|
else ""
|
||||||
{"visible": True, "__type__": "update"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -685,9 +684,9 @@ def change_version19(sr2, if_f0_3, version19):
|
|||||||
if sr2 == "32k" and version19 == "v1":
|
if sr2 == "32k" and version19 == "v1":
|
||||||
sr2 = "40k"
|
sr2 = "40k"
|
||||||
to_return_sr2 = (
|
to_return_sr2 = (
|
||||||
{"choices": ["40k", "48k"], "__type__": "update"}
|
{"choices": ["40k", "48k"], "__type__": "update","value":sr2}
|
||||||
if version19 == "v1"
|
if version19 == "v1"
|
||||||
else {"choices": ["32k", "40k", "48k"], "__type__": "update"}
|
else {"choices": ["40k", "48k","32k"], "__type__": "update","value":sr2}
|
||||||
)
|
)
|
||||||
f0_str = "f0" if if_f0_3 else ""
|
f0_str = "f0" if if_f0_3 else ""
|
||||||
if_pretrained_generator_exist = os.access(
|
if_pretrained_generator_exist = os.access(
|
||||||
@ -713,7 +712,7 @@ def change_version19(sr2, if_f0_3, version19):
|
|||||||
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
|
"pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
|
||||||
if if_pretrained_discriminator_exist
|
if if_pretrained_discriminator_exist
|
||||||
else "",
|
else "",
|
||||||
to_return_sr2,
|
to_return_sr2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1758,7 +1757,7 @@ with gr.Blocks() as app:
|
|||||||
sr2.change(
|
sr2.change(
|
||||||
change_sr2,
|
change_sr2,
|
||||||
[sr2, if_f0_3, version19],
|
[sr2, if_f0_3, version19],
|
||||||
[pretrained_G14, pretrained_D15, version19],
|
[pretrained_G14, pretrained_D15],
|
||||||
)
|
)
|
||||||
version19.change(
|
version19.change(
|
||||||
change_version19,
|
change_version19,
|
||||||
|
Loading…
Reference in New Issue
Block a user