INNER CODE UNIT · TypeScript
Callback
theaniketgiri/create-llm · src/python-callback-templates.ts:17
class Callback:
"""
Base class for training callbacks
Callbacks allow you to hook into the training loop at various points:
- on_train_begin: Called at the start of training
- on_train_end: Called at the end of training
- on_epoch_begin: Called at the start of each epoch
- on_epoch_end: Called at the end of each epoch
- on_batch_begin: Called before processing each batch
- on_batch_end: Called after processing each batch
- on_step_end: Called after each training step
"""
def on_train_begin(self, trainer: Any):
"""Called when training begins"""
pass