core.trainer_builder

core.trainer_builder

Builder for the training args and trainer

Classes

Name Description
HFCausalTrainerBuilder Build the HuggingFace training args/trainer for causal models and reward modeling
HFPPOTrainerBuilder HF Factory class for PPO Trainer
HFRLTrainerBuilder Trainer factory class for TRL-based RLHF trainers (e.g. DPO)
TrainerBuilderBase Base class for trainer builder.

HFCausalTrainerBuilder

core.trainer_builder.HFCausalTrainerBuilder(
    self,
    cfg,
    model,
    tokenizer,
    processor=None,
)

Build the HuggingFace training args/trainer for causal models and reward modeling using TRL.

HFPPOTrainerBuilder

core.trainer_builder.HFPPOTrainerBuilder(
    self,
    cfg,
    model,
    tokenizer,
    processor=None,
)

HF Factory class for PPO Trainer

HFRLTrainerBuilder

core.trainer_builder.HFRLTrainerBuilder(
    self,
    cfg,
    model,
    tokenizer,
    processor=None,
)

Trainer factory class for TRL-based RLHF trainers (e.g. DPO)

TrainerBuilderBase

core.trainer_builder.TrainerBuilderBase(
    self,
    cfg,
    model,
    tokenizer,
    processor=None,
)

Base class for trainer builder.

Methods

Name Description
get_post_trainer_create_callbacks Callbacks added after the trainer is created, usually b/c these need access to the trainer
get_post_trainer_create_callbacks
core.trainer_builder.TrainerBuilderBase.get_post_trainer_create_callbacks(
    trainer,
)

Callbacks added after the trainer is created, usually b/c these need access to the trainer