descope.trainer

class DeSCOPETrainer(args: TrainingArguments, model: PreTrainedModel | Module, train_dataset: Dataset | Dataset, eval_dataset: Dataset | Dataset | None = None, data_collator: Callable[[list[Any]], dict[str, Any]] | None = None)[source]

Bases: Trainer

NOTE:
  1. Early stopping does not currently support resuming training. If training is forcibly resumed, the early stopping callback will be reinitialized.

  2. If you enable early stopping, ensure that eval_every_n_epochs and checkpointing_steps are aligned, as the Trainer does not automatically save the best model.

  3. The final model is always saved at the end of training, even if early stopping is triggered.

evaluate()[source]
train()[source]