det.transformers API Reference#

determined.transformers.DetCallback#

class determined.transformers.DetCallback(*args: Any, **kwargs: Any)#

DetCallback integrates a training loop built around transformers.Trainer with the Determined cluster. It reports metrics, uploads checkpoints, and handles preemption signals. It also automatically restores training from the latest checkpoint after pauses or crashes.

Simply include DetCallback as in the list of callbacks that you pass to your Trainer.

Parameters:
  • core_context – the result of a det.core.init() call.

  • argsTrainingArgs from a transformers.HfArgumentParser, the same args to be passed to the Trainer.

  • filter_metrics – a list of metric names to report to Determined. Default: None (all metrics are reported).

  • user_data – an optional dict of metadata to be stored in every checkpoint. Default: None.