Callback

Callback

class openspeech.callbacks.CheckpointEveryNSteps(save_step_frequency, use_modelcheckpoint_filename=False)[source]

Save a checkpoint every N steps, instead of Lightning’s default that checkpoints based on validation loss.

Parameters
  • save_step_frequency – how often to save in steps

  • use_modelcheckpoint_filename – just use the ModelCheckpoint callback’s default filename, don’t use ours.

on_batch_end(trainer: pytorch_lightning.trainer.trainer.Trainer, _)[source]

Check if we should save a checkpoint after every train batch