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
Please consider changing the license of this model to something which is fully free software.
What is Free Software? - GNU Project - Free Software Foundation:
https://www.gnu.org/philosophy/free-sw.html
Can you consider changing the license to some license which is fully free software because non commercial purposes makes really no sense. All these models are really useful commercially and there are many competitors in the free software space.
For example, I have chosen yesterday Nomic Embed Vision Version one point five model because it is truly free software and I first wanted to install this one, but I didn't. So how many other people didn't install it because of the licensing issue? Why would you be forbidding commercial use? You can't even know who is selling this model commercially. You cannot know that. Once you publish it, once it is there, once you offer it for the download, now what is the problem? Let people have freedom.
Hi, @JLouisBiz . Thanks for your comments. NV-Embed is a research model which employed the non-commercial datasets for training, so we could not declare it's commercial model. For commercial purpose, we recommend you to use the models of NeMo Retriever Microservices (NIMs): https://build.nvidia.com/explore/retrieval