langtest.utils.hf_utils.HuggingFacePipeline#

class HuggingFacePipeline(model_id: str | None = None, task: str | None = None, device: int | None = -1, pipeline: Any | None = None, **kwargs: Any)#

Bases: object

HuggingFace Pipeline API.

To use, you should have the transformers python package installed.

Only supports text-generation, text2text-generation and summarization for now.

__init__(model_id: str | None = None, task: str | None = None, device: int | None = -1, pipeline: Any | None = None, **kwargs: Any)#

Construct the pipeline object from model_id and task.

Methods

__init__([model_id, task, device, pipeline])

Construct the pipeline object from model_id and task.