lmflow.pipeline.raft_aligner#

The Aligner class simplifies the process of running alignment.

Attributes#

Classes#

RaftAligner

Initializes the RaftAligner class with given arguments.

Module Contents#

lmflow.pipeline.raft_aligner.logger[source]#
class lmflow.pipeline.raft_aligner.RaftAligner(model_args, data_args, aligner_args, *args, **kwargs)[source]#

Bases: lmflow.pipeline.base_aligner.BaseAligner

Initializes 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.

model_args[source]#
data_args[source]#
aligner_args[source]#
INF = 888888888[source]#
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.)