SentenceTransformersDocumentEmbedder Parameters

Learn how you can configure SentenceTransformersDocumentEmbedder to calculate embeddings for documents.

YAML Init Parameters

ParameterTypePossible valuesDescription
modelStringDefault: sentence-transformers/all-mpnet-base-v2Local path or ID of the model on Hugging Face.
Required.
deviceComponentDeviceDefault: NoneOverrides the default device used to load the model.
Optional.
tokenSecretDefault: {"type": "env_var", "env_vars": ["HF_API_TOKEN"], "strict": False}The API token used to download private models from Hugging Face.
Optional.
prefixStringDefault: "" (empty string)A string to add at the beginning of each text. Can be used to prepend the text with an instruction, as required by some embedding models, such as E5 and bge.
Required.
suffixStringDefault: "" (empty string)A string to add at the end of each text.
Required.
batch_sizeIntegerDefault: 32Number of documents to encode at once.
Required.
progress_barBooleanTrue, False
Default: True
If True shows a progress bar when running.
Required.
normalize_embeddingsBooleanTrue, False
Default: False
If True, the returned vectors have the length of 1.
Required.
meta_fields_to_embedList of stringsDefault: NoneList of meta fields that will be embedded along with the document text.
Optional.
embedding_separatorStringDefault: "\n"Separator used to concatenate the meta fields to the document text.
Required.
trust_remote_codeBooleanTrue, False
Default: False
If False, only Hugging Face verified model architectures are allowed. If True, custom models and scripts are allowed.
Required.

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.