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}, 将使用默认配置")