From c541f7822fc978fb989e516d51f58af4788a2a39 Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Sat, 15 Jun 2024 14:44:35 +0800 Subject: [PATCH] add before_run --- swankit/callback/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swankit/callback/__init__.py b/swankit/callback/__init__.py index 83d9f04..b6f0f8a 100644 --- a/swankit/callback/__init__.py +++ b/swankit/callback/__init__.py @@ -11,6 +11,7 @@ from typing import Callable from abc import ABC, abstractmethod from .models import * +from swankit.core import SwanLabSharedSettings class SwanKitCallback(ABC): @@ -29,6 +30,13 @@ def on_init(self, proj_name: str, workspace: str, logdir: str = None, **kwargs): """ pass + def before_run(self, settings: SwanLabSharedSettings): + """ + 在运行实验之前调用 + :param settings: SwanLabSharedSettings, 运行时的共享配置 + """ + pass + def before_init_experiment( self, run_id: str,