benjamintli commited on
Commit
335bb1d
·
verified ·
1 Parent(s): d03afcf

End of training

Browse files
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,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:193623
9
+ - loss:CachedMultipleNegativesRankingLoss
10
+ base_model: answerdotai/ModernBERT-base
11
+ widget:
12
+ - source_sentence: "@Override\n public void encode(final OtpOutputStream buf) {\n\
13
+ \ final int arity = elems.length;\n\n buf.write_tuple_head(arity);\n\
14
+ \n for (int i = 0; i < arity; i++) {\n buf.write_any(elems[i]);\n\
15
+ \ }\n }"
16
+ sentences:
17
+ - fetch function with the same interface than in cozy-client-js
18
+ - 'Convert this tuple to the equivalent Erlang external representation.
19
+
20
+
21
+ @param buf
22
+
23
+ an output stream to which the encoded tuple should be written.'
24
+ - 'Delete a customer by it''s id.
25
+
26
+
27
+ @param int $id The id
28
+
29
+
30
+ @return bool
31
+
32
+ @throws \Throwable in case something went wrong when deleting.'
33
+ - source_sentence: "func (md *RootMetadata) KeyGenerationsToUpdate() (kbfsmd.KeyGen,\
34
+ \ kbfsmd.KeyGen) {\n\treturn md.bareMd.KeyGenerationsToUpdate()\n}"
35
+ sentences:
36
+ - 'Return a mapping of table to alias for the primary table and joins.
37
+
38
+
39
+ @return array'
40
+ - // KeyGenerationsToUpdate wraps the respective method of the underlying BareRootMetadata
41
+ for convenience.
42
+ - " Platform.valueOf(platformName);\n DesiredCapabilities desiredCapabilities\
43
+ \ = new DesiredCapabilities(browser, version, platform);\n desiredCapabilities.setVersion(version);\n\
44
+ \ return createAndSetRemoteDriver(url, desiredCapabilities);\n }"
45
+ - source_sentence: "func (f *fsClient) GetAccess() (access string, policyJSON string,\
46
+ \ err *probe.Error) {\n\t// For windows this feature is not implemented.\n\tif\
47
+ \ runtime.GOOS == \"windows\" {\n\t\treturn \"\", \"\", probe.NewError(APINotImplemented{API:\
48
+ \ \"GetAccess\", APIType: \"filesystem\"})\n\t}\n\tst, err := f.fsStat(false)\n\
49
+ \tif err != nil {\n"
50
+ sentences:
51
+ - "\t\treturn \"\", \"\", err.Trace(f.PathURL.String())\n\t}\n\tif !st.Mode().IsDir()\
52
+ \ {\n\t\treturn \"\", \"\", probe.NewError(APINotImplemented{API: \"GetAccess\"\
53
+ , APIType: \"filesystem\"})\n\t}\n\t// Mask with os.ModePerm to get only inode\
54
+ \ permissions\n\tswitch st.Mode() & os.ModePerm {\n\tcase os.FileMode(0777):\n\
55
+ \t\treturn \"readwrite\", \"\", nil\n\tcase os.FileMode(0555):\n\t\treturn \"\
56
+ readonly\", \"\", nil\n\tcase os.FileMode(0333):\n\t\treturn \"writeonly\", \"\
57
+ \", nil\n\t}\n\treturn \"none\", \"\", nil\n}"
58
+ - // DeleteOperator deletes the specified operator.
59
+ - " foreach ($files as $storedfile) {\n $fs->import_external_file($storedfile);\n\
60
+ \ }\n }"
61
+ - source_sentence: "def close_database_session(session):\n \"\"\"Close connection\
62
+ \ with the database\"\"\"\n\n try:\n session.close()\n except OperationalError\
63
+ \ as e:\n raise DatabaseError(error=e.orig.args[1], code=e.orig.args[0])"
64
+ sentences:
65
+ - " if (is_array($this->data)) {\n $this->data[$attributeKey]\
66
+ \ = is_callable($attributeValue) ? $attributeValue($this->rawData) : $attributeValue;\n\
67
+ \ } else {\n $this->data->$attributeKey = is_callable($attributeValue)\
68
+ \ ? $attributeValue($this->rawData) : $attributeValue;\n }\n \
69
+ \ }\n return $this;\n }\n\n if (is_array($this->data))\
70
+ \ {\n $this->data[$name] = is_callable($value) ? $value($this->rawData)\
71
+ \ : $value;\n } else {\n $this->data->$name = is_callable($value)\
72
+ \ ? $value($this->rawData) : $value;\n }\n\n return $this;\n \
73
+ \ }"
74
+ - 'Waits for the timeout duration until the url responds with correct status code
75
+
76
+
77
+ @param routeUrl URL to check (usually a route one)
78
+
79
+ @param timeout Max timeout value to await for route readiness.
80
+
81
+ If not set, default timeout value is set to 5.
82
+
83
+ @param timeoutUnit TimeUnit used for timeout duration.
84
+
85
+ If not set, Minutes is used as default TimeUnit.
86
+
87
+ @param repetitions How many times in a row the route must respond successfully
88
+ to be considered available.
89
+
90
+ @param statusCodes list of status code that might return that service is up and
91
+ running.
92
+
93
+ It is used as OR, so if one returns true, then the route is considered valid.
94
+
95
+ If not set, then only 200 status code is used.'
96
+ - Close connection with the database
97
+ - source_sentence: "function onActiveEditorChanged(event, current, previous) {\n \
98
+ \ if (current && !current._codeMirror._lineFolds) {\n enableFoldingInEditor(current);\n\
99
+ \ "
100
+ sentences:
101
+ - Get playback settings such as shuffle and repeat.
102
+ - 'Save config data.
103
+
104
+
105
+ @param string $path
106
+
107
+ @param string $value
108
+
109
+ @param string $scope
110
+
111
+ @param int $scopeId
112
+
113
+
114
+ @return null'
115
+ - " }\n if (previous) {\n saveLineFolds(previous);\n \
116
+ \ }\n }"
117
+ datasets:
118
+ - benjamintli/code-retrieval-combined
119
+ pipeline_tag: sentence-similarity
120
+ library_name: sentence-transformers
121
+ metrics:
122
+ - cosine_accuracy@1
123
+ - cosine_accuracy@3
124
+ - cosine_accuracy@5
125
+ - cosine_accuracy@10
126
+ - cosine_precision@1
127
+ - cosine_precision@3
128
+ - cosine_precision@5
129
+ - cosine_precision@10
130
+ - cosine_recall@1
131
+ - cosine_recall@3
132
+ - cosine_recall@5
133
+ - cosine_recall@10
134
+ - cosine_ndcg@10
135
+ - cosine_mrr@10
136
+ - cosine_map@100
137
+ model-index:
138
+ - name: SentenceTransformer based on answerdotai/ModernBERT-base
139
+ results:
140
+ - task:
141
+ type: information-retrieval
142
+ name: Information Retrieval
143
+ dataset:
144
+ name: eval
145
+ type: eval
146
+ metrics:
147
+ - type: cosine_accuracy@1
148
+ value: 0.9167054011341452
149
+ name: Cosine Accuracy@1
150
+ - type: cosine_accuracy@3
151
+ value: 0.9643023147717765
152
+ name: Cosine Accuracy@3
153
+ - type: cosine_accuracy@5
154
+ value: 0.9737845124105233
155
+ name: Cosine Accuracy@5
156
+ - type: cosine_accuracy@10
157
+ value: 0.9822441201078368
158
+ name: Cosine Accuracy@10
159
+ - type: cosine_precision@1
160
+ value: 0.9167054011341452
161
+ name: Cosine Precision@1
162
+ - type: cosine_precision@3
163
+ value: 0.32143410492392543
164
+ name: Cosine Precision@3
165
+ - type: cosine_precision@5
166
+ value: 0.19475690248210473
167
+ name: Cosine Precision@5
168
+ - type: cosine_precision@10
169
+ value: 0.09822441201078369
170
+ name: Cosine Precision@10
171
+ - type: cosine_recall@1
172
+ value: 0.9167054011341452
173
+ name: Cosine Recall@1
174
+ - type: cosine_recall@3
175
+ value: 0.9643023147717765
176
+ name: Cosine Recall@3
177
+ - type: cosine_recall@5
178
+ value: 0.9737845124105233
179
+ name: Cosine Recall@5
180
+ - type: cosine_recall@10
181
+ value: 0.9822441201078368
182
+ name: Cosine Recall@10
183
+ - type: cosine_ndcg@10
184
+ value: 0.9519116805931805
185
+ name: Cosine Ndcg@10
186
+ - type: cosine_mrr@10
187
+ value: 0.9419304852801657
188
+ name: Cosine Mrr@10
189
+ - type: cosine_map@100
190
+ value: 0.9425514042279245
191
+ name: Cosine Map@100
192
+ ---
193
+
194
+ # SentenceTransformer based on answerdotai/ModernBERT-base
195
+
196
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [code-retrieval-combined](https://huggingface.co/datasets/benjamintli/code-retrieval-combined) 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.
197
+
198
+ ## Model Details
199
+
200
+ ### Model Description
201
+ - **Model Type:** Sentence Transformer
202
+ - **Base model:** [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
203
+ - **Maximum Sequence Length:** 1024 tokens
204
+ - **Output Dimensionality:** 768 dimensions
205
+ - **Similarity Function:** Cosine Similarity
206
+ - **Training Dataset:**
207
+ - [code-retrieval-combined](https://huggingface.co/datasets/benjamintli/code-retrieval-combined)
208
+ <!-- - **Language:** Unknown -->
209
+ <!-- - **License:** Unknown -->
210
+
211
+ ### Model Sources
212
+
213
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
214
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
215
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
216
+
217
+ ### Full Model Architecture
218
+
219
+ ```
220
+ SentenceTransformer(
221
+ (0): Transformer({'max_seq_length': 1024, 'do_lower_case': False, 'architecture': 'OptimizedModule'})
222
+ (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})
223
+ )
224
+ ```
225
+
226
+ ## Usage
227
+
228
+ ### Direct Usage (Sentence Transformers)
229
+
230
+ First install the Sentence Transformers library:
231
+
232
+ ```bash
233
+ pip install -U sentence-transformers
234
+ ```
235
+
236
+ Then you can load this model and run inference.
237
+ ```python
238
+ from sentence_transformers import SentenceTransformer
239
+
240
+ # Download from the 🤗 Hub
241
+ model = SentenceTransformer("modernbert-code")
242
+ # Run inference
243
+ queries = [
244
+ "function onActiveEditorChanged(event, current, previous) {\n if (current \u0026\u0026 !current._codeMirror._lineFolds) {\n enableFoldingInEditor(current);\n ",
245
+ ]
246
+ documents = [
247
+ ' }\n if (previous) {\n saveLineFolds(previous);\n }\n }',
248
+ 'Save config data.\n\n@param string $path\n@param string $value\n@param string $scope\n@param int $scopeId\n\n@return null',
249
+ 'Get playback settings such as shuffle and repeat.',
250
+ ]
251
+ query_embeddings = model.encode_query(queries)
252
+ document_embeddings = model.encode_document(documents)
253
+ print(query_embeddings.shape, document_embeddings.shape)
254
+ # [1, 768] [3, 768]
255
+
256
+ # Get the similarity scores for the embeddings
257
+ similarities = model.similarity(query_embeddings, document_embeddings)
258
+ print(similarities)
259
+ # tensor([[0.6443, 0.0381, 0.0291]])
260
+ ```
261
+
262
+ <!--
263
+ ### Direct Usage (Transformers)
264
+
265
+ <details><summary>Click to see the direct usage in Transformers</summary>
266
+
267
+ </details>
268
+ -->
269
+
270
+ <!--
271
+ ### Downstream Usage (Sentence Transformers)
272
+
273
+ You can finetune this model on your own dataset.
274
+
275
+ <details><summary>Click to expand</summary>
276
+
277
+ </details>
278
+ -->
279
+
280
+ <!--
281
+ ### Out-of-Scope Use
282
+
283
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
284
+ -->
285
+
286
+ ## Evaluation
287
+
288
+ ### Metrics
289
+
290
+ #### Information Retrieval
291
+
292
+ * Dataset: `eval`
293
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
294
+
295
+ | Metric | Value |
296
+ |:--------------------|:-----------|
297
+ | cosine_accuracy@1 | 0.9167 |
298
+ | cosine_accuracy@3 | 0.9643 |
299
+ | cosine_accuracy@5 | 0.9738 |
300
+ | cosine_accuracy@10 | 0.9822 |
301
+ | cosine_precision@1 | 0.9167 |
302
+ | cosine_precision@3 | 0.3214 |
303
+ | cosine_precision@5 | 0.1948 |
304
+ | cosine_precision@10 | 0.0982 |
305
+ | cosine_recall@1 | 0.9167 |
306
+ | cosine_recall@3 | 0.9643 |
307
+ | cosine_recall@5 | 0.9738 |
308
+ | cosine_recall@10 | 0.9822 |
309
+ | **cosine_ndcg@10** | **0.9519** |
310
+ | cosine_mrr@10 | 0.9419 |
311
+ | cosine_map@100 | 0.9426 |
312
+
313
+ <!--
314
+ ## Bias, Risks and Limitations
315
+
316
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
317
+ -->
318
+
319
+ <!--
320
+ ### Recommendations
321
+
322
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
323
+ -->
324
+
325
+ ## Training Details
326
+
327
+ ### Training Dataset
328
+
329
+ #### code-retrieval-combined
330
+
331
+ * Dataset: [code-retrieval-combined](https://huggingface.co/datasets/benjamintli/code-retrieval-combined) at [4403b52](https://huggingface.co/datasets/benjamintli/code-retrieval-combined/tree/4403b525f5962df8374b128e0863482e07cb1dc9)
332
+ * Size: 193,623 training samples
333
+ * Columns: <code>query</code> and <code>positive</code>
334
+ * Approximate statistics based on the first 1000 samples:
335
+ | | query | positive |
336
+ |:--------|:-------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
337
+ | type | string | string |
338
+ | details | <ul><li>min: 6 tokens</li><li>mean: 143.24 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 64.75 tokens</li><li>max: 937 tokens</li></ul> |
339
+ * Samples:
340
+ | query | positive |
341
+ |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------|
342
+ | <code>protected function sendMusicMsgToJsonString(WxSendMusicMsg $msg)<br> {<br> $formatStr = '{<br> "touser":"%s",<br> "msgtype":"%s",<br> "music":<br> {<br> "title":"%s",<br> "description":"%s",<br> "musicurl":"%s",<br> "hqmusicurl":"%s",<br> "thumb_media_id":"%s"<br> }<br> }';<br> $result = sprintf($formatStr, $msg->getToUserName(),<br> $msg->getMsgType(),<br> $msg->getTitle(),<br> $msg->getDescription(),<br> $msg->getMusicUrl(),<br> $msg->getHQMusicUrl(),<br> $msg->getThumbMediaId()<br> );<br><br> return $result;<br> }</code> | <code>formatter WxSendMusicMsg to Json string<br>@param WxSendMusicMsg $msg<br>@return string</code> |
343
+ | <code>def getBlocks(self):<br> """<br> Get the blocks that need to be migrated<br> """<br> try:<br> conn = self.dbi.connection()<br> result =</code> | <code> self.buflistblks.execute(conn)<br> return result<br> finally:<br> if conn:<br> conn.close()</code> |
344
+ | <code>function obj(/*key,value, key,value ...*/) {<br> var result = {}<br> for(var n=0; n<arguments.length; n+=2) {<br> result[arguments[n]] = arguments[n+1]<br> }<br> return result<br>}</code> | <code>builds an object immediate where keys can be expressions</code> |
345
+ * Loss: [<code>CachedMultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
346
+ ```json
347
+ {
348
+ "scale": 20.0,
349
+ "similarity_fct": "cos_sim",
350
+ "mini_batch_size": 128,
351
+ "gather_across_devices": false,
352
+ "directions": [
353
+ "query_to_doc"
354
+ ],
355
+ "partition_mode": "joint",
356
+ "hardness_mode": null,
357
+ "hardness_strength": 0.0
358
+ }
359
+ ```
360
+
361
+ ### Evaluation Dataset
362
+
363
+ #### code-retrieval-combined
364
+
365
+ * Dataset: [code-retrieval-combined](https://huggingface.co/datasets/benjamintli/code-retrieval-combined) at [4403b52](https://huggingface.co/datasets/benjamintli/code-retrieval-combined/tree/4403b525f5962df8374b128e0863482e07cb1dc9)
366
+ * Size: 21,514 evaluation samples
367
+ * Columns: <code>query</code> and <code>positive</code>
368
+ * Approximate statistics based on the first 1000 samples:
369
+ | | query | positive |
370
+ |:--------|:-------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
371
+ | type | string | string |
372
+ | details | <ul><li>min: 7 tokens</li><li>mean: 140.91 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 71.36 tokens</li><li>max: 1024 tokens</li></ul> |
373
+ * Samples:
374
+ | query | positive |
375
+ |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
376
+ | <code>def save<br> self.attributes.stringify_keys!<br> self.attributes.delete('customer')<br> self.attributes.delete('product')<br> self.attributes.delete('credit_card')<br> self.attributes.delete('bank_account')<br> self.attributes.delete('paypal_account')<br><br> </code> | <code> self.attributes, options = extract_uniqueness_token(attributes)<br> self.prefix_options.merge!(options)<br> super<br> end</code> |
377
+ | <code>def _update_summary(self, summary=None):<br> """Update all parts of the summary or clear when no summary."""<br> board_image_label = self._parts['board image label']<br> # get content for update or use blanks when no summary<br> if summary:<br> # make a board image with the swap drawn on it<br> # board, action, text = summary.board, summary.action, summary.text<br> board_image_cv = self._create_board_image_cv(summary.board)<br> self._draw_swap_cv(board_image_cv, summary.action)<br> board_image_tk = self._convert_cv_to_tk(board_image_cv)<br> text = ''<br> if not summary.score is None:<br> text += 'Score: {:3.1f}'.format(summary.score)<br> if (not summary.mana_drain_leaves is None) and\<br> (not summary.total_leaves is None):<br> text += ' Mana Drains: {}/{}' \<br> ''.format(summary.mana_drain_leaves,<br> </code> | <code> summary.total_leaves)<br> else:<br> #clear any stored state image and use the blank<br> board_image_tk = board_image_label._blank_image<br> text = ''<br> # update the UI parts with the content<br> board_image_label._board_image = board_image_tk<br> board_image_label.config(image=board_image_tk)<br> # update the summary text<br> summary_label = self._parts['summary label']<br> summary_label.config(text=text)<br> # refresh the UI<br> self._base.update()</code> |
378
+ | <code>def chi_p(mass1, mass2, spin1x, spin1y, spin2x, spin2y):<br> """Returns the effective precession spin from mass1, mass2, spin1x,<br> spin1y, spin2x, and spin2y.<br> """<br> xi1 = secondary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y)<br> xi2 = primary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y)<br> return chi_p_from_xi1_xi2(xi1, xi2)</code> | <code>Returns the effective precession spin from mass1, mass2, spin1x,<br> spin1y, spin2x, and spin2y.</code> |
379
+ * Loss: [<code>CachedMultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
380
+ ```json
381
+ {
382
+ "scale": 20.0,
383
+ "similarity_fct": "cos_sim",
384
+ "mini_batch_size": 128,
385
+ "gather_across_devices": false,
386
+ "directions": [
387
+ "query_to_doc"
388
+ ],
389
+ "partition_mode": "joint",
390
+ "hardness_mode": null,
391
+ "hardness_strength": 0.0
392
+ }
393
+ ```
394
+
395
+ ### Training Hyperparameters
396
+ #### Non-Default Hyperparameters
397
+
398
+ - `per_device_train_batch_size`: 1024
399
+ - `num_train_epochs`: 1
400
+ - `learning_rate`: 8e-05
401
+ - `warmup_steps`: 0.05
402
+ - `bf16`: True
403
+ - `eval_strategy`: steps
404
+ - `per_device_eval_batch_size`: 1024
405
+ - `push_to_hub`: True
406
+ - `hub_model_id`: modernbert-code
407
+ - `load_best_model_at_end`: True
408
+ - `dataloader_num_workers`: 4
409
+ - `batch_sampler`: no_duplicates
410
+
411
+ #### All Hyperparameters
412
+ <details><summary>Click to expand</summary>
413
+
414
+ - `per_device_train_batch_size`: 1024
415
+ - `num_train_epochs`: 1
416
+ - `max_steps`: -1
417
+ - `learning_rate`: 8e-05
418
+ - `lr_scheduler_type`: linear
419
+ - `lr_scheduler_kwargs`: None
420
+ - `warmup_steps`: 0.05
421
+ - `optim`: adamw_torch_fused
422
+ - `optim_args`: None
423
+ - `weight_decay`: 0.0
424
+ - `adam_beta1`: 0.9
425
+ - `adam_beta2`: 0.999
426
+ - `adam_epsilon`: 1e-08
427
+ - `optim_target_modules`: None
428
+ - `gradient_accumulation_steps`: 1
429
+ - `average_tokens_across_devices`: True
430
+ - `max_grad_norm`: 1.0
431
+ - `label_smoothing_factor`: 0.0
432
+ - `bf16`: True
433
+ - `fp16`: False
434
+ - `bf16_full_eval`: False
435
+ - `fp16_full_eval`: False
436
+ - `tf32`: None
437
+ - `gradient_checkpointing`: False
438
+ - `gradient_checkpointing_kwargs`: None
439
+ - `torch_compile`: False
440
+ - `torch_compile_backend`: None
441
+ - `torch_compile_mode`: None
442
+ - `use_liger_kernel`: False
443
+ - `liger_kernel_config`: None
444
+ - `use_cache`: False
445
+ - `neftune_noise_alpha`: None
446
+ - `torch_empty_cache_steps`: None
447
+ - `auto_find_batch_size`: False
448
+ - `log_on_each_node`: True
449
+ - `logging_nan_inf_filter`: True
450
+ - `include_num_input_tokens_seen`: no
451
+ - `log_level`: passive
452
+ - `log_level_replica`: warning
453
+ - `disable_tqdm`: False
454
+ - `project`: huggingface
455
+ - `trackio_space_id`: trackio
456
+ - `eval_strategy`: steps
457
+ - `per_device_eval_batch_size`: 1024
458
+ - `prediction_loss_only`: True
459
+ - `eval_on_start`: False
460
+ - `eval_do_concat_batches`: True
461
+ - `eval_use_gather_object`: False
462
+ - `eval_accumulation_steps`: None
463
+ - `include_for_metrics`: []
464
+ - `batch_eval_metrics`: False
465
+ - `save_only_model`: False
466
+ - `save_on_each_node`: False
467
+ - `enable_jit_checkpoint`: False
468
+ - `push_to_hub`: True
469
+ - `hub_private_repo`: None
470
+ - `hub_model_id`: modernbert-code
471
+ - `hub_strategy`: every_save
472
+ - `hub_always_push`: False
473
+ - `hub_revision`: None
474
+ - `load_best_model_at_end`: True
475
+ - `ignore_data_skip`: False
476
+ - `restore_callback_states_from_checkpoint`: False
477
+ - `full_determinism`: False
478
+ - `seed`: 42
479
+ - `data_seed`: None
480
+ - `use_cpu`: False
481
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
482
+ - `parallelism_config`: None
483
+ - `dataloader_drop_last`: False
484
+ - `dataloader_num_workers`: 4
485
+ - `dataloader_pin_memory`: True
486
+ - `dataloader_persistent_workers`: False
487
+ - `dataloader_prefetch_factor`: None
488
+ - `remove_unused_columns`: True
489
+ - `label_names`: None
490
+ - `train_sampling_strategy`: random
491
+ - `length_column_name`: length
492
+ - `ddp_find_unused_parameters`: None
493
+ - `ddp_bucket_cap_mb`: None
494
+ - `ddp_broadcast_buffers`: False
495
+ - `ddp_backend`: None
496
+ - `ddp_timeout`: 1800
497
+ - `fsdp`: []
498
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
499
+ - `deepspeed`: None
500
+ - `debug`: []
501
+ - `skip_memory_metrics`: True
502
+ - `do_predict`: False
503
+ - `resume_from_checkpoint`: None
504
+ - `warmup_ratio`: None
505
+ - `local_rank`: -1
506
+ - `prompts`: None
507
+ - `batch_sampler`: no_duplicates
508
+ - `multi_dataset_batch_sampler`: proportional
509
+ - `router_mapping`: {}
510
+ - `learning_rate_mapping`: {}
511
+
512
+ </details>
513
+
514
+ ### Training Logs
515
+ | Epoch | Step | Training Loss | Validation Loss | eval_cosine_ndcg@10 |
516
+ |:-------:|:-------:|:-------------:|:---------------:|:-------------------:|
517
+ | 0.0526 | 10 | 5.2457 | 2.4469 | 0.4195 |
518
+ | 0.1053 | 20 | 1.3973 | 0.6956 | 0.7742 |
519
+ | 0.1579 | 30 | 0.5500 | 0.4000 | 0.8560 |
520
+ | 0.2105 | 40 | 0.3429 | 0.2878 | 0.8891 |
521
+ | 0.2632 | 50 | 0.2487 | 0.2250 | 0.9104 |
522
+ | 0.3158 | 60 | 0.2080 | 0.1872 | 0.9256 |
523
+ | 0.3684 | 70 | 0.1768 | 0.1656 | 0.9312 |
524
+ | 0.4211 | 80 | 0.1525 | 0.1501 | 0.9352 |
525
+ | 0.4737 | 90 | 0.1402 | 0.1374 | 0.9397 |
526
+ | 0.5263 | 100 | 0.1343 | 0.1317 | 0.9413 |
527
+ | 0.5789 | 110 | 0.1217 | 0.1242 | 0.9444 |
528
+ | 0.6316 | 120 | 0.1180 | 0.1199 | 0.9454 |
529
+ | 0.6842 | 130 | 0.1164 | 0.1149 | 0.9476 |
530
+ | 0.7368 | 140 | 0.1146 | 0.1106 | 0.9494 |
531
+ | 0.7895 | 150 | 0.1091 | 0.1080 | 0.9494 |
532
+ | 0.8421 | 160 | 0.1085 | 0.1055 | 0.9506 |
533
+ | 0.8947 | 170 | 0.1062 | 0.1041 | 0.9511 |
534
+ | 0.9474 | 180 | 0.1130 | 0.1030 | 0.9517 |
535
+ | **1.0** | **190** | **0.0924** | **0.1024** | **0.9519** |
536
+
537
+ * The bold row denotes the saved checkpoint.
538
+
539
+ ### Framework Versions
540
+ - Python: 3.12.12
541
+ - Sentence Transformers: 5.3.0
542
+ - Transformers: 5.3.0
543
+ - PyTorch: 2.10.0+cu128
544
+ - Accelerate: 1.13.0
545
+ - Datasets: 4.8.3
546
+ - Tokenizers: 0.22.2
547
+
548
+ ## Citation
549
+
550
+ ### BibTeX
551
+
552
+ #### Sentence Transformers
553
+ ```bibtex
554
+ @inproceedings{reimers-2019-sentence-bert,
555
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
556
+ author = "Reimers, Nils and Gurevych, Iryna",
557
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
558
+ month = "11",
559
+ year = "2019",
560
+ publisher = "Association for Computational Linguistics",
561
+ url = "https://arxiv.org/abs/1908.10084",
562
+ }
563
+ ```
564
+
565
+ #### CachedMultipleNegativesRankingLoss
566
+ ```bibtex
567
+ @misc{gao2021scaling,
568
+ title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
569
+ author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
570
+ year={2021},
571
+ eprint={2101.06983},
572
+ archivePrefix={arXiv},
573
+ primaryClass={cs.LG}
574
+ }
575
+ ```
576
+
577
+ <!--
578
+ ## Glossary
579
+
580
+ *Clearly define terms in order to be accessible across audiences.*
581
+ -->
582
+
583
+ <!--
584
+ ## Model Card Authors
585
+
586
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
587
+ -->
588
+
589
+ <!--
590
+ ## Model Card Contact
591
+
592
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
593
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SentenceTransformer",
3
+ "__version__": {
4
+ "sentence_transformers": "5.3.0",
5
+ "transformers": "5.3.0",
6
+ "pytorch": "2.10.0+cu128"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
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": 1024,
3
+ "do_lower_case": false
4
+ }