Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
dense
Generated from Trainer
dataset_size:3375201
loss:MSELoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use johnnyboycurtis/ModernBERT-small-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use johnnyboycurtis/ModernBERT-small-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("johnnyboycurtis/ModernBERT-small-v2") sentences = [ "What is Weboob. Weboob is a collection of applications able to interact with websites, without requiring the user to open them in a browser. It also provides well-defined APIs to talk to websites lacking one.", "Moreno and colleagues (Mossio et al. 2009; Moreno & Mossio 2015) have also claimed that their organizational approach unifies across backwardlooking and forward-looking accounts by describing activities that atemporally account for the continuing persistence of traits.", "average cost of a dj for a wedding 2015", "CIALIS tablets should not be split, crushed or separated in any way. Do not split CIALIS tablets; the entire dose should be taken. Splitting or crushing may result in the patient receiving more or less than the desired dose. References. CIALIS [package insert]." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Download config.json from johnnyboycurtis/ModernBERT-small-v2: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/johnnyboycurtis/ModernBERT-small-v2/resolve/main/config.json
- Command line
-
hf download hf://johnnyboycurtis/ModernBERT-small-v2/config.json
-
curl -L -o config.json https://huggingface.co/johnnyboycurtis/ModernBERT-small-v2/resolve/main/config.json
1.55 kB
| { | |
| "architectures": [ | |
| "ModernBertModel" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 50281, | |
| "classifier_activation": "gelu", | |
| "classifier_bias": false, | |
| "classifier_dropout": 0.0, | |
| "classifier_pooling": "cls", | |
| "cls_token_id": 50281, | |
| "decoder_bias": true, | |
| "deterministic_flash_attn": false, | |
| "dtype": "float32", | |
| "embedding_dropout": 0.0, | |
| "eos_token_id": 50282, | |
| "global_attn_every_n_layers": 3, | |
| "hidden_activation": "gelu", | |
| "hidden_size": 384, | |
| "initializer_cutoff_factor": 2.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 768, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention" | |
| ], | |
| "local_attention": 128, | |
| "max_position_embeddings": 1024, | |
| "mlp_bias": false, | |
| "mlp_dropout": 0.0, | |
| "model_type": "modernbert", | |
| "norm_bias": false, | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 6, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": 50283, | |
| "rope_parameters": { | |
| "full_attention": { | |
| "rope_theta": 160000.0, | |
| "rope_type": "default" | |
| }, | |
| "sliding_attention": { | |
| "rope_theta": 10000.0, | |
| "rope_type": "default" | |
| } | |
| }, | |
| "sep_token_id": 50282, | |
| "sparse_pred_ignore_index": -100, | |
| "sparse_prediction": false, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.1.0", | |
| "vocab_size": 50368 | |
| } | |