chore(format): run black on dev

This commit is contained in:
github-actions[bot] 2024-06-04 13:30:02 +00:00
parent b3215d126c
commit 40d4e4d406
3 changed files with 20 additions and 6 deletions

View File

@ -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="")

View File

@ -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()

View File

@ -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