sentence-transformers object.
Sentence transformer embeddings are normalized by default. It is recommended to use normalized embeddings for similarity search.
| Parameter | Type | Default Value | Description |
|---|---|---|---|
name | str | all-MiniLM-L6-v2 | The name of the model |
device | str | cpu | The device to run the model on (can be cpu or gpu) |
normalize | bool | True | Whether to normalize the input text before feeding it to the model |
trust_remote_code | bool | False | Whether to trust and execute remote code from the model’s Huggingface repository |
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.