TransformersTextRouter Parameters

Learn how to customize TransformersTextRouter.

YAML Init Parameters

These are the parameters you can pass to this component in the pipeline YAML configuration:

ParameterTypePossible valuesDescription
modelstrThe name or path of a Hugging Face model for zero-shot text classification. Required.
labelsList[str]Default: NoneThe list of labels that the model has been trained to predict. If not provided, the component fetches the labels from the model configuration file. Optional.
deviceComponentDeviceDefault: NoneThe device on which the model is loaded. If None, the default device is automatically selected. If a device/device map is specified in huggingface_pipeline_kwargs, it overrides this parameter. Optional.
tokenSecretDefault: Secret.from_env_var("HF_API_TOKEN", strict=False)The API token used to download private models from Hugging Face. If token is set to True, the token generated when running transformers-cli login (stored in ~/.huggingface) is used. Optional.
huggingface_pipeline_kwargsDict[str, Any]Default: NoneDictionary containing keyword arguments used to initialize the Hugging Face pipeline for zero shot text classification. Optional.

REST API Runtime Parameters

There are no runtime parameters you can pass to this component when making a request to the Search REST API endpoint.