benjamintli commited on
Commit
ecd36c9
·
verified ·
1 Parent(s): e3280a7

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,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:8118
9
+ - loss:CachedMultipleNegativesRankingLoss
10
+ base_model: answerdotai/ModernBERT-base
11
+ widget:
12
+ - source_sentence: python create path if doesnt exist
13
+ sentences:
14
+ - "def clean_whitespace(string, compact=False):\n \"\"\"Return string with compressed\
15
+ \ whitespace.\"\"\"\n for a, b in (('\\r\\n', '\\n'), ('\\r', '\\n'), ('\\\
16
+ n\\n', '\\n'),\n ('\\t', ' '), (' ', ' ')):\n string =\
17
+ \ string.replace(a, b)\n if compact:\n for a, b in (('\\n', ' '), ('[\
18
+ \ ', '['),\n (' ', ' '), (' ', ' '), (' ', ' ')):\n \
19
+ \ string = string.replace(a, b)\n return string.strip()"
20
+ - "def rotateImage(img, angle):\n \"\"\"\n\n querries scipy.ndimage.rotate\
21
+ \ routine\n :param img: image to be rotated\n :param angle: angle to be\
22
+ \ rotated (radian)\n :return: rotated image\n \"\"\"\n imgR = scipy.ndimage.rotate(img,\
23
+ \ angle, reshape=False)\n return imgR"
24
+ - "def check_create_folder(filename):\n \"\"\"Check if the folder exisits. If\
25
+ \ not, create the folder\"\"\"\n os.makedirs(os.path.dirname(filename), exist_ok=True)"
26
+ - source_sentence: how decompiled python code looks like
27
+ sentences:
28
+ - "def xeval(source, optimize=True):\n \"\"\"Compiles to native Python bytecode\
29
+ \ and runs program, returning the\n topmost value on the stack.\n\n Args:\n\
30
+ \ optimize: Whether to optimize the code after parsing it.\n\n Returns:\n\
31
+ \ None: If the stack is empty\n obj: If the stack contains a single\
32
+ \ value\n [obj, obj, ...]: If the stack contains many values\n \"\"\"\
33
+ \n native = xcompile(source, optimize=optimize)\n return native()"
34
+ - "def html(header_rows):\n \"\"\"\n Convert a list of tuples describing a\
35
+ \ table into a HTML string\n \"\"\"\n name = 'table%d' % next(tablecounter)\n\
36
+ \ return HtmlTable([map(str, row) for row in header_rows], name).render()"
37
+ - "def cint8_array_to_numpy(cptr, length):\n \"\"\"Convert a ctypes int pointer\
38
+ \ array to a numpy array.\"\"\"\n if isinstance(cptr, ctypes.POINTER(ctypes.c_int8)):\n\
39
+ \ return np.fromiter(cptr, dtype=np.int8, count=length)\n else:\n \
40
+ \ raise RuntimeError('Expected int pointer')"
41
+ - source_sentence: python calling pytest from a python script
42
+ sentences:
43
+ - "def draw_image(self, ax, image):\n \"\"\"Process a matplotlib image object\
44
+ \ and call renderer.draw_image\"\"\"\n self.renderer.draw_image(imdata=utils.image_to_base64(image),\n\
45
+ \ extent=image.get_extent(),\n \
46
+ \ coordinates=\"data\",\n style={\"\
47
+ alpha\": image.get_alpha(),\n \"zorder\"\
48
+ : image.get_zorder()},\n mplobj=image)"
49
+ - "def test(): # pragma: no cover\n \"\"\"Execute the unit tests on an installed\
50
+ \ copy of unyt.\n\n Note that this function requires pytest to run. If pytest\
51
+ \ is not\n installed this function will raise ImportError.\n \"\"\"\n \
52
+ \ import pytest\n import os\n\n pytest.main([os.path.dirname(os.path.abspath(__file__))])"
53
+ - "def is_int(string):\n \"\"\"\n Checks if a string is an integer. If the\
54
+ \ string value is an integer\n return True, otherwise return False. \n \n\
55
+ \ Args:\n string: a string to test.\n\n Returns: \n boolean\n\
56
+ \ \"\"\"\n try:\n a = float(string)\n b = int(a)\n except\
57
+ \ ValueError:\n return False\n else:\n return a == b"
58
+ - source_sentence: python datetime get last day in a month
59
+ sentences:
60
+ - "def upgrade(directory, sql, tag, x_arg, revision):\n \"\"\"Upgrade to a later\
61
+ \ version\"\"\"\n _upgrade(directory, revision, sql, tag, x_arg)"
62
+ - "def flat_list(lst):\n \"\"\"This function flatten given nested list.\n \
63
+ \ Argument:\n nested list\n Returns:\n flat list\n \"\"\"\n\
64
+ \ if isinstance(lst, list):\n for item in lst:\n for i in\
65
+ \ flat_list(item):\n yield i\n else:\n yield lst"
66
+ - "def get_last_weekday_in_month(year, month, weekday):\n \"\"\"Get the last\
67
+ \ weekday in a given month. e.g:\n\n >>> # the last monday in Jan 2013\n\
68
+ \ >>> Calendar.get_last_weekday_in_month(2013, 1, MON)\n datetime.date(2013,\
69
+ \ 1, 28)\n \"\"\"\n day = date(year, month, monthrange(year, month)[1])\n\
70
+ \ while True:\n if day.weekday() == weekday:\n \
71
+ \ break\n day = day - timedelta(days=1)\n return day"
72
+ - source_sentence: first duplicate element in list in python
73
+ sentences:
74
+ - "def python_mime(fn):\n \"\"\"\n Decorator, which adds correct MIME type\
75
+ \ for python source to the decorated\n bottle API function.\n \"\"\"\n \
76
+ \ @wraps(fn)\n def python_mime_decorator(*args, **kwargs):\n response.content_type\
77
+ \ = \"text/x-python\"\n\n return fn(*args, **kwargs)\n\n return python_mime_decorator"
78
+ - "def purge_duplicates(list_in):\n \"\"\"Remove duplicates from list while preserving\
79
+ \ order.\n\n Parameters\n ----------\n list_in: Iterable\n\n Returns\n\
80
+ \ -------\n list\n List of first occurences in order\n \"\"\"\n\
81
+ \ _list = []\n for item in list_in:\n if item not in _list:\n \
82
+ \ _list.append(item)\n return _list"
83
+ - "def getRect(self):\n\t\t\"\"\"\n\t\tReturns the window bounds as a tuple of (x,y,w,h)\n\
84
+ \t\t\"\"\"\n\t\treturn (self.x, self.y, self.w, self.h)"
85
+ pipeline_tag: sentence-similarity
86
+ library_name: sentence-transformers
87
+ metrics:
88
+ - cosine_accuracy@1
89
+ - cosine_accuracy@3
90
+ - cosine_accuracy@5
91
+ - cosine_accuracy@10
92
+ - cosine_precision@1
93
+ - cosine_precision@3
94
+ - cosine_precision@5
95
+ - cosine_precision@10
96
+ - cosine_recall@1
97
+ - cosine_recall@3
98
+ - cosine_recall@5
99
+ - cosine_recall@10
100
+ - cosine_ndcg@10
101
+ - cosine_mrr@10
102
+ - cosine_map@100
103
+ model-index:
104
+ - name: SentenceTransformer based on answerdotai/ModernBERT-base
105
+ results:
106
+ - task:
107
+ type: information-retrieval
108
+ name: Information Retrieval
109
+ dataset:
110
+ name: eval
111
+ type: eval
112
+ metrics:
113
+ - type: cosine_accuracy@1
114
+ value: 0.5133037694013304
115
+ name: Cosine Accuracy@1
116
+ - type: cosine_accuracy@3
117
+ value: 0.7671840354767184
118
+ name: Cosine Accuracy@3
119
+ - type: cosine_accuracy@5
120
+ value: 0.8370288248337029
121
+ name: Cosine Accuracy@5
122
+ - type: cosine_accuracy@10
123
+ value: 0.9212860310421286
124
+ name: Cosine Accuracy@10
125
+ - type: cosine_precision@1
126
+ value: 0.5133037694013304
127
+ name: Cosine Precision@1
128
+ - type: cosine_precision@3
129
+ value: 0.2557280118255728
130
+ name: Cosine Precision@3
131
+ - type: cosine_precision@5
132
+ value: 0.1674057649667406
133
+ name: Cosine Precision@5
134
+ - type: cosine_precision@10
135
+ value: 0.09212860310421285
136
+ name: Cosine Precision@10
137
+ - type: cosine_recall@1
138
+ value: 0.5133037694013304
139
+ name: Cosine Recall@1
140
+ - type: cosine_recall@3
141
+ value: 0.7671840354767184
142
+ name: Cosine Recall@3
143
+ - type: cosine_recall@5
144
+ value: 0.8370288248337029
145
+ name: Cosine Recall@5
146
+ - type: cosine_recall@10
147
+ value: 0.9212860310421286
148
+ name: Cosine Recall@10
149
+ - type: cosine_ndcg@10
150
+ value: 0.7198846730813788
151
+ name: Cosine Ndcg@10
152
+ - type: cosine_mrr@10
153
+ value: 0.6550922992996169
154
+ name: Cosine Mrr@10
155
+ - type: cosine_map@100
156
+ value: 0.6584728308162124
157
+ name: Cosine Map@100
158
+ ---
159
+
160
+ # SentenceTransformer based on answerdotai/ModernBERT-base
161
+
162
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-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.
163
+
164
+ ## Model Details
165
+
166
+ ### Model Description
167
+ - **Model Type:** Sentence Transformer
168
+ - **Base model:** [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
169
+ - **Maximum Sequence Length:** 512 tokens
170
+ - **Output Dimensionality:** 768 dimensions
171
+ - **Similarity Function:** Cosine Similarity
172
+ <!-- - **Training Dataset:** Unknown -->
173
+ <!-- - **Language:** Unknown -->
174
+ <!-- - **License:** Unknown -->
175
+
176
+ ### Model Sources
177
+
178
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
179
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
180
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
181
+
182
+ ### Full Model Architecture
183
+
184
+ ```
185
+ SentenceTransformer(
186
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'OptimizedModule'})
187
+ (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})
188
+ )
189
+ ```
190
+
191
+ ## Usage
192
+
193
+ ### Direct Usage (Sentence Transformers)
194
+
195
+ First install the Sentence Transformers library:
196
+
197
+ ```bash
198
+ pip install -U sentence-transformers
199
+ ```
200
+
201
+ Then you can load this model and run inference.
202
+ ```python
203
+ from sentence_transformers import SentenceTransformer
204
+
205
+ # Download from the 🤗 Hub
206
+ model = SentenceTransformer("modernbert-cosqa")
207
+ # Run inference
208
+ queries = [
209
+ "first duplicate element in list in python",
210
+ ]
211
+ documents = [
212
+ 'def purge_duplicates(list_in):\n """Remove duplicates from list while preserving order.\n\n Parameters\n ----------\n list_in: Iterable\n\n Returns\n -------\n list\n List of first occurences in order\n """\n _list = []\n for item in list_in:\n if item not in _list:\n _list.append(item)\n return _list',
213
+ 'def getRect(self):\n\t\t"""\n\t\tReturns the window bounds as a tuple of (x,y,w,h)\n\t\t"""\n\t\treturn (self.x, self.y, self.w, self.h)',
214
+ 'def python_mime(fn):\n """\n Decorator, which adds correct MIME type for python source to the decorated\n bottle API function.\n """\n @wraps(fn)\n def python_mime_decorator(*args, **kwargs):\n response.content_type = "text/x-python"\n\n return fn(*args, **kwargs)\n\n return python_mime_decorator',
215
+ ]
216
+ query_embeddings = model.encode_query(queries)
217
+ document_embeddings = model.encode_document(documents)
218
+ print(query_embeddings.shape, document_embeddings.shape)
219
+ # [1, 768] [3, 768]
220
+
221
+ # Get the similarity scores for the embeddings
222
+ similarities = model.similarity(query_embeddings, document_embeddings)
223
+ print(similarities)
224
+ # tensor([[0.7036, 0.1660, 0.1295]])
225
+ ```
226
+
227
+ <!--
228
+ ### Direct Usage (Transformers)
229
+
230
+ <details><summary>Click to see the direct usage in Transformers</summary>
231
+
232
+ </details>
233
+ -->
234
+
235
+ <!--
236
+ ### Downstream Usage (Sentence Transformers)
237
+
238
+ You can finetune this model on your own dataset.
239
+
240
+ <details><summary>Click to expand</summary>
241
+
242
+ </details>
243
+ -->
244
+
245
+ <!--
246
+ ### Out-of-Scope Use
247
+
248
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
249
+ -->
250
+
251
+ ## Evaluation
252
+
253
+ ### Metrics
254
+
255
+ #### Information Retrieval
256
+
257
+ * Dataset: `eval`
258
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
259
+
260
+ | Metric | Value |
261
+ |:--------------------|:-----------|
262
+ | cosine_accuracy@1 | 0.5133 |
263
+ | cosine_accuracy@3 | 0.7672 |
264
+ | cosine_accuracy@5 | 0.837 |
265
+ | cosine_accuracy@10 | 0.9213 |
266
+ | cosine_precision@1 | 0.5133 |
267
+ | cosine_precision@3 | 0.2557 |
268
+ | cosine_precision@5 | 0.1674 |
269
+ | cosine_precision@10 | 0.0921 |
270
+ | cosine_recall@1 | 0.5133 |
271
+ | cosine_recall@3 | 0.7672 |
272
+ | cosine_recall@5 | 0.837 |
273
+ | cosine_recall@10 | 0.9213 |
274
+ | **cosine_ndcg@10** | **0.7199** |
275
+ | cosine_mrr@10 | 0.6551 |
276
+ | cosine_map@100 | 0.6585 |
277
+
278
+ <!--
279
+ ## Bias, Risks and Limitations
280
+
281
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
282
+ -->
283
+
284
+ <!--
285
+ ### Recommendations
286
+
287
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
288
+ -->
289
+
290
+ ## Training Details
291
+
292
+ ### Training Dataset
293
+
294
+ #### Unnamed Dataset
295
+
296
+ * Size: 8,118 training samples
297
+ * Columns: <code>query</code> and <code>positive</code>
298
+ * Approximate statistics based on the first 1000 samples:
299
+ | | query | positive |
300
+ |:--------|:--------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
301
+ | type | string | string |
302
+ | details | <ul><li>min: 6 tokens</li><li>mean: 9.3 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 35 tokens</li><li>mean: 85.05 tokens</li><li>max: 512 tokens</li></ul> |
303
+ * Samples:
304
+ | query | positive |
305
+ |:--------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
306
+ | <code>python code for opening geojson file</code> | <code>def _loadfilepath(self, filepath, **kwargs):<br> """This loads a geojson file into a geojson python<br> dictionary using the json module.<br> <br> Note: to load with a different text encoding use the encoding argument.<br> """<br> with open(filepath, "r") as f:<br> data = json.load(f, **kwargs)<br> return data</code> |
307
+ | <code>python 3 none compare with int</code> | <code>def is_natural(x):<br> """A non-negative integer."""<br> try:<br> is_integer = int(x) == x<br> except (TypeError, ValueError):<br> return False<br> return is_integer and x >= 0</code> |
308
+ | <code>design db memory cache python</code> | <code>def refresh(self, document):<br> """ Load a new copy of a document from the database. does not<br> replace the old one """<br> try:<br> old_cache_size = self.cache_size<br> self.cache_size = 0<br> obj = self.query(type(document)).filter_by(mongo_id=document.mongo_id).one()<br> finally:<br> self.cache_size = old_cache_size<br> self.cache_write(obj)<br> return obj</code> |
309
+ * Loss: [<code>CachedMultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
310
+ ```json
311
+ {
312
+ "scale": 20.0,
313
+ "similarity_fct": "cos_sim",
314
+ "mini_batch_size": 64,
315
+ "gather_across_devices": false,
316
+ "directions": [
317
+ "query_to_doc"
318
+ ],
319
+ "partition_mode": "joint",
320
+ "hardness_mode": null,
321
+ "hardness_strength": 0.0
322
+ }
323
+ ```
324
+
325
+ ### Evaluation Dataset
326
+
327
+ #### Unnamed Dataset
328
+
329
+ * Size: 902 evaluation samples
330
+ * Columns: <code>query</code> and <code>positive</code>
331
+ * Approximate statistics based on the first 902 samples:
332
+ | | query | positive |
333
+ |:--------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
334
+ | type | string | string |
335
+ | details | <ul><li>min: 6 tokens</li><li>mean: 9.24 tokens</li><li>max: 22 tokens</li></ul> | <ul><li>min: 38 tokens</li><li>mean: 86.55 tokens</li><li>max: 332 tokens</li></ul> |
336
+ * Samples:
337
+ | query | positive |
338
+ |:--------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
339
+ | <code>how to remove masked items in python array</code> | <code>def ma(self):<br> """Represent data as a masked array.<br><br> The array is returned with column-first indexing, i.e. for a data file with<br> columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... .<br><br> inf and nan are filtered via :func:`numpy.isfinite`.<br> """<br> a = self.array<br> return numpy.ma.MaskedArray(a, mask=numpy.logical_not(numpy.isfinite(a)))</code> |
340
+ | <code>python deepcopy basic type</code> | <code>def __deepcopy__(self, memo):<br> """Improve deepcopy speed."""<br> return type(self)(value=self._value, enum_ref=self.enum_ref)</code> |
341
+ | <code>python number of non nan rows in a row</code> | <code>def count_rows_with_nans(X):<br> """Count the number of rows in 2D arrays that contain any nan values."""<br> if X.ndim == 2:<br> return np.where(np.isnan(X).sum(axis=1) != 0, 1, 0).sum()</code> |
342
+ * Loss: [<code>CachedMultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
343
+ ```json
344
+ {
345
+ "scale": 20.0,
346
+ "similarity_fct": "cos_sim",
347
+ "mini_batch_size": 64,
348
+ "gather_across_devices": false,
349
+ "directions": [
350
+ "query_to_doc"
351
+ ],
352
+ "partition_mode": "joint",
353
+ "hardness_mode": null,
354
+ "hardness_strength": 0.0
355
+ }
356
+ ```
357
+
358
+ ### Training Hyperparameters
359
+ #### Non-Default Hyperparameters
360
+
361
+ - `per_device_train_batch_size`: 1024
362
+ - `num_train_epochs`: 5
363
+ - `learning_rate`: 2e-05
364
+ - `warmup_steps`: 0.1
365
+ - `bf16`: True
366
+ - `eval_strategy`: epoch
367
+ - `per_device_eval_batch_size`: 1024
368
+ - `push_to_hub`: True
369
+ - `hub_model_id`: modernbert-cosqa
370
+ - `load_best_model_at_end`: True
371
+ - `dataloader_num_workers`: 4
372
+ - `batch_sampler`: no_duplicates
373
+
374
+ #### All Hyperparameters
375
+ <details><summary>Click to expand</summary>
376
+
377
+ - `per_device_train_batch_size`: 1024
378
+ - `num_train_epochs`: 5
379
+ - `max_steps`: -1
380
+ - `learning_rate`: 2e-05
381
+ - `lr_scheduler_type`: linear
382
+ - `lr_scheduler_kwargs`: None
383
+ - `warmup_steps`: 0.1
384
+ - `optim`: adamw_torch_fused
385
+ - `optim_args`: None
386
+ - `weight_decay`: 0.0
387
+ - `adam_beta1`: 0.9
388
+ - `adam_beta2`: 0.999
389
+ - `adam_epsilon`: 1e-08
390
+ - `optim_target_modules`: None
391
+ - `gradient_accumulation_steps`: 1
392
+ - `average_tokens_across_devices`: True
393
+ - `max_grad_norm`: 1.0
394
+ - `label_smoothing_factor`: 0.0
395
+ - `bf16`: True
396
+ - `fp16`: False
397
+ - `bf16_full_eval`: False
398
+ - `fp16_full_eval`: False
399
+ - `tf32`: None
400
+ - `gradient_checkpointing`: False
401
+ - `gradient_checkpointing_kwargs`: None
402
+ - `torch_compile`: False
403
+ - `torch_compile_backend`: None
404
+ - `torch_compile_mode`: None
405
+ - `use_liger_kernel`: False
406
+ - `liger_kernel_config`: None
407
+ - `use_cache`: False
408
+ - `neftune_noise_alpha`: None
409
+ - `torch_empty_cache_steps`: None
410
+ - `auto_find_batch_size`: False
411
+ - `log_on_each_node`: True
412
+ - `logging_nan_inf_filter`: True
413
+ - `include_num_input_tokens_seen`: no
414
+ - `log_level`: passive
415
+ - `log_level_replica`: warning
416
+ - `disable_tqdm`: False
417
+ - `project`: huggingface
418
+ - `trackio_space_id`: trackio
419
+ - `eval_strategy`: epoch
420
+ - `per_device_eval_batch_size`: 1024
421
+ - `prediction_loss_only`: True
422
+ - `eval_on_start`: False
423
+ - `eval_do_concat_batches`: True
424
+ - `eval_use_gather_object`: False
425
+ - `eval_accumulation_steps`: None
426
+ - `include_for_metrics`: []
427
+ - `batch_eval_metrics`: False
428
+ - `save_only_model`: False
429
+ - `save_on_each_node`: False
430
+ - `enable_jit_checkpoint`: False
431
+ - `push_to_hub`: True
432
+ - `hub_private_repo`: None
433
+ - `hub_model_id`: modernbert-cosqa
434
+ - `hub_strategy`: every_save
435
+ - `hub_always_push`: False
436
+ - `hub_revision`: None
437
+ - `load_best_model_at_end`: True
438
+ - `ignore_data_skip`: False
439
+ - `restore_callback_states_from_checkpoint`: False
440
+ - `full_determinism`: False
441
+ - `seed`: 42
442
+ - `data_seed`: None
443
+ - `use_cpu`: False
444
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
445
+ - `parallelism_config`: None
446
+ - `dataloader_drop_last`: False
447
+ - `dataloader_num_workers`: 4
448
+ - `dataloader_pin_memory`: True
449
+ - `dataloader_persistent_workers`: False
450
+ - `dataloader_prefetch_factor`: None
451
+ - `remove_unused_columns`: True
452
+ - `label_names`: None
453
+ - `train_sampling_strategy`: random
454
+ - `length_column_name`: length
455
+ - `ddp_find_unused_parameters`: None
456
+ - `ddp_bucket_cap_mb`: None
457
+ - `ddp_broadcast_buffers`: False
458
+ - `ddp_backend`: None
459
+ - `ddp_timeout`: 1800
460
+ - `fsdp`: []
461
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
462
+ - `deepspeed`: None
463
+ - `debug`: []
464
+ - `skip_memory_metrics`: True
465
+ - `do_predict`: False
466
+ - `resume_from_checkpoint`: None
467
+ - `warmup_ratio`: None
468
+ - `local_rank`: -1
469
+ - `prompts`: None
470
+ - `batch_sampler`: no_duplicates
471
+ - `multi_dataset_batch_sampler`: proportional
472
+ - `router_mapping`: {}
473
+ - `learning_rate_mapping`: {}
474
+
475
+ </details>
476
+
477
+ ### Training Logs
478
+ | Epoch | Step | Training Loss | Validation Loss | eval_cosine_ndcg@10 |
479
+ |:-------:|:------:|:-------------:|:---------------:|:-------------------:|
480
+ | 1.0 | 8 | - | 2.3377 | 0.4172 |
481
+ | 1.25 | 10 | 5.9012 | - | - |
482
+ | 2.0 | 16 | - | 1.3202 | 0.5222 |
483
+ | 2.5 | 20 | 3.4421 | - | - |
484
+ | 3.0 | 24 | - | 0.8801 | 0.6618 |
485
+ | 3.75 | 30 | 2.3393 | - | - |
486
+ | 4.0 | 32 | - | 0.7155 | 0.7054 |
487
+ | **5.0** | **40** | **1.9273** | **0.6707** | **0.7199** |
488
+
489
+ * The bold row denotes the saved checkpoint.
490
+
491
+ ### Framework Versions
492
+ - Python: 3.12.12
493
+ - Sentence Transformers: 5.3.0
494
+ - Transformers: 5.3.0
495
+ - PyTorch: 2.10.0+cu128
496
+ - Accelerate: 1.13.0
497
+ - Datasets: 4.7.0
498
+ - Tokenizers: 0.22.2
499
+
500
+ ## Citation
501
+
502
+ ### BibTeX
503
+
504
+ #### Sentence Transformers
505
+ ```bibtex
506
+ @inproceedings{reimers-2019-sentence-bert,
507
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
508
+ author = "Reimers, Nils and Gurevych, Iryna",
509
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
510
+ month = "11",
511
+ year = "2019",
512
+ publisher = "Association for Computational Linguistics",
513
+ url = "https://arxiv.org/abs/1908.10084",
514
+ }
515
+ ```
516
+
517
+ #### CachedMultipleNegativesRankingLoss
518
+ ```bibtex
519
+ @misc{gao2021scaling,
520
+ title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
521
+ author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
522
+ year={2021},
523
+ eprint={2101.06983},
524
+ archivePrefix={arXiv},
525
+ primaryClass={cs.LG}
526
+ }
527
+ ```
528
+
529
+ <!--
530
+ ## Glossary
531
+
532
+ *Clearly define terms in order to be accessible across audiences.*
533
+ -->
534
+
535
+ <!--
536
+ ## Model Card Authors
537
+
538
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
539
+ -->
540
+
541
+ <!--
542
+ ## Model Card Contact
543
+
544
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
545
+ -->
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": 512,
3
+ "do_lower_case": false
4
+ }