1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-08 03:55:47 +08:00

chore(format): run black on dev (#2090)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-06-02 22:49:59 +09:00
committed by GitHub
parent b9ad0258ae
commit 8767e11cf1
6 changed files with 143 additions and 71 deletions

View File

@@ -7,6 +7,7 @@ from .hash import model_hash_ckpt, hash_id
i18n = I18nAuto()
def show_model_info(cpt, show_long_id=False):
try:
h = model_hash_ckpt(cpt)
@@ -14,10 +15,27 @@ def show_model_info(cpt, show_long_id=False):
idread = cpt.get("id", "None")
hread = cpt.get("hash", "None")
if id != idread:
id += "("+i18n("实际计算")+"), "+idread+"("+i18n("从模型中读取")+")"
if not show_long_id: h = i18n("不显示")
id += (
"("
+ i18n("实际计算")
+ "), "
+ idread
+ "("
+ i18n("从模型中读取")
+ ")"
)
if not show_long_id:
h = i18n("不显示")
elif h != hread:
h += "("+i18n("实际计算")+"), "+hread+"("+i18n("从模型中读取")+")"
h += (
"("
+ i18n("实际计算")
+ "), "
+ hread
+ "("
+ i18n("从模型中读取")
+ ")"
)
txt = f"""{i18n("模型名")}: %s
{i18n("封装时间")}: %s
{i18n("信息")}: %s
@@ -32,13 +50,15 @@ def show_model_info(cpt, show_long_id=False):
cpt.get("sr", "None"),
i18n("") if cpt.get("f0", 0) == 1 else i18n(""),
cpt.get("version", "None"),
id, h
id,
h,
)
except:
txt = traceback.format_exc()
return txt
def show_info(path):
try:
a = torch.load(path, map_location="cpu")