src.core.callbacks.CustomCheckpointCallback

class CustomCheckpointCallback(frequencies: List[List[int]])[source]

Bases: TrainerCallback

Custom Checkpoint Callback used by Mistral for Saving Checkpoints at different frequencies.

Methods

on_epoch_begin

Event called at the beginning of an epoch.

on_epoch_end

Event called at the end of an epoch.

on_evaluate

Event called after an evaluation phase.

on_init_end

Event called at the end of the initialization of the [Trainer].

on_log

Event called after logging the last logs.

on_predict

Event called after a successful prediction.

on_prediction_step

Event called after a prediction step.

on_save

Event called after a checkpoint save.

on_step_begin

Event called at the beginning of a training step.

on_step_end

Borrow Checkpoint Logic from DefaultFlowCallback to decide when to checkpoint.

on_substep_end

Event called at the end of an substep during gradient accumulation.

on_train_begin

Event called at the beginning of training.

on_train_end

Event called at the end of training.

on_epoch_begin(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the beginning of an epoch.

on_epoch_end(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the end of an epoch.

on_evaluate(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called after an evaluation phase.

on_init_end(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the end of the initialization of the [Trainer].

on_log(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called after logging the last logs.

on_predict(args: TrainingArguments, state: TrainerState, control: TrainerControl, metrics, **kwargs)

Event called after a successful prediction.

on_prediction_step(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called after a prediction step.

on_save(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called after a checkpoint save.

on_step_begin(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the beginning of a training step. If using gradient accumulation, one training step might take several inputs.

on_step_end(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)[source]

Borrow Checkpoint Logic from DefaultFlowCallback to decide when to checkpoint.

on_substep_end(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the end of an substep during gradient accumulation.

on_train_begin(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the beginning of training.

on_train_end(args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)

Event called at the end of training.