Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add before_run #4

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions swankit/callback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import Callable
from abc import ABC, abstractmethod
from .models import *
from swankit.core import SwanLabSharedSettings


class SwanKitCallback(ABC):
Expand All @@ -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,
Expand Down