How to use from the
Use from the
sentence-transformers library
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("clembi/ModernBERT-base-embed")

sentences = [
    "In 1831, interesting novels were written in Paris.",
    "Hugo and Dumas met in the Opera in Paris in 1831.",
    "Many interesting novels are released in the 21st century.",
    "A new vegan burger is offered at the counter from now on."
]
embeddings = model.encode(sentences)

similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]

A ModernBERT model (answerdotai/ModernBERT-base) fine-tuned on NLI and tabular classification datasets using sentence-transformers.

You need transformers>=4.48.0 to use ModernBERT (or install from source using pip install git+https://github.com/huggingface/transformers.git). You might also want to install flash attention: pip install flash-attn.

Usage:

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("clembi/ModernBERT-base-embed")

sentences = [
    "bi-directional embedding methods are cool",
    "I like playing Mario Kart",
    "They all got into the Mupalupux and drove south.",
]

embeddings = model.encode(sentences)
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for clembi/ModernBERT-base-embed

Finetuned
(1296)
this model