micm_nlp.training

Training: the run driver, Trainer subclasses, callbacks, collators and batching.

  • runnerTRAINER: builds the HuggingFace Trainer from the config — arguments, collator, callbacks, evaluation — and runs it.

  • trainersCustomTrainerMixin and RandomTaskExclusionBatchSampler; custom_trainer_class_factory mixes the former into whichever Trainer class trainer.cls names.

  • callbacksCustomEarlyStoppingCallback, ParamNormLogger, NormalizePromptEncoderEmbeddings, DownstreamFineTuningCallback, EmptyCudaCacheCallback.

  • batchingTokenBudgetBatchSampler and calibrate_token_budget, for batching by token count rather than by row count.

  • data_collators — collators for PLM, seq2seq-with-shifted-labels, and task-id-decorated batches.

  • logits_processorsConstrainedPrefixLogitsProcessor, applied at generation time.

Submodules