Sentence Similarity
sentence-transformers
Safetensors
English
modernbert
feature-extraction
dense
text-embeddings-inference
🇪🇺 Region: EU
Instructions to use lightonai/DenseOn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use lightonai/DenseOn with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("lightonai/DenseOn") 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] - Inference
- Notebooks
- Google Colab
- Kaggle
Will there be a 8192 token input variant of DenseOn?
#3
by jshree - opened
Wondering if there is a future plan to increase the input context window capacity?
Hey @jshree , DenseOn is based on mmBERT which supports inputs up to 8192 tokens, but we set the model context length to 512 during retrieval training. You may bump it to 8192 tokens if you prefer:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("lightonai/DenseOn")
model.max_seq_length = 8192
Nevertheless, I recommend you to use our multilingual dense model https://huggingface.co/lightonai/mDenseOn which was specifically trained for long context text. You may also consider our multilingual multi-vector model https://huggingface.co/lightonai/mLateOn if your use case allows for it, since long context performance (MLDR benchmark) is much stronger for this model.