lmflow.pipeline.raft_aligner#
The Aligner class simplifies the process of running alignment.
Attributes#
Classes#
Initializes the RaftAligner class with given arguments. |
Module Contents#
- class lmflow.pipeline.raft_aligner.RaftAligner(model_args, data_args, aligner_args, *args, **kwargs)[source]#
Bases:
lmflow.pipeline.base_aligner.BaseAlignerInitializes the RaftAligner class with given arguments.
- Parameters:
model_args (ModelArguments object.) – Contains the arguments required to load the model.
data_args (DatasetArguments object.) – Contains the arguments required to load the dataset.
raft_aligner_args (RaftAlignerArguments object.) – Contains the arguments required to perform alignment.
args (Optional.) – Positional arguments.
kwargs (Optional.) – Keyword arguments.
- align(model, dataset, reward_model)[source]#
Perform alignment for a model
- Parameters:
model (BaseModel object.)
dataset (Dataset object.) –
- Input dataset for model to generate outputs. The input and output
will then be feed into reward model to get the reward for alignment.
reward_model (RegressionModel object.)