Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 38f3e06

Browse files
authored
add before_run (#4)
1 parent 67d5fa7 commit 38f3e06

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

swankit/callback/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import Callable
1212
from abc import ABC, abstractmethod
1313
from .models import *
14+
from swankit.core import SwanLabSharedSettings
1415

1516

1617
class SwanKitCallback(ABC):
@@ -29,6 +30,13 @@ def on_init(self, proj_name: str, workspace: str, logdir: str = None, **kwargs):
2930
"""
3031
pass
3132

33+
def before_run(self, settings: SwanLabSharedSettings):
34+
"""
35+
在运行实验之前调用
36+
:param settings: SwanLabSharedSettings, 运行时的共享配置
37+
"""
38+
pass
39+
3240
def before_init_experiment(
3341
self,
3442
run_id: str,

0 commit comments

Comments
 (0)