det.transformers
API Reference#
determined.transformers.DetCallback
#
- class determined.transformers.DetCallback(*args: Any, **kwargs: Any)#
DetCallback
integrates a training loop built aroundtransformers.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 ofcallbacks
that you pass to yourTrainer
.- Parameters:
core_context – the result of a
det.core.init()
call.args –
TrainingArgs
from atransformers.HfArgumentParser
, the sameargs
to be passed to theTrainer
.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
.