diff --git a/infer-web.py b/infer-web.py index e08315a..edecf2c 100644 --- a/infer-web.py +++ b/infer-web.py @@ -659,12 +659,12 @@ def change_sr2(sr2, if_f0_3, version19): if_pretrained_discriminator_exist = os.access( "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( "pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2), "not exist, will not use pretrained model", ) - if if_pretrained_discriminator_exist is not False: + if not if_pretrained_discriminator_exist: print( "pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2), "not exist, will not use pretrained model", @@ -675,8 +675,7 @@ def change_sr2(sr2, if_f0_3, version19): else "", "pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2) if if_pretrained_discriminator_exist - else "", - {"visible": True, "__type__": "update"}, + else "" ) @@ -685,9 +684,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"} + {"choices": ["40k", "48k"], "__type__": "update","value":sr2} 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 "" 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) if if_pretrained_discriminator_exist else "", - to_return_sr2, + to_return_sr2 ) @@ -1758,7 +1757,7 @@ with gr.Blocks() as app: sr2.change( change_sr2, [sr2, if_f0_3, version19], - [pretrained_G14, pretrained_D15, version19], + [pretrained_G14, pretrained_D15], ) version19.change( change_version19,