Sentence Similarity
sentence-transformers
Safetensors
English
modernbert
feature-extraction
text-embeddings-inference
Instructions to use clembi/ModernBERT-base-embed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use clembi/ModernBERT-base-embed with sentence-transformers:
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] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,7 +18,7 @@ library_name: sentence-transformers
|
|
| 18 |
---
|
| 19 |
A ModernBERT model ([answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)) fine-tuned on NLI and tabular classification datasets using [sentence-transformers](https://sbert.net/).
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
Usage:
|
| 24 |
```python
|
|
|
|
| 18 |
---
|
| 19 |
A ModernBERT model ([answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)) fine-tuned on NLI and tabular classification datasets using [sentence-transformers](https://sbert.net/).
|
| 20 |
|
| 21 |
+
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`.
|
| 22 |
|
| 23 |
Usage:
|
| 24 |
```python
|