From b28f98fed3c57b21092c7cf85cab4d72c8c5bf4d Mon Sep 17 00:00:00 2001 From: mrhan1993 <50648276+mrhan1993@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:42:16 +0800 Subject: [PATCH] Update gui.py (#475) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加选择模型时的默认路径以及文件过滤。 --- gui.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui.py b/gui.py index a181238..43254c3 100644 --- a/gui.py +++ b/gui.py @@ -259,25 +259,25 @@ class GUI: layout=[ [ sg.Input(default_text="hubert_base.pt", key="hubert_path"), - sg.FileBrowse(i18n("Hubert模型")), + sg.FileBrowse(i18n("Hubert模型"), initial_folder=os.path.join(os.getcwd()),file_types=((". pt"),)), ], [ sg.Input(default_text="TEMP\\atri.pth", key="pth_path"), - sg.FileBrowse(i18n("选择.pth文件")), + sg.FileBrowse(i18n("选择.pth文件"),initial_folder=os.path.join(os.getcwd(), "weights"), file_types=((". pth"),)), ], [ sg.Input( default_text="TEMP\\added_IVF512_Flat_atri_baseline_src_feat.index", key="index_path", ), - sg.FileBrowse(i18n("选择.index文件")), + sg.FileBrowse(i18n("选择.index文件"), initial_folder=os.path.join(os.getcwd(), "logs"),file_types=((". index"),)), ], [ sg.Input( default_text="你不需要填写这个You don't need write this.", key="npy_path", ), - sg.FileBrowse(i18n("选择.npy文件")), + sg.FileBrowse(i18n("选择.npy文件"), initial_folder=os.path.join(os.getcwd(), "logs"),file_types=((". npy"),)), ], ], )