Sentence Similarity
sentence-transformers
ONNX
Safetensors
Transformers
Transformers.js
English
nomic_bert
feature-extraction
mteb
custom_code
Eval Results (legacy)
Eval Results
text-embeddings-inference
Instructions to use nomic-ai/nomic-embed-text-v1.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use nomic-ai/nomic-embed-text-v1.5 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("nomic-ai/nomic-embed-text-v1.5", trust_remote_code=True) sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use nomic-ai/nomic-embed-text-v1.5 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("nomic-ai/nomic-embed-text-v1.5", trust_remote_code=True) model = AutoModel.from_pretrained("nomic-ai/nomic-embed-text-v1.5", trust_remote_code=True, device_map="auto") - Transformers.js
How to use nomic-ai/nomic-embed-text-v1.5 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('sentence-similarity', 'nomic-ai/nomic-embed-text-v1.5'); - Notebooks
- Google Colab
- Kaggle
Standardize config.json for native Transformers integration
#56
by SonnyCoops - opened
Summary
This PR updates the config.json to support the native NomicBert implementation currently being merged into transformers: PR#43067
Changes
- Internalization: Removed
auto_mapto favor the native library implementation - Standardization: Mapped legacy keys to standard Transformer keys for compatibility
- Cleanup: Added
add_pooling_layer: falseto eliminate initialization warnings for standard BERT poolers.
Also replied on the PR in transformers but let's rather change to the base native config, i.e. NomicBertConfig().save_pretrained("your_folder") from the PR. The values should match (otherwise we need to fix the values on the config)