Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +456 -0
- config.json +24 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +51 -0
- tokenizer.json +0 -0
- tokenizer_config.json +65 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"word_embedding_dimension": 768,
|
| 3 |
+
"pooling_mode_cls_token": false,
|
| 4 |
+
"pooling_mode_mean_tokens": true,
|
| 5 |
+
"pooling_mode_max_tokens": false,
|
| 6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
| 7 |
+
"pooling_mode_weightedmean_tokens": false,
|
| 8 |
+
"pooling_mode_lasttoken": false,
|
| 9 |
+
"include_prompt": true
|
| 10 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: sentence-transformers
|
| 6 |
+
tags:
|
| 7 |
+
- sentence-transformers
|
| 8 |
+
- sentence-similarity
|
| 9 |
+
- feature-extraction
|
| 10 |
+
- dataset_size:n<1K
|
| 11 |
+
- loss:MultipleNegativesRankingLoss
|
| 12 |
+
base_model: microsoft/mpnet-base
|
| 13 |
+
metrics:
|
| 14 |
+
- cosine_accuracy
|
| 15 |
+
- dot_accuracy
|
| 16 |
+
- manhattan_accuracy
|
| 17 |
+
- euclidean_accuracy
|
| 18 |
+
- max_accuracy
|
| 19 |
+
widget:
|
| 20 |
+
- source_sentence: Write a Python function that counts the number of even numbers
|
| 21 |
+
in a given list of integers or floats
|
| 22 |
+
sentences:
|
| 23 |
+
- Write a Python function that returns the number of even numbers in a list.
|
| 24 |
+
- Create a Python function that adds up all the numbers in a given list. The function
|
| 25 |
+
should support lists containing only positive integers.
|
| 26 |
+
- Write a Python function that converts a JSON string into a Python dictionary using
|
| 27 |
+
the json module and returns it.
|
| 28 |
+
- source_sentence: Develop a Python function to validate whether a given string represents
|
| 29 |
+
a valid IPv4 address or not.
|
| 30 |
+
sentences:
|
| 31 |
+
- Create a Python function to validate a string `s` as an IPv4 address. The function
|
| 32 |
+
should return `True` if `s` is a valid IPv4 address, and `False` otherwise.
|
| 33 |
+
- Write a Python function to find the key with the highest value in a dictionary.
|
| 34 |
+
The function should return the value of the key if it exists
|
| 35 |
+
- Write a Python function that, given a dictionary `d` and an integer `k`, returns
|
| 36 |
+
the sum of the values of the first `k` keys in `d`.
|
| 37 |
+
- source_sentence: Write a Python function to create a list of numbers with exactly
|
| 38 |
+
one even number and n-1 odd numbers
|
| 39 |
+
sentences:
|
| 40 |
+
- Write a Python function that returns the number of even numbers in a list.
|
| 41 |
+
- Write a Python function that recursively traverses a given folder structure and
|
| 42 |
+
returns the absolute path of all files that end with ".txt".
|
| 43 |
+
- Write a Python decorator function that overrides the docstring of the decorated
|
| 44 |
+
function, and stores the old docstring and other metadata in a `_doc_metadata`
|
| 45 |
+
attribute of the function.
|
| 46 |
+
- source_sentence: 'Implement a Python function that prints the first character of
|
| 47 |
+
a string using its indexing feature. '
|
| 48 |
+
sentences:
|
| 49 |
+
- Write a Python function that takes a string as a parameter and returns the first
|
| 50 |
+
character of the string.
|
| 51 |
+
- Write a Python function that checks if the bit at position `bit` is set in the
|
| 52 |
+
given `integer`. This function should return a boolean value.
|
| 53 |
+
- 'Write a Python function `floor_division(x: int, y: int) -> int` that divides
|
| 54 |
+
two integers `x` and `y` and returns the largest whole number less than or equal
|
| 55 |
+
to the result.'
|
| 56 |
+
- source_sentence: Write a Python function that takes a MIDI note number and returns
|
| 57 |
+
the corresponding piano key number.
|
| 58 |
+
sentences:
|
| 59 |
+
- Create a Python function that translates MIDI note numbers into piano key numbers,
|
| 60 |
+
facilitating music generation.
|
| 61 |
+
- Write a Python function that accepts a dictionary and returns a set of distinct
|
| 62 |
+
values. If a key maps to an empty list, return an empty set.
|
| 63 |
+
- Write a Python function `join_strings_with_comma(lst)` that takes a list of strings
|
| 64 |
+
and returns a single string with all the strings from the list, separated by commas.
|
| 65 |
+
pipeline_tag: sentence-similarity
|
| 66 |
+
co2_eq_emissions:
|
| 67 |
+
emissions: 2.213004168952992
|
| 68 |
+
energy_consumed: 0.006336878829164133
|
| 69 |
+
source: codecarbon
|
| 70 |
+
training_type: fine-tuning
|
| 71 |
+
on_cloud: false
|
| 72 |
+
cpu_model: Intel(R) Xeon(R) CPU @ 2.20GHz
|
| 73 |
+
ram_total_size: 62.804237365722656
|
| 74 |
+
hours_used: 0.049
|
| 75 |
+
hardware_used: 1 x NVIDIA L4
|
| 76 |
+
model-index:
|
| 77 |
+
- name: MPNet base trained on AllNLI triplets
|
| 78 |
+
results:
|
| 79 |
+
- task:
|
| 80 |
+
type: triplet
|
| 81 |
+
name: Triplet
|
| 82 |
+
dataset:
|
| 83 |
+
name: code similarity dev
|
| 84 |
+
type: code-similarity-dev
|
| 85 |
+
metrics:
|
| 86 |
+
- type: cosine_accuracy
|
| 87 |
+
value: 0.934010152284264
|
| 88 |
+
name: Cosine Accuracy
|
| 89 |
+
- type: dot_accuracy
|
| 90 |
+
value: 0.07106598984771574
|
| 91 |
+
name: Dot Accuracy
|
| 92 |
+
- type: manhattan_accuracy
|
| 93 |
+
value: 0.934010152284264
|
| 94 |
+
name: Manhattan Accuracy
|
| 95 |
+
- type: euclidean_accuracy
|
| 96 |
+
value: 0.9390862944162437
|
| 97 |
+
name: Euclidean Accuracy
|
| 98 |
+
- type: max_accuracy
|
| 99 |
+
value: 0.9390862944162437
|
| 100 |
+
name: Max Accuracy
|
| 101 |
+
- task:
|
| 102 |
+
type: triplet
|
| 103 |
+
name: Triplet
|
| 104 |
+
dataset:
|
| 105 |
+
name: Unknown
|
| 106 |
+
type: unknown
|
| 107 |
+
metrics:
|
| 108 |
+
- type: cosine_accuracy
|
| 109 |
+
value: 0.934010152284264
|
| 110 |
+
name: Cosine Accuracy
|
| 111 |
+
- type: dot_accuracy
|
| 112 |
+
value: 0.07106598984771574
|
| 113 |
+
name: Dot Accuracy
|
| 114 |
+
- type: manhattan_accuracy
|
| 115 |
+
value: 0.934010152284264
|
| 116 |
+
name: Manhattan Accuracy
|
| 117 |
+
- type: euclidean_accuracy
|
| 118 |
+
value: 0.9390862944162437
|
| 119 |
+
name: Euclidean Accuracy
|
| 120 |
+
- type: max_accuracy
|
| 121 |
+
value: 0.9390862944162437
|
| 122 |
+
name: Max Accuracy
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
# MPNet base trained on AllNLI triplets
|
| 126 |
+
|
| 127 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base). 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.
|
| 128 |
+
|
| 129 |
+
## Model Details
|
| 130 |
+
|
| 131 |
+
### Model Description
|
| 132 |
+
- **Model Type:** Sentence Transformer
|
| 133 |
+
- **Base model:** [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) <!-- at revision 6996ce1e91bd2a9c7d7f61daec37463394f73f09 -->
|
| 134 |
+
- **Maximum Sequence Length:** 512 tokens
|
| 135 |
+
- **Output Dimensionality:** 768 tokens
|
| 136 |
+
- **Similarity Function:** Cosine Similarity
|
| 137 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 138 |
+
- **Language:** en
|
| 139 |
+
- **License:** apache-2.0
|
| 140 |
+
|
| 141 |
+
### Model Sources
|
| 142 |
+
|
| 143 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 144 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 145 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 146 |
+
|
| 147 |
+
### Full Model Architecture
|
| 148 |
+
|
| 149 |
+
```
|
| 150 |
+
SentenceTransformer(
|
| 151 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: MPNetModel
|
| 152 |
+
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
| 153 |
+
)
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
## Usage
|
| 157 |
+
|
| 158 |
+
### Direct Usage (Sentence Transformers)
|
| 159 |
+
|
| 160 |
+
First install the Sentence Transformers library:
|
| 161 |
+
|
| 162 |
+
```bash
|
| 163 |
+
pip install -U sentence-transformers
|
| 164 |
+
```
|
| 165 |
+
|
| 166 |
+
Then you can load this model and run inference.
|
| 167 |
+
```python
|
| 168 |
+
from sentence_transformers import SentenceTransformer
|
| 169 |
+
|
| 170 |
+
# Download from the 🤗 Hub
|
| 171 |
+
model = SentenceTransformer("davanstrien/code-prompt-similarity-model")
|
| 172 |
+
# Run inference
|
| 173 |
+
sentences = [
|
| 174 |
+
'Write a Python function that takes a MIDI note number and returns the corresponding piano key number.',
|
| 175 |
+
'Create a Python function that translates MIDI note numbers into piano key numbers, facilitating music generation.',
|
| 176 |
+
'Write a Python function that accepts a dictionary and returns a set of distinct values. If a key maps to an empty list, return an empty set.',
|
| 177 |
+
]
|
| 178 |
+
embeddings = model.encode(sentences)
|
| 179 |
+
print(embeddings.shape)
|
| 180 |
+
# [3, 768]
|
| 181 |
+
|
| 182 |
+
# Get the similarity scores for the embeddings
|
| 183 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 184 |
+
print(similarities.shape)
|
| 185 |
+
# [3, 3]
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
<!--
|
| 189 |
+
### Direct Usage (Transformers)
|
| 190 |
+
|
| 191 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 192 |
+
|
| 193 |
+
</details>
|
| 194 |
+
-->
|
| 195 |
+
|
| 196 |
+
<!--
|
| 197 |
+
### Downstream Usage (Sentence Transformers)
|
| 198 |
+
|
| 199 |
+
You can finetune this model on your own dataset.
|
| 200 |
+
|
| 201 |
+
<details><summary>Click to expand</summary>
|
| 202 |
+
|
| 203 |
+
</details>
|
| 204 |
+
-->
|
| 205 |
+
|
| 206 |
+
<!--
|
| 207 |
+
### Out-of-Scope Use
|
| 208 |
+
|
| 209 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 210 |
+
-->
|
| 211 |
+
|
| 212 |
+
## Evaluation
|
| 213 |
+
|
| 214 |
+
### Metrics
|
| 215 |
+
|
| 216 |
+
#### Triplet
|
| 217 |
+
* Dataset: `code-similarity-dev`
|
| 218 |
+
* Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
|
| 219 |
+
|
| 220 |
+
| Metric | Value |
|
| 221 |
+
|:-------------------|:-----------|
|
| 222 |
+
| cosine_accuracy | 0.934 |
|
| 223 |
+
| dot_accuracy | 0.0711 |
|
| 224 |
+
| manhattan_accuracy | 0.934 |
|
| 225 |
+
| euclidean_accuracy | 0.9391 |
|
| 226 |
+
| **max_accuracy** | **0.9391** |
|
| 227 |
+
|
| 228 |
+
#### Triplet
|
| 229 |
+
|
| 230 |
+
* Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
|
| 231 |
+
|
| 232 |
+
| Metric | Value |
|
| 233 |
+
|:-------------------|:-----------|
|
| 234 |
+
| cosine_accuracy | 0.934 |
|
| 235 |
+
| dot_accuracy | 0.0711 |
|
| 236 |
+
| manhattan_accuracy | 0.934 |
|
| 237 |
+
| euclidean_accuracy | 0.9391 |
|
| 238 |
+
| **max_accuracy** | **0.9391** |
|
| 239 |
+
|
| 240 |
+
<!--
|
| 241 |
+
## Bias, Risks and Limitations
|
| 242 |
+
|
| 243 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 244 |
+
-->
|
| 245 |
+
|
| 246 |
+
<!--
|
| 247 |
+
### Recommendations
|
| 248 |
+
|
| 249 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 250 |
+
-->
|
| 251 |
+
|
| 252 |
+
## Training Details
|
| 253 |
+
|
| 254 |
+
### Training Hyperparameters
|
| 255 |
+
#### Non-Default Hyperparameters
|
| 256 |
+
|
| 257 |
+
- `eval_strategy`: steps
|
| 258 |
+
- `per_device_train_batch_size`: 16
|
| 259 |
+
- `per_device_eval_batch_size`: 16
|
| 260 |
+
- `num_train_epochs`: 10
|
| 261 |
+
- `warmup_ratio`: 0.1
|
| 262 |
+
- `bf16`: True
|
| 263 |
+
- `batch_sampler`: no_duplicates
|
| 264 |
+
|
| 265 |
+
#### All Hyperparameters
|
| 266 |
+
<details><summary>Click to expand</summary>
|
| 267 |
+
|
| 268 |
+
- `overwrite_output_dir`: False
|
| 269 |
+
- `do_predict`: False
|
| 270 |
+
- `eval_strategy`: steps
|
| 271 |
+
- `prediction_loss_only`: True
|
| 272 |
+
- `per_device_train_batch_size`: 16
|
| 273 |
+
- `per_device_eval_batch_size`: 16
|
| 274 |
+
- `per_gpu_train_batch_size`: None
|
| 275 |
+
- `per_gpu_eval_batch_size`: None
|
| 276 |
+
- `gradient_accumulation_steps`: 1
|
| 277 |
+
- `eval_accumulation_steps`: None
|
| 278 |
+
- `learning_rate`: 5e-05
|
| 279 |
+
- `weight_decay`: 0.0
|
| 280 |
+
- `adam_beta1`: 0.9
|
| 281 |
+
- `adam_beta2`: 0.999
|
| 282 |
+
- `adam_epsilon`: 1e-08
|
| 283 |
+
- `max_grad_norm`: 1.0
|
| 284 |
+
- `num_train_epochs`: 10
|
| 285 |
+
- `max_steps`: -1
|
| 286 |
+
- `lr_scheduler_type`: linear
|
| 287 |
+
- `lr_scheduler_kwargs`: {}
|
| 288 |
+
- `warmup_ratio`: 0.1
|
| 289 |
+
- `warmup_steps`: 0
|
| 290 |
+
- `log_level`: passive
|
| 291 |
+
- `log_level_replica`: warning
|
| 292 |
+
- `log_on_each_node`: True
|
| 293 |
+
- `logging_nan_inf_filter`: True
|
| 294 |
+
- `save_safetensors`: True
|
| 295 |
+
- `save_on_each_node`: False
|
| 296 |
+
- `save_only_model`: False
|
| 297 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 298 |
+
- `no_cuda`: False
|
| 299 |
+
- `use_cpu`: False
|
| 300 |
+
- `use_mps_device`: False
|
| 301 |
+
- `seed`: 42
|
| 302 |
+
- `data_seed`: None
|
| 303 |
+
- `jit_mode_eval`: False
|
| 304 |
+
- `use_ipex`: False
|
| 305 |
+
- `bf16`: True
|
| 306 |
+
- `fp16`: False
|
| 307 |
+
- `fp16_opt_level`: O1
|
| 308 |
+
- `half_precision_backend`: auto
|
| 309 |
+
- `bf16_full_eval`: False
|
| 310 |
+
- `fp16_full_eval`: False
|
| 311 |
+
- `tf32`: None
|
| 312 |
+
- `local_rank`: 0
|
| 313 |
+
- `ddp_backend`: None
|
| 314 |
+
- `tpu_num_cores`: None
|
| 315 |
+
- `tpu_metrics_debug`: False
|
| 316 |
+
- `debug`: []
|
| 317 |
+
- `dataloader_drop_last`: False
|
| 318 |
+
- `dataloader_num_workers`: 0
|
| 319 |
+
- `dataloader_prefetch_factor`: None
|
| 320 |
+
- `past_index`: -1
|
| 321 |
+
- `disable_tqdm`: False
|
| 322 |
+
- `remove_unused_columns`: True
|
| 323 |
+
- `label_names`: None
|
| 324 |
+
- `load_best_model_at_end`: False
|
| 325 |
+
- `ignore_data_skip`: False
|
| 326 |
+
- `fsdp`: []
|
| 327 |
+
- `fsdp_min_num_params`: 0
|
| 328 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 329 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
| 330 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 331 |
+
- `deepspeed`: None
|
| 332 |
+
- `label_smoothing_factor`: 0.0
|
| 333 |
+
- `optim`: adamw_torch
|
| 334 |
+
- `optim_args`: None
|
| 335 |
+
- `adafactor`: False
|
| 336 |
+
- `group_by_length`: False
|
| 337 |
+
- `length_column_name`: length
|
| 338 |
+
- `ddp_find_unused_parameters`: None
|
| 339 |
+
- `ddp_bucket_cap_mb`: None
|
| 340 |
+
- `ddp_broadcast_buffers`: False
|
| 341 |
+
- `dataloader_pin_memory`: True
|
| 342 |
+
- `dataloader_persistent_workers`: False
|
| 343 |
+
- `skip_memory_metrics`: True
|
| 344 |
+
- `use_legacy_prediction_loop`: False
|
| 345 |
+
- `push_to_hub`: False
|
| 346 |
+
- `resume_from_checkpoint`: None
|
| 347 |
+
- `hub_model_id`: None
|
| 348 |
+
- `hub_strategy`: every_save
|
| 349 |
+
- `hub_private_repo`: False
|
| 350 |
+
- `hub_always_push`: False
|
| 351 |
+
- `gradient_checkpointing`: False
|
| 352 |
+
- `gradient_checkpointing_kwargs`: None
|
| 353 |
+
- `include_inputs_for_metrics`: False
|
| 354 |
+
- `eval_do_concat_batches`: True
|
| 355 |
+
- `fp16_backend`: auto
|
| 356 |
+
- `push_to_hub_model_id`: None
|
| 357 |
+
- `push_to_hub_organization`: None
|
| 358 |
+
- `mp_parameters`:
|
| 359 |
+
- `auto_find_batch_size`: False
|
| 360 |
+
- `full_determinism`: False
|
| 361 |
+
- `torchdynamo`: None
|
| 362 |
+
- `ray_scope`: last
|
| 363 |
+
- `ddp_timeout`: 1800
|
| 364 |
+
- `torch_compile`: False
|
| 365 |
+
- `torch_compile_backend`: None
|
| 366 |
+
- `torch_compile_mode`: None
|
| 367 |
+
- `dispatch_batches`: None
|
| 368 |
+
- `split_batches`: None
|
| 369 |
+
- `include_tokens_per_second`: False
|
| 370 |
+
- `include_num_input_tokens_seen`: False
|
| 371 |
+
- `neftune_noise_alpha`: None
|
| 372 |
+
- `optim_target_modules`: None
|
| 373 |
+
- `batch_eval_metrics`: False
|
| 374 |
+
- `batch_sampler`: no_duplicates
|
| 375 |
+
- `multi_dataset_batch_sampler`: proportional
|
| 376 |
+
|
| 377 |
+
</details>
|
| 378 |
+
|
| 379 |
+
### Training Logs
|
| 380 |
+
| Epoch | Step | Training Loss | loss | code-similarity-dev_max_accuracy | max_accuracy |
|
| 381 |
+
|:-----:|:----:|:-------------:|:------:|:--------------------------------:|:------------:|
|
| 382 |
+
| 0 | 0 | - | - | 0.8680 | - |
|
| 383 |
+
| 2.0 | 100 | 0.6379 | 0.1845 | 0.9340 | - |
|
| 384 |
+
| 4.0 | 200 | 0.0399 | 0.1577 | 0.9543 | - |
|
| 385 |
+
| 6.0 | 300 | 0.0059 | 0.1577 | 0.9543 | - |
|
| 386 |
+
| 8.0 | 400 | 0.0018 | 0.1662 | 0.9492 | - |
|
| 387 |
+
| 10.0 | 500 | 0.0009 | 0.1643 | 0.9391 | 0.9391 |
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
### Environmental Impact
|
| 391 |
+
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
| 392 |
+
- **Energy Consumed**: 0.006 kWh
|
| 393 |
+
- **Carbon Emitted**: 0.002 kg of CO2
|
| 394 |
+
- **Hours Used**: 0.049 hours
|
| 395 |
+
|
| 396 |
+
### Training Hardware
|
| 397 |
+
- **On Cloud**: No
|
| 398 |
+
- **GPU Model**: 1 x NVIDIA L4
|
| 399 |
+
- **CPU Model**: Intel(R) Xeon(R) CPU @ 2.20GHz
|
| 400 |
+
- **RAM Size**: 62.80 GB
|
| 401 |
+
|
| 402 |
+
### Framework Versions
|
| 403 |
+
- Python: 3.10.12
|
| 404 |
+
- Sentence Transformers: 3.0.0
|
| 405 |
+
- Transformers: 4.41.1
|
| 406 |
+
- PyTorch: 2.3.0+cu121
|
| 407 |
+
- Accelerate: 0.30.1
|
| 408 |
+
- Datasets: 2.19.1
|
| 409 |
+
- Tokenizers: 0.19.1
|
| 410 |
+
|
| 411 |
+
## Citation
|
| 412 |
+
|
| 413 |
+
### BibTeX
|
| 414 |
+
|
| 415 |
+
#### Sentence Transformers
|
| 416 |
+
```bibtex
|
| 417 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 418 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 419 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 420 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 421 |
+
month = "11",
|
| 422 |
+
year = "2019",
|
| 423 |
+
publisher = "Association for Computational Linguistics",
|
| 424 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 425 |
+
}
|
| 426 |
+
```
|
| 427 |
+
|
| 428 |
+
#### MultipleNegativesRankingLoss
|
| 429 |
+
```bibtex
|
| 430 |
+
@misc{henderson2017efficient,
|
| 431 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
| 432 |
+
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},
|
| 433 |
+
year={2017},
|
| 434 |
+
eprint={1705.00652},
|
| 435 |
+
archivePrefix={arXiv},
|
| 436 |
+
primaryClass={cs.CL}
|
| 437 |
+
}
|
| 438 |
+
```
|
| 439 |
+
|
| 440 |
+
<!--
|
| 441 |
+
## Glossary
|
| 442 |
+
|
| 443 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 444 |
+
-->
|
| 445 |
+
|
| 446 |
+
<!--
|
| 447 |
+
## Model Card Authors
|
| 448 |
+
|
| 449 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 450 |
+
-->
|
| 451 |
+
|
| 452 |
+
<!--
|
| 453 |
+
## Model Card Contact
|
| 454 |
+
|
| 455 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 456 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "microsoft/mpnet-base",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MPNetModel"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 3072,
|
| 14 |
+
"layer_norm_eps": 1e-05,
|
| 15 |
+
"max_position_embeddings": 514,
|
| 16 |
+
"model_type": "mpnet",
|
| 17 |
+
"num_attention_heads": 12,
|
| 18 |
+
"num_hidden_layers": 12,
|
| 19 |
+
"pad_token_id": 1,
|
| 20 |
+
"relative_attention_num_buckets": 32,
|
| 21 |
+
"torch_dtype": "float32",
|
| 22 |
+
"transformers_version": "4.41.1",
|
| 23 |
+
"vocab_size": 30527
|
| 24 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"sentence_transformers": "3.0.0",
|
| 4 |
+
"transformers": "4.41.1",
|
| 5 |
+
"pytorch": "2.3.0+cu121"
|
| 6 |
+
},
|
| 7 |
+
"prompts": {},
|
| 8 |
+
"default_prompt_name": null,
|
| 9 |
+
"similarity_fn_name": null
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e6178ab98c5280f00c1d1bb782c4893cd2161c7781c99ade4b92f1816e093ab9
|
| 3 |
+
size 437967672
|
modules.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.models.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.models.Pooling"
|
| 13 |
+
}
|
| 14 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 512,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "<s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "<mask>",
|
| 25 |
+
"lstrip": true,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "<pad>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "</s>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": true,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "[UNK]",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": false,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<s>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": true,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"104": {
|
| 36 |
+
"content": "[UNK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"30526": {
|
| 44 |
+
"content": "<mask>",
|
| 45 |
+
"lstrip": true,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"bos_token": "<s>",
|
| 53 |
+
"clean_up_tokenization_spaces": true,
|
| 54 |
+
"cls_token": "<s>",
|
| 55 |
+
"do_lower_case": true,
|
| 56 |
+
"eos_token": "</s>",
|
| 57 |
+
"mask_token": "<mask>",
|
| 58 |
+
"model_max_length": 512,
|
| 59 |
+
"pad_token": "<pad>",
|
| 60 |
+
"sep_token": "</s>",
|
| 61 |
+
"strip_accents": null,
|
| 62 |
+
"tokenize_chinese_chars": true,
|
| 63 |
+
"tokenizer_class": "MPNetTokenizer",
|
| 64 |
+
"unk_token": "[UNK]"
|
| 65 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|