lmflow.pipeline.rm_inferencer#
Attributes#
Classes#
Initializes the Inferencer class with given arguments. |
Module Contents#
- class lmflow.pipeline.rm_inferencer.RewardModelInferencer(model_args: lmflow.args.ModelArguments, data_args: lmflow.args.DatasetArguments, inferencer_args: lmflow.args.InferencerArguments, **kwargs)[source]#
Bases:
lmflow.pipeline.base_pipeline.BasePipeline
Initializes the Inferencer class with given arguments.
- Parameters:
- model_argsModelArguments object.
Contains the arguments required to load the model.
- data_argsDatasetArguments object.
Contains the arguments required to load the dataset.
- inferencer_argsInferencerArguments object.
Contains the arguments required to perform inference.
- inference(model: lmflow.models.hf_text_regression_model.HFTextRegressionModel, dataset: lmflow.datasets.dataset.Dataset, transform_dataset_in_place: bool = True, use_vllm: bool = False, enable_distributed_inference: bool = False, **kwargs) lmflow.datasets.dataset.Dataset [source]#
- _inference(model: lmflow.models.hf_text_regression_model.HFTextRegressionModel, model_input: lmflow.datasets.dataset.Dataset | ray.data.Dataset, enable_distributed_inference: bool = False, **kwargs)[source]#
- __inference(model: lmflow.models.hf_text_regression_model.HFTextRegressionModel, model_input: lmflow.datasets.dataset.Dataset) List[float] | List[List[float]] [source]#
- __distributed_inference(model: lmflow.models.hf_text_regression_model.HFTextRegressionModel, model_input: ray.data.Dataset, num_instances: int, batch_size: int) List[lmflow.utils.data_utils.RewardModelInferenceResultWithInput] [source]#
- abstract __vllm_inference(model: lmflow.models.hf_text_regression_model.HFTextRegressionModel, model_input: List[str], enable_distributed_inference: bool = False) List[float] [source]#