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.
The trust_remote_code parameter defaults to True, which allows models to execute arbitrary code from their Hugging Face repository during loading. If you are loading untrusted models, set trust_remote_code=False to prevent remote code execution.
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 Hugging Face Hub supported models.
Visit sentence-transformers HuggingFace HUB page for more information on the available models.