From 75274a9015992baa9139ff3a975b7c36befe58aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Thu, 2 Mar 2023 02:05:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.py b/server.py index 6118fac..c076ec1 100644 --- a/server.py +++ b/server.py @@ -268,6 +268,12 @@ def main_dev(opt): opt.ckpt = f'/data/ckpt/{model_name}.ckpt' opt.device = 'cuda' + # 检查模型文件是否存在 + if not os.path.exists(opt.ckpt): + print(f"模型文件不存在: {opt.ckpt}, 结束此任务") + update_task_status(task, "error", 0) + continue + # 检查yaml文件是否存在 if not os.path.exists(opt.config): print(f"yaml文件不存在: {opt.config}, 将使用默认配置")