utils.callbacks.swanlab

utils.callbacks.swanlab

Callbacks for SwanLab integration

Classes

Name Description
CustomSwanLabCallback Lightweight SwanLab callback that directly logs metrics without using
SaveAxolotlConfigtoSwanLabCallback Callback to save axolotl config to SwanLab

CustomSwanLabCallback

utils.callbacks.swanlab.CustomSwanLabCallback()

Lightweight SwanLab callback that directly logs metrics without using SwanLab’s transformers integration (which requires omegaconf).

This avoids the antlr4 version conflict between omegaconf and axolotl.

Methods

Name Description
on_log Called when logging metrics
on_train_begin Called at the beginning of training
on_train_end Called at the end of training
setup Lazy initialization of SwanLab
on_log
utils.callbacks.swanlab.CustomSwanLabCallback.on_log(
    args,
    state,
    control,
    logs=None,
    **kwargs,
)

Called when logging metrics

on_train_begin
utils.callbacks.swanlab.CustomSwanLabCallback.on_train_begin(
    args,
    state,
    control,
    **kwargs,
)

Called at the beginning of training

on_train_end
utils.callbacks.swanlab.CustomSwanLabCallback.on_train_end(
    args,
    state,
    control,
    **kwargs,
)

Called at the end of training

setup
utils.callbacks.swanlab.CustomSwanLabCallback.setup()

Lazy initialization of SwanLab

SaveAxolotlConfigtoSwanLabCallback

utils.callbacks.swanlab.SaveAxolotlConfigtoSwanLabCallback(axolotl_config_path)

Callback to save axolotl config to SwanLab