From 8ed0dec18165be1da26bff569e61866b54690645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:29:48 +0900 Subject: [PATCH] feat(web): support uploading file in model info --- infer-web.py | 4 ++-- infer/modules/vc/info.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/infer-web.py b/infer-web.py index 0290bb3..207debc 100644 --- a/infer-web.py +++ b/infer-web.py @@ -1536,8 +1536,8 @@ with gr.Blocks(title="RVC WebUI") as app: ) with gr.Row(): with gr.Column(): - ckpt_path1 = gr.Textbox( - label=i18n("模型路径"), value="", interactive=True + ckpt_path1 = gr.File( + label=i18n("模型路径") ) but8 = gr.Button(i18n("查看"), variant="primary") with gr.Column(): diff --git a/infer/modules/vc/info.py b/infer/modules/vc/info.py index ea99c73..ed5daf5 100644 --- a/infer/modules/vc/info.py +++ b/infer/modules/vc/info.py @@ -63,6 +63,7 @@ def show_model_info(cpt, show_long_id=False): def show_info(path): try: + 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