TRL documentation
MergeModelCallback
Getting started
Conceptual Guides
Trainers
How-to guides
Command Line Interface (CLI)Training using JobsCustomizing the TrainingReducing Memory UsageSpeeding Up TrainingDistributing TrainingUsing Trained Models
Integrations
DeepSpeedKernels HubLiger KernelOpenEnvOpenRewardPEFTPost Training ToolkitRapidFire AITrackioUnslothvLLM
Examples
API
Experimental
You are viewing main version, which requires installation from source. If you'd like
regular pip install, checkout the latest stable version (v1.4.0).
MergeModelCallback
class trl.experimental.merge_model_callback.MergeModelCallback
< source >( merge_config: MergeConfig | None = None merge_at_every_checkpoint: bool = False push_to_hub: bool = False )
Parameters
- merge_config (
experimental.merge_model_callback.MergeConfig, optional) — Configuration used for the merging process. If not provided, the defaultMergeConfigis used. - merge_at_every_checkpoint (
bool, optional, defaults toFalse) — Whether to merge the model at every checkpoint. - push_to_hub (
bool, optional, defaults toFalse) — Whether to push the merged model to the Hub after merging.
A TrainerCallback that merges the policy model (the model being trained) with another model based on a merge configuration.