Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
dense
Generated from Trainer
dataset_size:369762
loss:CachedMultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use benjamintli/modernbert-codesearchnet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use benjamintli/modernbert-codesearchnet with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("benjamintli/modernbert-codesearchnet") sentences = [ "Return a Python AST node for `recur` occurring inside a `loop`.", "def _reset(self, name=None):\n \"\"\"Revert specified property to default value\n\n If no property is specified, all properties are returned to default.\n \"\"\"\n if name is None:\n for key in self._props:\n if isinstance(self._props[key], basic.Property):\n self._reset(key)\n return\n if name not in self._props:\n raise AttributeError(\"Input name '{}' is not a known \"\n \"property or attribute\".format(name))\n if not isinstance(self._props[name], basic.Property):\n raise AttributeError(\"Cannot reset GettableProperty \"\n \"'{}'\".format(name))\n if name in self._defaults:\n val = self._defaults[name]\n else:\n val = self._props[name].default\n if callable(val):\n val = val()\n setattr(self, name, val)", "def cancel(self):\n '''\n Cancel a running workflow.\n\n Args:\n None\n\n Returns:\n None\n '''\n if not self.id:\n raise WorkflowError('Workflow is not running. Cannot cancel.')\n\n if self.batch_values:\n self.workflow.batch_workflow_cancel(self.id)\n else:\n self.workflow.cancel(self.id)", "def __loop_recur_to_py_ast(ctx: GeneratorContext, node: Recur) -> GeneratedPyAST:\n \"\"\"Return a Python AST node for `recur` occurring inside a `loop`.\"\"\"\n assert node.op == NodeOp.RECUR\n\n recur_deps: List[ast.AST] = []\n recur_targets: List[ast.Name] = []\n recur_exprs: List[ast.AST] = []\n for name, expr in zip(ctx.recur_point.binding_names, node.exprs):\n expr_ast = gen_py_ast(ctx, expr)\n recur_deps.extend(expr_ast.dependencies)\n recur_targets.append(ast.Name(id=name, ctx=ast.Store()))\n recur_exprs.append(expr_ast.node)\n\n if len(recur_targets) == 1:\n assert len(recur_exprs) == 1\n recur_deps.append(ast.Assign(targets=recur_targets, value=recur_exprs[0]))\n else:\n recur_deps.append(\n ast.Assign(\n targets=[ast.Tuple(elts=recur_targets, ctx=ast.Store())],\n value=ast.Tuple(elts=recur_exprs, ctx=ast.Load()),\n )\n )\n recur_deps.append(ast.Continue())\n\n return GeneratedPyAST(node=ast.NameConstant(None), dependencies=recur_deps)" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Training in progress, epoch 1
Browse files- config.json +77 -0
- eval/Information-Retrieval_evaluation_eval_results.csv +2 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +23 -0
- training_args.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ModernBertModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 50281,
|
| 8 |
+
"classifier_activation": "gelu",
|
| 9 |
+
"classifier_bias": false,
|
| 10 |
+
"classifier_dropout": 0.0,
|
| 11 |
+
"classifier_pooling": "mean",
|
| 12 |
+
"cls_token_id": 50281,
|
| 13 |
+
"decoder_bias": true,
|
| 14 |
+
"deterministic_flash_attn": false,
|
| 15 |
+
"dtype": "float32",
|
| 16 |
+
"embedding_dropout": 0.0,
|
| 17 |
+
"eos_token_id": 50282,
|
| 18 |
+
"global_attn_every_n_layers": 3,
|
| 19 |
+
"gradient_checkpointing": false,
|
| 20 |
+
"hidden_activation": "gelu",
|
| 21 |
+
"hidden_size": 768,
|
| 22 |
+
"initializer_cutoff_factor": 2.0,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 1152,
|
| 25 |
+
"layer_norm_eps": 1e-05,
|
| 26 |
+
"layer_types": [
|
| 27 |
+
"full_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"full_attention"
|
| 49 |
+
],
|
| 50 |
+
"local_attention": 128,
|
| 51 |
+
"max_position_embeddings": 8192,
|
| 52 |
+
"mlp_bias": false,
|
| 53 |
+
"mlp_dropout": 0.0,
|
| 54 |
+
"model_type": "modernbert",
|
| 55 |
+
"norm_bias": false,
|
| 56 |
+
"norm_eps": 1e-05,
|
| 57 |
+
"num_attention_heads": 12,
|
| 58 |
+
"num_hidden_layers": 22,
|
| 59 |
+
"pad_token_id": 50283,
|
| 60 |
+
"position_embedding_type": "absolute",
|
| 61 |
+
"rope_parameters": {
|
| 62 |
+
"full_attention": {
|
| 63 |
+
"rope_theta": 160000.0,
|
| 64 |
+
"rope_type": "default"
|
| 65 |
+
},
|
| 66 |
+
"sliding_attention": {
|
| 67 |
+
"rope_theta": 10000.0,
|
| 68 |
+
"rope_type": "default"
|
| 69 |
+
}
|
| 70 |
+
},
|
| 71 |
+
"sep_token_id": 50282,
|
| 72 |
+
"sparse_pred_ignore_index": -100,
|
| 73 |
+
"sparse_prediction": false,
|
| 74 |
+
"tie_word_embeddings": true,
|
| 75 |
+
"transformers_version": "5.3.0",
|
| 76 |
+
"vocab_size": 50368
|
| 77 |
+
}
|
eval/Information-Retrieval_evaluation_eval_results.csv
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,steps,cosine-Accuracy@1,cosine-Accuracy@3,cosine-Accuracy@5,cosine-Accuracy@10,cosine-Precision@1,cosine-Recall@1,cosine-Precision@3,cosine-Recall@3,cosine-Precision@5,cosine-Recall@5,cosine-Precision@10,cosine-Recall@10,cosine-MRR@10,cosine-NDCG@10,cosine-MAP@100
|
| 2 |
+
1.0,46,0.9480526153529956,0.9703010995786662,0.9751824067413422,0.9806803000719351,0.9480526153529956,0.9480526153529956,0.32343369985955533,0.9703010995786662,0.19503648134826843,0.9751824067413422,0.09806803000719352,0.9806803000719351,0.9601788099886978,0.9652143122800294,0.9606213024321194
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc642ec9824513c91f2240b2eb85eb1064056c9beaffe91dfee4ab08060ca9cc
|
| 3 |
+
size 596070136
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"mask_token": "[MASK]",
|
| 7 |
+
"max_length": 512,
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 512,
|
| 13 |
+
"pad_to_multiple_of": null,
|
| 14 |
+
"pad_token": "[PAD]",
|
| 15 |
+
"pad_token_type_id": 0,
|
| 16 |
+
"padding_side": "right",
|
| 17 |
+
"sep_token": "[SEP]",
|
| 18 |
+
"stride": 0,
|
| 19 |
+
"tokenizer_class": "TokenizersBackend",
|
| 20 |
+
"truncation_side": "right",
|
| 21 |
+
"truncation_strategy": "longest_first",
|
| 22 |
+
"unk_token": "[UNK]"
|
| 23 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef1f8b2637a58af8dc05416e5559a0e43ffd64425f40bc2694f58b547af137ef
|
| 3 |
+
size 5585
|