Skip to main content
Allows you to set parameters when registering a sentence-transformers object.
Sentence transformer embeddings are normalized by default. It is recommended to use normalized embeddings for similarity search.
Setting trust_remote_code=True allows the model to execute arbitrary code from its HuggingFace repository during loading. Only enable it for repositories you trust, and pin revision to a commit hash. When a table using such a model is opened in a new process, the model must be approved with get_registry().allow_remote_code(...). See Trusting remote code and custom endpoints.
You can also load many other model architectures from the library. For example models from sources such as BAAI, Nomic, Salesforce Research, etc. See this HF hub page for all supported models.
Here is an example that uses the BAAI embedding model from the HuggingFace Hub supported models.
Visit the sentence-transformers HuggingFace Hub page for more information on the available models.