From ea6c84665191864baf6ec8324bcabbe28e8eb9fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:46:39 +0900 Subject: [PATCH] chore(format): run black on dev (#2104) Co-authored-by: github-actions[bot] --- infer-web.py | 4 +--- infer/modules/vc/hash.py | 1 + infer/modules/vc/info.py | 21 ++++++++++++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/infer-web.py b/infer-web.py index 207debc..71210ac 100644 --- a/infer-web.py +++ b/infer-web.py @@ -1536,9 +1536,7 @@ with gr.Blocks(title="RVC WebUI") as app: ) with gr.Row(): with gr.Column(): - ckpt_path1 = gr.File( - label=i18n("模型路径") - ) + ckpt_path1 = gr.File(label=i18n("模型路径")) but8 = gr.Button(i18n("查看"), variant="primary") with gr.Column(): info6 = gr.Textbox(label=i18n("输出信息"), value="") diff --git a/infer/modules/vc/hash.py b/infer/modules/vc/hash.py index 5ba0507..2234aab 100644 --- a/infer/modules/vc/hash.py +++ b/infer/modules/vc/hash.py @@ -47,6 +47,7 @@ def original_audio_time_minus(): def original_audio_freq_minus(): return original_audio_storage()["f"] + @singleton_variable def original_rmvpe_f0(): x = original_audio_storage() diff --git a/infer/modules/vc/info.py b/infer/modules/vc/info.py index 7ef1c59..0d9db1d 100644 --- a/infer/modules/vc/info.py +++ b/infer/modules/vc/info.py @@ -25,13 +25,27 @@ def show_model_info(cpt, show_long_id=False): + ")" ) sim = hash_similarity(h, hread) - if not isinstance(sim, str): sim = "%.2f%%" % (sim*100) + if not isinstance(sim, str): + sim = "%.2f%%" % (sim * 100) if not show_long_id: h = i18n("不显示") if h != hread: h = i18n("相似度") + " " + sim + " -> " + h elif h != hread: - h = i18n("相似度") + " " + sim + " -> " + h + "(" + i18n("实际计算") + "), " + hread + "(" + i18n("从模型中读取") + ")" + h = ( + i18n("相似度") + + " " + + sim + + " -> " + + h + + "(" + + i18n("实际计算") + + "), " + + hread + + "(" + + i18n("从模型中读取") + + ")" + ) txt = f"""{i18n("模型名")}: %s {i18n("封装时间")}: %s {i18n("模型作者")}: %s @@ -59,7 +73,8 @@ def show_model_info(cpt, show_long_id=False): def show_info(path): try: - if hasattr(path, "name"): path = path.name + if hasattr(path, "name"): + path = path.name a = torch.load(path, map_location="cpu") txt = show_model_info(a, show_long_id=True) del a