Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

Fix format #526

Open Tps-F opened this issue 2 years ago • 5 comments
trafficstars

Fix format #526 I just removed the unnecessary (), so it should not affect the operation.

Tps-F avatar Jun 15 '23 05:06 Tps-F

These codes you are editting the parentheses are written by me, I think it will cause problems. In my environment, if the paranthesis is removed, then "-pg" and "-pd" will be passed, with no path passed, will cause error. The ideas of these paranthesis are that when there is no pretrained model, "-pg" and "-pd" should also not be passed.

JunityZhan avatar Jun 15 '23 05:06 JunityZhan

Thanks for your contribution and for the replies! I will test it again just in case.

Tps-F avatar Jun 15 '23 07:06 Tps-F

I make a minium function test

path_str = "path_str"
f0_str = "f0_str"
sr2 = "sr2"

def test():
    return (
        "pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2) if if_pretrained_generator_exist else "",
        "pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2) if if_pretrained_discriminator_exist else "",
        {"visible": True, "__type__": "update"}
    )

a, b, c = test()

print(a, b)

and it return pretrainedpath_str/f0_strGsr2.pth pretrainedpath_str/f0_strDsr2.pth

Maybe, but I think it will work.

Tps-F avatar Jun 15 '23 07:06 Tps-F

Thank you for your patience, I actually means for this line,

"-pg %s" % pretrained_G14 if pretrained_G14 != "" else "", HOWEVER, I tested it and its totally OK. Maybe it is because I encountered another problem and I thought it is because of the paranthesis and just make another change. Meanwhile, "the another change" fix the error, so I thought I need this paranthesis. So the edit is totally working and may incur no error! Thanks for your patience again.

JunityZhan avatar Jun 15 '23 08:06 JunityZhan

Thank you very much! It's not annoying at all, in fact, I'm rather delighted!

Tps-F avatar Jun 15 '23 09:06 Tps-F

@Tps-F According to JunityZhzna, this pr seems unnecessary?

RVC-Boss avatar Jun 18 '23 04:06 RVC-Boss

@RVC-Boss Yes, There is no change in behavior due to this PR. However, this is the more appropriate way to write Python.

Tps-F avatar Jun 18 '23 05:06 Tps-F

@RVC-Boss Yes, There is no change in behavior due to this PR. However, this is the more appropriate way to write Python.

I will merge it, but "This branch has conflicts that must be resolved", can you help resolving it?

RVC-Boss avatar Jun 18 '23 06:06 RVC-Boss

@RVC-Boss I resolved it Thank you for responding!

Tps-F avatar Jun 18 '23 07:06 Tps-F