Instructions to use huggingface-mic/modernbert-embed-base-mic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use huggingface-mic/modernbert-embed-base-mic with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("huggingface-mic/modernbert-embed-base-mic") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Download build.json from huggingface-mic/modernbert-embed-base-mic: direct link, hf CLI and curl.
- Browser
- Download file 6.82 kB
-
https://huggingface.co/huggingface-mic/modernbert-embed-base-mic/resolve/main/build.json
- Command line
-
hf download hf://huggingface-mic/modernbert-embed-base-mic/build.json
-
curl -L -o build.json https://huggingface.co/huggingface-mic/modernbert-embed-base-mic/resolve/main/build.json
6.82 kB
| { | |
| "fixture": "huggingface-mic/modernbert-embed-base-mic", | |
| "key": "e3e55d35c79788b32ec05312b695594510c481608dc784671d07d216fda9639b", | |
| "key_fields": { | |
| "architectures": [ | |
| "ModernBertModel" | |
| ], | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "vocab_size": 50368, | |
| "hidden_size": 64, | |
| "intermediate_size": 128, | |
| "num_hidden_layers": 2, | |
| "num_attention_heads": 4, | |
| "hidden_activation": "gelu", | |
| "max_position_embeddings": 8192, | |
| "initializer_range": 0.02, | |
| "initializer_cutoff_factor": 2.0, | |
| "norm_eps": 1e-05, | |
| "norm_bias": false, | |
| "pad_token_id": 50283, | |
| "eos_token_id": 50282, | |
| "bos_token_id": 50281, | |
| "cls_token_id": 50281, | |
| "sep_token_id": 50282, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention" | |
| ], | |
| "rope_parameters": { | |
| "sliding_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 10000.0 | |
| }, | |
| "full_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 160000.0 | |
| } | |
| }, | |
| "local_attention": 128, | |
| "embedding_dropout": 0.0, | |
| "mlp_bias": false, | |
| "mlp_dropout": 0.0, | |
| "decoder_bias": true, | |
| "classifier_pooling": "mean", | |
| "classifier_dropout": 0.0, | |
| "classifier_bias": false, | |
| "classifier_activation": "gelu", | |
| "deterministic_flash_attn": false, | |
| "sparse_prediction": false, | |
| "sparse_pred_ignore_index": -100, | |
| "tie_word_embeddings": true, | |
| "global_attn_every_n_layers": 3, | |
| "gradient_checkpointing": false, | |
| "layer_norm_eps": 1e-05, | |
| "model_type": "modernbert", | |
| "position_embedding_type": "absolute", | |
| "output_attentions": false | |
| }, | |
| "sentence_transformers": { | |
| "config": { | |
| "architectures": [ | |
| "ModernBertModel" | |
| ], | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "vocab_size": 50368, | |
| "hidden_size": 64, | |
| "intermediate_size": 128, | |
| "num_hidden_layers": 2, | |
| "num_attention_heads": 4, | |
| "hidden_activation": "gelu", | |
| "max_position_embeddings": 8192, | |
| "initializer_range": 0.02, | |
| "initializer_cutoff_factor": 2.0, | |
| "norm_eps": 1e-05, | |
| "norm_bias": false, | |
| "pad_token_id": 50283, | |
| "eos_token_id": 50282, | |
| "bos_token_id": 50281, | |
| "cls_token_id": 50281, | |
| "sep_token_id": 50282, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention" | |
| ], | |
| "rope_parameters": { | |
| "sliding_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 10000.0 | |
| }, | |
| "full_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 160000.0 | |
| } | |
| }, | |
| "local_attention": 128, | |
| "embedding_dropout": 0.0, | |
| "mlp_bias": false, | |
| "mlp_dropout": 0.0, | |
| "decoder_bias": true, | |
| "classifier_pooling": "mean", | |
| "classifier_dropout": 0.0, | |
| "classifier_bias": false, | |
| "classifier_activation": "gelu", | |
| "deterministic_flash_attn": false, | |
| "sparse_prediction": false, | |
| "sparse_pred_ignore_index": -100, | |
| "tie_word_embeddings": true, | |
| "global_attn_every_n_layers": 3, | |
| "gradient_checkpointing": false, | |
| "layer_norm_eps": 1e-05, | |
| "model_type": "modernbert", | |
| "position_embedding_type": "absolute", | |
| "output_attentions": false | |
| }, | |
| "dtype": "float32", | |
| "source_files": {}, | |
| "st_class": "SentenceTransformer", | |
| "module_changes": [ | |
| { | |
| "module": "Pooling", | |
| "from": 768, | |
| "to": 64 | |
| } | |
| ] | |
| }, | |
| "covers": { | |
| "nomic-ai/modernbert-embed-base": "d556a88e332558790b210f7bdbe87da2fa94a8d8" | |
| }, | |
| "built_from": { | |
| "repo": "nomic-ai/modernbert-embed-base", | |
| "revision": "d556a88e332558790b210f7bdbe87da2fa94a8d8" | |
| }, | |
| "seed": 17, | |
| "dtype": "float32", | |
| "builder": "transformers_mic.sentence_transformers", | |
| "builder_revision": "af91a64695b6efa6ff530cf9df86aa5743e47bd4", | |
| "recipe": { | |
| "seed": 17, | |
| "sentence_transformers_class": "SentenceTransformer" | |
| }, | |
| "shrink": "rule", | |
| "model_class": "ModernBertModel", | |
| "parameters": 3305792, | |
| "weights": "random", | |
| "gate": { | |
| "random": { | |
| "pass": true, | |
| "accepted_insensitive": {}, | |
| "threshold": 0.001, | |
| "deltas": { | |
| "input_ids:roll_batch": 3.9008240699768066, | |
| "input_ids:reverse": 3.8036413192749023, | |
| "attention_mask:all_ones": 0.011417388916015625 | |
| }, | |
| "weakest": "attention_mask:all_ones", | |
| "no_perturbation_defined": [], | |
| "not_a_forward_parameter": [] | |
| } | |
| }, | |
| "numeric_health": { | |
| "float32": { | |
| "outputs_finite": true, | |
| "finite": true | |
| }, | |
| "bfloat16": { | |
| "outputs_finite": true, | |
| "finite": true | |
| }, | |
| "float16": { | |
| "outputs_finite": true, | |
| "finite": true | |
| } | |
| }, | |
| "copied_unchanged": [ | |
| "special_tokens_map.json", | |
| "tokenizer.json", | |
| "tokenizer_config.json" | |
| ], | |
| "captured": { | |
| "call": "first inference call", | |
| "inputs": [ | |
| "attention_mask", | |
| "input_ids", | |
| "return_dict" | |
| ], | |
| "class": "ModernBertModel" | |
| }, | |
| "environment": { | |
| "python": "3.12.13", | |
| "torch": "2.11.0+cpu", | |
| "transformers": "5.22.1", | |
| "tokenizers": "0.23.3", | |
| "sentence-transformers": "6.2.0", | |
| "huggingface-hub": "2.4.0" | |
| }, | |
| "sha256": { | |
| "1_Pooling/config.json": "997cb667633fd53a76980d5173423a20c214637790c37e308d59879953a305ca", | |
| "2_Normalize/config.json": "cdb09dfca347a56aa2d691744e38d5ad3c7cbc2834e7181272b9a15328b82524", | |
| "config.json": "2d9c5b24cd5dad63d60cd2255f75b3225d69c6f02b450f78d3d81948e1a09f98", | |
| "config_sentence_transformers.json": "fb94f37d5249769e7fbb5c186d45fc12df994ed22ca47b3421e7cf85a2d5190d", | |
| "model.safetensors": "e909d53a97c94426fce6dbca17b476fa0d7dc86dbc0194085b4c6363854f8be1", | |
| "modules.json": "3d02572a0455b832de67fb8e63a54981bc7e8b46e337c95e917bd8122a533bfd", | |
| "sentence_bert_config.json": "3084164002c0bca01b0259c5327123803fce32e660a57feb93184ffead186fc8", | |
| "special_tokens_map.json": "ea97ecdbcc73713039d8d64dbb05e3689495c96657fbd9a18f5bed381be81049", | |
| "tokenizer.json": "6c8aaa9a542084f2457eab775d4eeb51f92a70c0fd9de28d5edb0ddec3c08d30", | |
| "tokenizer_config.json": "2966a59b9e9cf122279aec1249e22e5bc7ad8430c754e95031b13fd128d4e560" | |
| } | |
| } | |