Learn how to customize TransformersTextRouter.
YAML Init Parameters
These are the parameters you can pass to this component in the pipeline YAML configuration:
Parameter | Type | Possible values | Description |
---|---|---|---|
model | str | The name or path of a Hugging Face model for zero-shot text classification. Required. | |
labels | List[str] | Default: None | The 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. |
device | ComponentDevice | Default: None | The 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. |
token | Secret | Default: 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_kwargs | Dict[str, Any] | Default: None | Dictionary 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.