Instructions to use nvidia/NV-Embed-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use nvidia/NV-Embed-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("nvidia/NV-Embed-v1", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Dataloader multiprocessing error
#28
by Atsunori - opened
Dataloader multiprocessing error sometimes occurs, when we use model._do_encode(). This error comes from num_workers=32 (https://huggingface.co/nvidia/NV-Embed-v1/blob/main/modeling_nvembed.py#L371). So it may be better to change that to an argument.
Thanks for reporting this issue. We added the num_workers as an argument for _do_encode(). The example is updated in this model card: https://huggingface.co/nvidia/NV-Embed-v1.