CoolFace
Modelpublic

juanwisz/modernbert-python-code-retrieval

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes86downloads
Model Card

SentenceTransformer based on answerdotai/ModernBERT-base

This is a sentence-transformers model finetuned from answerdotai/ModernBERT-base on the codesearchnet dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: answerdotai/ModernBERT-base <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
  • Maximum Sequence Length: 4096 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset:
  • codesearchnet <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 4096, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("juanwisz/modernbert-python-code-retrieval")
# Run inference
sentences = [
    'Validates control dictionary for the experiment context',
    'def __validateExperimentControl(self, control):\n    """ Validates control dictionary for the experiment context"""\n    # Validate task list\n    taskList = control.get(\'tasks\', None)\n    if taskList is not None:\n      taskLabelsList = []\n\n      for task in taskList:\n        validateOpfJsonValue(task, "opfTaskSchema.json")\n        validateOpfJsonValue(task[\'taskControl\'], "opfTaskControlSchema.json")\n\n        taskLabel = task[\'taskLabel\']\n\n        assert isinstance(taskLabel, types.StringTypes), \\\n               "taskLabel type: %r" % type(taskLabel)\n        assert len(taskLabel) > 0, "empty string taskLabel not is allowed"\n\n        taskLabelsList.append(taskLabel.lower())\n\n      taskLabelDuplicates = filter(lambda x: taskLabelsList.count(x) > 1,\n                                   taskLabelsList)\n      assert len(taskLabelDuplicates) == 0, \\\n             "Duplcate task labels are not allowed: %s" % taskLabelDuplicates\n\n    return',
    'def load_file_list(path=None, regx=\'\\.jpg\', printable=True, keep_prefix=False):\n    r"""Return a file list in a folder by given a path and regular expression.\n\n    Parameters\n    ----------\n    path : str or None\n        A folder path, if `None`, use the current directory.\n    regx : str\n        The regx of file name.\n    printable : boolean\n        Whether to print the files infomation.\n    keep_prefix : boolean\n        Whether to keep path in the file name.\n\n    Examples\n    ----------\n    >>> file_list = tl.files.load_file_list(path=None, regx=\'w1pre_[0-9]+\\.(npz)\')\n\n    """\n    if path is None:\n        path = os.getcwd()\n    file_list = os.listdir(path)\n    return_list = []\n    for _, f in enumerate(file_list):\n        if re.search(regx, f):\n            return_list.append(f)\n    # return_list.sort()\n    if keep_prefix:\n        for i, f in enumerate(return_list):\n            return_list[i] = os.path.join(path, f)\n\n    if printable:\n        logging.info(\'Match file list = %s\' % return_list)\n        logging.info(\'Number of files = %d\' % len(return_list))\n    return return_list',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

codesearchnet
  • Dataset: codesearchnet
  • Size: 412,178 training samples
  • Columns: <code>query</code> and <code>positive</code>
  • Approximate statistics based on the first 1000 samples: | | query | positive | |:--------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 4 tokens</li><li>mean: 73.72 tokens</li><li>max: 2258 tokens</li></ul> | <ul><li>min: 46 tokens</li><li>mean: 300.87 tokens</li><li>max: 3119 tokens</li></ul> |
  • Samples: | query | positive | |:------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Extracts the list of arguments that start with any of the specified prefix values</code> | <code>def findArgs(args, prefixes):<br> """<br> Extracts the list of arguments that start with any of the specified prefix values<br> """<br> return list([<br> arg for arg in args<br> if len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0<br> ])</code> | | <code>Removes any arguments in the supplied list that are contained in the specified blacklist</code> | <code>def stripArgs(args, blacklist):<br> """<br> Removes any arguments in the supplied list that are contained in the specified blacklist<br> """<br> blacklist = [b.lower() for b in blacklist]<br> return list([arg for arg in args if arg.lower() not in blacklist])</code> | | <code>Executes a child process and captures its output</code> | <code>def capture(command, input=None, cwd=None, shell=False, raiseOnError=False):<br> """<br> Executes a child process and captures its output<br> """<br> <br> # Attempt to execute the child process<br> proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universal_newlines=True)<br> (stdout, stderr) = proc.communicate(input)<br> <br> # If the child process failed and we were asked to raise an exception, do so<br> if raiseOnError == True and proc.returncode != 0:<br> raise Exception(<br> 'child process ' + str(command) +<br> ' failed with exit code ' + str(proc.returncode) +<br> '\nstdout: "' + stdout + '"' +<br> '\nstderr: "' + stderr + '"'<br> )<br> <br> return CommandOutput(proc.returncode, stdout, stderr)</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Evaluation Dataset

codesearchnet
  • Dataset: codesearchnet
  • Size: 23,107 evaluation samples
  • Columns: <code>query</code> and <code>positive</code>
  • Approximate statistics based on the first 1000 samples: | | query | positive | |:--------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 5 tokens</li><li>mean: 168.27 tokens</li><li>max: 2118 tokens</li></ul> | <ul><li>min: 48 tokens</li><li>mean: 467.9 tokens</li><li>max: 4096 tokens</li></ul> |
  • Samples: | query | positive | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Train a deepq model.<br><br> Parameters<br> -------<br> env: gym.Env<br> environment to train on<br> network: string or a function<br> neural network to use as a q function approximator. If string, has to be one of the names of registered models in baselines.common.models<br> (mlp, cnn, convonly). If a function, should take an observation tensor and return a latent variable tensor, which<br> will be mapped to the Q function heads (see buildqfunc in baselines.deepq.models for details on that)<br> seed: int or None<br> prng seed. The runs with the same seed "should" give the same results. If None, no seeding is used.<br> lr: float<br> learning rate for adam optimizer<br> totaltimesteps: int<br> number of env steps to optimizer for<br> buffersize: int<br> size of the replay buffer<br> explorationfraction: float<br> fraction of entire training period over which the exploration rate is annealed<br> explorationfinaleps: float<br> final value of ra...</code> | <code>def learn(env,<br> network,<br> seed=None,<br> lr=5e-4,<br> totaltimesteps=100000,<br> buffersize=50000,<br> explorationfraction=0.1,<br> explorationfinaleps=0.02,<br> trainfreq=1,<br> batchsize=32,<br> printfreq=100,<br> checkpointfreq=10000,<br> checkpointpath=None,<br> learningstarts=1000,<br> gamma=1.0,<br> targetnetworkupdatefreq=500,<br> prioritizedreplay=False,<br> prioritizedreplayalpha=0.6,<br> prioritizedreplaybeta0=0.4,<br> prioritizedreplaybetaiters=None,<br> prioritizedreplayeps=1e-6,<br> paramnoise=False,<br> callback=None,<br> loadpath=None,<br> network_kwargs<br> ):<br> """Train a deepq model.<br><br> Parameters<br> -------<br> env: gym.Env<br> environment to train on<br> network: string or a function<br> neural network to use as a q function approximator. If string, has to be one of the ...</code> | | <code>Save model to a pickle located at `path`</code> | <code>def save_act(self, path=None):<br> """Save model to a pickle located at `path`"""<br> if path is None:<br> path = os.path.join(logger.get_dir(), "model.pkl")<br><br> with tempfile.TemporaryDirectory() as td:<br> save_variables(os.path.join(td, "model"))<br> arc_name = os.path.join(td, "packed.zip")<br> with zipfile.ZipFile(arc_name, 'w') as zipf:<br> for root, dirs, files in os.walk(td):<br> for fname in files:<br> file_path = os.path.join(root, fname)<br> if file_path != arc_name:<br> zipf.write(file_path, os.path.relpath(file_path, td))<br> with open(arc_name, "rb") as f:<br> model_data = f.read()<br> with open(path, "wb") as f:<br> cloudpickle.dump((model_data, self._act_params), f)</code> | | <code>CNN from Nature paper.</code> | <code>def nature_cnn(unscaled_images, convkwargs):<br> """<br> CNN from Nature paper.<br> """<br> scaledimages = tf.cast(unscaledimages, tf.float32) / 255.<br> activ = tf.nn.relu<br> h = activ(conv(scaledimages, 'c1', nf=32, rf=8, stride=4, initscale=np.sqrt(2),<br> **convkwargs))<br> h2 = activ(conv(h, 'c2', nf=64, rf=4, stride=2, initscale=np.sqrt(2), **convkwargs))<br> h3 = activ(conv(h2, 'c3', nf=64, rf=3, stride=1, initscale=np.sqrt(2), **convkwargs))<br> h3 = convtofc(h3)<br> return activ(fc(h3, 'fc1', nh=512, init_scale=np.sqrt(2)))</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: epoch
  • per_device_train_batch_size: 4
  • gradient_accumulation_steps: 4
  • learning_rate: 2e-05
  • num_train_epochs: 10
  • warmup_steps: 1000
  • fp16: True
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 8
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 4
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 10
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 1000
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining LossValidation Loss
0.00782000.634-
0.01554000.0046-
0.02336000.0009-
0.03118000.0004-
0.038810000.0001-
0.046612000.0002-
0.054314000.0001-
0.062116000.0001-
0.069918000.0001-
0.077620000.0-
0.085422000.0-
0.093224000.0-
0.100926000.0-
0.108728000.0005-
0.116530000.0005-
0.124232000.0002-
0.132034000.0-
0.139736000.0-
0.147538000.0-
0.155340000.0001-
0.163042000.0-
0.170844000.0001-
0.178646000.0001-
0.186348000.0-
0.194150000.0-
0.201952000.0-
0.209654000.0-
0.217456000.0-
0.225158000.0-
0.232960000.0004-
0.240762000.0-
0.248464000.0001-
0.256266000.0-
0.264068000.0-
0.271770000.0-
0.279572000.0-
0.287374000.0-
0.295076000.0-
0.302878000.0-
0.310580000.0-
0.318382000.0-
0.326184000.0004-
0.333886000.0-
0.341688000.0-
0.349490000.0-
0.357192000.0-
0.364994000.0-
0.372796000.0-
0.380498000.0-
0.3882100000.0-
0.3959102000.0-
0.4037104000.0-
0.4115106000.0-
0.4192108000.0-
0.4270110000.0-
0.4348112000.0-
0.4425114000.0-
0.4503116000.0-
0.4581118000.0-
0.4658120000.0-
0.4736122000.0-
0.4813124000.0-
0.4891126000.0005-
0.4969128000.0-
0.5046130000.0-
0.5124132000.0001-
0.5202134000.0-
0.5279136000.0-
0.5357138000.0-
0.5435140000.0-
0.5512142000.0-
0.5590144000.0004-
0.5667146000.0-
0.5745148000.0-
0.5823150000.0-
0.5900152000.0-
0.5978154000.0-
0.6056156000.0-
0.6133158000.0-
0.6211160000.0-
0.6289162000.0-
0.6366164000.0006-
0.6444166000.0-
0.6521168000.0005-
0.6599170000.0-
0.6677172000.0-
0.6754174000.0-
0.6832176000.0-
0.6910178000.0-
0.6987180000.0005-
0.7065182000.0001-
0.7143184000.0-
0.7220186000.0-
0.7298188000.0-
0.7375190000.0-
0.7453192000.0-
0.7531194000.0-
0.7608196000.0-
0.7686198000.0001-
0.7764200000.0-
0.7841202000.0-
0.7919204000.0-
0.7997206000.0004-
0.8074208000.0-
0.8152210000.0-
0.8229212000.0-
0.8307214000.0009-
0.8385216000.0-
0.8462218000.0-
0.8540220000.0-
0.8618222000.0-
0.8695224000.0002-
0.8773226000.0-
0.8851228000.0-
0.8928230000.0001-
0.9006232000.0-
0.9083234000.0-
0.9161236000.0-
0.9239238000.0-
0.9316240000.0-
0.9394242000.0-
0.9472244000.0-
0.9549246000.0-
0.9627248000.0-
0.9704250000.0-
0.9782252000.0-
0.9860254000.0-
0.9937256000.0-
1.025762-0.0001
1.0015258000.0005-
1.0092260000.0-
1.0170262000.0-
1.0248264000.0-
1.0325266000.0-
1.0403268000.0-
1.0481270000.0-
1.0558272000.0-
1.0636274000.0-
1.0713276000.0-
1.0791278000.0-
1.0869280000.0-
1.0946282000.0-
1.1024284000.0-
1.1102286000.0-
1.1179288000.0-
1.1257290000.0-
1.1335292000.0-
1.1412294000.0-
1.1490296000.0-
1.1567298000.0-
1.1645300000.0-
1.1723302000.0-
1.1800304000.0-
1.1878306000.0-
1.1956308000.0-
1.2033310000.0-
1.2111312000.0-
1.2189314000.0-
1.2266316000.0004-
1.2344318000.0004-
1.2421320000.0-
1.2499322000.0-
1.2577324000.0-
1.2654326000.0-
1.2732328000.0-
1.2810330000.0-
1.2887332000.0-
1.2965334000.0-
1.3043336000.0-
1.3120338000.0-
1.3198340000.0-
1.3275342000.0-
1.3353344000.0-
1.3431346000.0-
1.3508348000.0004-
1.3586350000.0005-
1.3664352000.0004-
1.3741354000.0011-
1.3819356000.0-
1.3897358000.0-
1.3974360000.0-
1.4052362000.0-
1.4129364000.0-
1.4207366000.0-
1.4285368000.0-
1.4362370000.0-
1.4440372000.0001-
1.4518374000.0-
1.4595376000.0-
1.4673378000.0-
1.4751380000.0-
1.4828382000.0004-
1.4906384000.0003-
1.4983386000.0-
1.5061388000.0-
1.5139390000.0-
1.5216392000.0-
1.5294394000.0004-
1.5372396000.0004-
1.5449398000.0-
1.5527400000.0-
1.5605402000.0-
1.5682404000.0-
1.5760406000.0009-
1.5837408000.0-
1.5915410000.0009-
1.5993412000.0-
1.6070414000.0-
1.6148416000.0-
1.6226418000.0-
1.6303420000.0-
1.6381422000.0-
1.6459424000.0-
1.6536426000.0-
1.6614428000.0-
1.6691430000.0-
1.6769432000.0-
1.6847434000.0-
1.6924436000.0-
1.7002438000.0-
1.7080440000.0-
1.7157442000.0-
1.7235444000.0-
1.7313446000.0-
1.7390448000.0-
1.7468450000.0-
1.7545452000.0-
1.7623454000.0-
1.7701456000.0-
1.7778458000.0-
1.7856460000.0-
1.7934462000.0-
1.8011464000.0-
1.8089466000.0-
1.8167468000.0-
1.8244470000.0-
1.8322472000.0-
1.8399474000.0-
1.8477476000.0-
1.8555478000.0004-
1.8632480000.0-
1.8710482000.0-
1.8788484000.0-
1.8865486000.0-
1.8943488000.0-
1.9021490000.0004-
1.9098492000.0-
1.9176494000.0-
1.9253496000.0004-
1.9331498000.0-
1.9409500000.0-
1.9486502000.0-
1.9564504000.0-
1.9642506000.0004-
1.9719508000.0-
1.9797510000.0-
1.9875512000.0-
1.9952514000.0004-
2.051524-0.0001
2.0030516000.0-
2.0107518000.0-
2.0185520000.0-
2.0262522000.0-
2.0340524000.0004-
2.0418526000.0004-
2.0495528000.0-
2.0573530000.0008-
2.0651532000.0-
2.0728534000.0-
2.0806536000.0-
2.0883538000.0-
2.0961540000.0-
2.1039542000.0-
2.1116544000.0-
2.1194546000.0-
2.1272548000.0-
2.1349550000.0-
2.1427552000.0-
2.1505554000.0-
2.1582556000.0-
2.1660558000.0-
2.1737560000.0-
2.1815562000.0-
2.1893564000.0-
2.1970566000.0-
2.2048568000.0-
2.2126570000.0-
2.2203572000.0-
2.2281574000.0-
2.2359576000.0-
2.2436578000.0-
2.2514580000.0004-
2.2591582000.0-
2.2669584000.0004-
2.2747586000.0-
2.2824588000.0-
2.2902590000.0-
2.2980592000.0-
2.3057594000.0-
2.3135596000.0-
2.3213598000.0004-
2.3290600000.0-
2.3368602000.0004-
2.3445604000.0-
2.3523606000.0-
2.3601608000.0-
2.3678610000.0-
2.3756612000.0-
2.3834614000.0-
2.3911616000.0-
2.3989618000.0-
2.4067620000.0005-
2.4144622000.0-
2.4222624000.0-
2.4299626000.0-
2.4377628000.0-
2.4455630000.0-
2.4532632000.0-
2.4610634000.0-
2.4688636000.0-
2.4765638000.0-
2.4843640000.0-
2.4921642000.0-
2.4998644000.0-
2.5076646000.0-
2.5153648000.0-
2.5231650000.0-
2.5309652000.0-
2.5386654000.0-
2.5464656000.0004-
2.5542658000.0-
2.5619660000.0-
2.5697662000.0-
2.5775664000.0-
2.5852666000.0-
2.5930668000.0-
2.6007670000.0-
2.6085672000.0-
2.6163674000.0-
2.6240676000.0-
2.6318678000.0-
2.6396680000.0-
2.6473682000.0-
2.6551684000.0-
2.6629686000.0-
2.6706688000.0004-
2.6784690000.0-
2.6861692000.0-
2.6939694000.0-
2.7017696000.0004-
2.7094698000.0004-
2.7172700000.0-
2.7250702000.0-
2.7327704000.0-
2.7405706000.0-
2.7483708000.0-
2.7560710000.0004-
2.7638712000.0-
2.7715714000.0-
2.7793716000.0-
2.7871718000.0-
2.7948720000.0-
2.8026722000.0-
2.8104724000.0-
2.8181726000.0-
2.8259728000.0-
2.8337730000.0004-
2.8414732000.0-
2.8492734000.0-
2.8569736000.0-
2.8647738000.0004-
2.8725740000.0-
2.8802742000.0-
2.8880744000.0-
2.8958746000.0-
2.9035748000.0-
2.9113750000.0-
2.9191752000.0-
2.9268754000.0004-
2.9346756000.0-
2.9423758000.0-
2.9501760000.0-
2.9579762000.0-
2.9656764000.0-
2.9734766000.0004-
2.9812768000.0-
2.9889770000.0-
2.9967772000.0-
3.077286-0.0000

</details>

Framework Versions

  • Python: 3.11.11
  • Sentence Transformers: 3.3.1
  • Transformers: 4.48.0
  • PyTorch: 2.5.1+cu121
  • Accelerate: 1.2.1
  • Datasets: 3.2.0
  • Tokenizers: 0.21.0

Citation

BibTeX

ModernBERT
bibtex
@misc{warner2024smarterbetterfasterlonger,
      title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference}, 
      author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
      year={2024},
      eprint={2412.13663},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.13663}, 
}
Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->