Sentence Similarity
sentence-transformers
Safetensors
Transformers
English
atto
feature-extraction
sparse-encoder
custom_code
Instructions to use NeuML/atto-28m-8192d-sparse-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NeuML/atto-28m-8192d-sparse-embeddings with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("NeuML/atto-28m-8192d-sparse-embeddings", trust_remote_code=True) queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Transformers
How to use NeuML/atto-28m-8192d-sparse-embeddings with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NeuML/atto-28m-8192d-sparse-embeddings", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Ctrl+K