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
Event called at the beginning of an epoch.
Event called at the end of an epoch.
Event called after an evaluation phase.
Event called at the end of the initialization of the [Trainer].
Event called after logging the last logs.
Event called after a successful prediction.
Event called after a prediction step.
Event called after a checkpoint save.
Event called at the beginning of a training step.
Borrow Checkpoint Logic from DefaultFlowCallback to decide when to checkpoint.
Event called at the end of an substep during gradient accumulation.
Event called at the beginning of training.
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.