Instructions to use nvidia/NV-Embed-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/NV-Embed-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="nvidia/NV-Embed-v2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nvidia/NV-Embed-v2", trust_remote_code=True, dtype="auto") - sentence-transformers
How to use nvidia/NV-Embed-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("nvidia/NV-Embed-v2", 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
again GGUF?
at the moment this error:
Error converting to fp16: INFO:hf-to-gguf:Loading model: NV-Embed-v2
WARNING:hf-to-gguf:Failed to load model config from downloads/tmpto3redvv/NV-Embed-v2: The repository downloads/tmpto3redvv/NV-Embed-v2 contains custom code which must be executed to correctly load the model. You can inspect the repository content at /home/user/app/downloads/tmpto3redvv/NV-Embed-v2 .
You can inspect the repository content at https://hf.co/downloads/tmpto3redvv/NV-Embed-v2.
Please pass the argument trust_remote_code=True to allow custom code to be run.
WARNING:hf-to-gguf:Trying to load config.json instead
INFO:hf-to-gguf:Model architecture: MistralModel
ERROR:hf-to-gguf:Model MistralModel is not supported