LamaDiab commited on
Commit
6287496
·
verified ·
1 Parent(s): 7c544b0

Updating model weights

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
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,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:604740
9
+ - loss:MultipleNegativesSymmetricRankingLoss
10
+ base_model: sentence-transformers/all-MiniLM-L6-v2
11
+ widget:
12
+ - source_sentence: casa chandelier
13
+ sentences:
14
+ - new eleganza - 6-999-x
15
+ - casa chandelier
16
+ - chandlier
17
+ - source_sentence: true gold feeding bottle with handle 270 ml 2024144
18
+ sentences:
19
+ - girls feeding bottle
20
+ - baby bottle
21
+ - 100 baby gym leggings - grey
22
+ - source_sentence: sand eel shad soft lure combo eelo 150 25 g ayu/blue
23
+ sentences:
24
+ - fishing
25
+ - fast fishing fishing lure
26
+ - bestway unicorn fantasy ride on
27
+ - source_sentence: farm frites potato chips
28
+ sentences:
29
+ - snacks
30
+ - farm frites chips
31
+ - al-ameed decaf coffee without cardamom
32
+ - source_sentence: diary of a wimpy kid do-it-youself book
33
+ sentences:
34
+ - grand theft auto v (ps5)
35
+ - children english book
36
+ - children book
37
+ pipeline_tag: sentence-similarity
38
+ library_name: sentence-transformers
39
+ ---
40
+
41
+ # SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
42
+
43
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
44
+
45
+ ## Model Details
46
+
47
+ ### Model Description
48
+ - **Model Type:** Sentence Transformer
49
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
50
+ - **Maximum Sequence Length:** 256 tokens
51
+ - **Output Dimensionality:** 384 dimensions
52
+ - **Similarity Function:** Cosine Similarity
53
+ <!-- - **Training Dataset:** Unknown -->
54
+ <!-- - **Language:** Unknown -->
55
+ <!-- - **License:** Unknown -->
56
+
57
+ ### Model Sources
58
+
59
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
60
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
61
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
62
+
63
+ ### Full Model Architecture
64
+
65
+ ```
66
+ SentenceTransformer(
67
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'BertModel'})
68
+ (1): Pooling({'word_embedding_dimension': 384, '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})
69
+ (2): Normalize()
70
+ )
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ### Direct Usage (Sentence Transformers)
76
+
77
+ First install the Sentence Transformers library:
78
+
79
+ ```bash
80
+ pip install -U sentence-transformers
81
+ ```
82
+
83
+ Then you can load this model and run inference.
84
+ ```python
85
+ from sentence_transformers import SentenceTransformer
86
+
87
+ # Download from the 🤗 Hub
88
+ model = SentenceTransformer("LamaDiab/MiniLM-V26Data-256HardBATCH-SemanticEngine")
89
+ # Run inference
90
+ sentences = [
91
+ 'diary of a wimpy kid do-it-youself book',
92
+ 'children english book',
93
+ 'grand theft auto v (ps5)',
94
+ ]
95
+ embeddings = model.encode(sentences)
96
+ print(embeddings.shape)
97
+ # [3, 384]
98
+
99
+ # Get the similarity scores for the embeddings
100
+ similarities = model.similarity(embeddings, embeddings)
101
+ print(similarities)
102
+ # tensor([[1.0000, 0.5544, 0.0659],
103
+ # [0.5544, 1.0000, 0.0609],
104
+ # [0.0659, 0.0609, 1.0000]])
105
+ ```
106
+
107
+ <!--
108
+ ### Direct Usage (Transformers)
109
+
110
+ <details><summary>Click to see the direct usage in Transformers</summary>
111
+
112
+ </details>
113
+ -->
114
+
115
+ <!--
116
+ ### Downstream Usage (Sentence Transformers)
117
+
118
+ You can finetune this model on your own dataset.
119
+
120
+ <details><summary>Click to expand</summary>
121
+
122
+ </details>
123
+ -->
124
+
125
+ <!--
126
+ ### Out-of-Scope Use
127
+
128
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
129
+ -->
130
+
131
+ <!--
132
+ ## Bias, Risks and Limitations
133
+
134
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
135
+ -->
136
+
137
+ <!--
138
+ ### Recommendations
139
+
140
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
141
+ -->
142
+
143
+ ## Training Details
144
+
145
+ ### Training Dataset
146
+
147
+ #### Unnamed Dataset
148
+
149
+ * Size: 604,740 training samples
150
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>itemCategory</code>
151
+ * Approximate statistics based on the first 1000 samples:
152
+ | | anchor | positive | itemCategory |
153
+ |:--------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|
154
+ | type | string | string | string |
155
+ | details | <ul><li>min: 3 tokens</li><li>mean: 9.9 tokens</li><li>max: 42 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 4.76 tokens</li><li>max: 78 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.94 tokens</li><li>max: 9 tokens</li></ul> |
156
+ * Samples:
157
+ | anchor | positive | itemCategory |
158
+ |:------------------------------------------------|:----------------------------|:----------------------------|
159
+ | <code>oval silver bracelet with side oat</code> | <code>women bracelet</code> | <code>bracelet</code> |
160
+ | <code>petrol denim bandana</code> | <code>hair accessory</code> | <code>hair accessory</code> |
161
+ | <code>lights & colors driver</code> | <code>toy</code> | <code>toddler toy</code> |
162
+ * Loss: [<code>MultipleNegativesSymmetricRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativessymmetricrankingloss) with these parameters:
163
+ ```json
164
+ {
165
+ "scale": 20.0,
166
+ "similarity_fct": "cos_sim",
167
+ "gather_across_devices": false
168
+ }
169
+ ```
170
+
171
+ ### Evaluation Dataset
172
+
173
+ #### Unnamed Dataset
174
+
175
+ * Size: 9,509 evaluation samples
176
+ * Columns: <code>anchor</code>, <code>positive</code>, <code>negative</code>, and <code>itemCategory</code>
177
+ * Approximate statistics based on the first 1000 samples:
178
+ | | anchor | positive | negative | itemCategory |
179
+ |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
180
+ | type | string | string | string | string |
181
+ | details | <ul><li>min: 3 tokens</li><li>mean: 9.63 tokens</li><li>max: 43 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 6.39 tokens</li><li>max: 150 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 9.42 tokens</li><li>max: 46 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.88 tokens</li><li>max: 10 tokens</li></ul> |
182
+ * Samples:
183
+ | anchor | positive | negative | itemCategory |
184
+ |:---------------------------------------------------------------------|:----------------------------------|:------------------------------------------------------|:------------------------------------|
185
+ | <code>pilot mechanical pencil progrex h-127 - 0.7 mm</code> | <code>office supplies</code> | <code>artist pen extra fine brush tip b no.125</code> | <code>pencil</code> |
186
+ | <code>superior drawing marker -pen - set of 12 colors - 2 nib</code> | <code> marker pen </code> | <code>urban stars prayer mat</code> | <code>marker</code> |
187
+ | <code>first person singular author: haruki murakami</code> | <code>haruki murakami book</code> | <code>colorful rings arrangement game</code> | <code>literature and fiction</code> |
188
+ * Loss: [<code>MultipleNegativesSymmetricRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativessymmetricrankingloss) with these parameters:
189
+ ```json
190
+ {
191
+ "scale": 20.0,
192
+ "similarity_fct": "cos_sim",
193
+ "gather_across_devices": false
194
+ }
195
+ ```
196
+
197
+ ### Training Hyperparameters
198
+ #### Non-Default Hyperparameters
199
+
200
+ - `eval_strategy`: steps
201
+ - `per_device_train_batch_size`: 256
202
+ - `per_device_eval_batch_size`: 256
203
+ - `learning_rate`: 3e-05
204
+ - `weight_decay`: 0.01
205
+ - `warmup_ratio`: 0.1
206
+ - `fp16`: True
207
+ - `dataloader_num_workers`: 1
208
+ - `dataloader_prefetch_factor`: 2
209
+ - `dataloader_persistent_workers`: True
210
+ - `push_to_hub`: True
211
+ - `hub_model_id`: LamaDiab/MiniLM-V26Data-256HardBATCH-SemanticEngine
212
+ - `hub_strategy`: all_checkpoints
213
+
214
+ #### All Hyperparameters
215
+ <details><summary>Click to expand</summary>
216
+
217
+ - `overwrite_output_dir`: False
218
+ - `do_predict`: False
219
+ - `eval_strategy`: steps
220
+ - `prediction_loss_only`: True
221
+ - `per_device_train_batch_size`: 256
222
+ - `per_device_eval_batch_size`: 256
223
+ - `per_gpu_train_batch_size`: None
224
+ - `per_gpu_eval_batch_size`: None
225
+ - `gradient_accumulation_steps`: 1
226
+ - `eval_accumulation_steps`: None
227
+ - `torch_empty_cache_steps`: None
228
+ - `learning_rate`: 3e-05
229
+ - `weight_decay`: 0.01
230
+ - `adam_beta1`: 0.9
231
+ - `adam_beta2`: 0.999
232
+ - `adam_epsilon`: 1e-08
233
+ - `max_grad_norm`: 1.0
234
+ - `num_train_epochs`: 3
235
+ - `max_steps`: -1
236
+ - `lr_scheduler_type`: linear
237
+ - `lr_scheduler_kwargs`: {}
238
+ - `warmup_ratio`: 0.1
239
+ - `warmup_steps`: 0
240
+ - `log_level`: passive
241
+ - `log_level_replica`: warning
242
+ - `log_on_each_node`: True
243
+ - `logging_nan_inf_filter`: True
244
+ - `save_safetensors`: True
245
+ - `save_on_each_node`: False
246
+ - `save_only_model`: False
247
+ - `restore_callback_states_from_checkpoint`: False
248
+ - `no_cuda`: False
249
+ - `use_cpu`: False
250
+ - `use_mps_device`: False
251
+ - `seed`: 42
252
+ - `data_seed`: None
253
+ - `jit_mode_eval`: False
254
+ - `use_ipex`: False
255
+ - `bf16`: False
256
+ - `fp16`: True
257
+ - `fp16_opt_level`: O1
258
+ - `half_precision_backend`: auto
259
+ - `bf16_full_eval`: False
260
+ - `fp16_full_eval`: False
261
+ - `tf32`: None
262
+ - `local_rank`: 0
263
+ - `ddp_backend`: None
264
+ - `tpu_num_cores`: None
265
+ - `tpu_metrics_debug`: False
266
+ - `debug`: []
267
+ - `dataloader_drop_last`: False
268
+ - `dataloader_num_workers`: 1
269
+ - `dataloader_prefetch_factor`: 2
270
+ - `past_index`: -1
271
+ - `disable_tqdm`: False
272
+ - `remove_unused_columns`: True
273
+ - `label_names`: None
274
+ - `load_best_model_at_end`: False
275
+ - `ignore_data_skip`: False
276
+ - `fsdp`: []
277
+ - `fsdp_min_num_params`: 0
278
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
279
+ - `fsdp_transformer_layer_cls_to_wrap`: None
280
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
281
+ - `deepspeed`: None
282
+ - `label_smoothing_factor`: 0.0
283
+ - `optim`: adamw_torch
284
+ - `optim_args`: None
285
+ - `adafactor`: False
286
+ - `group_by_length`: False
287
+ - `length_column_name`: length
288
+ - `ddp_find_unused_parameters`: None
289
+ - `ddp_bucket_cap_mb`: None
290
+ - `ddp_broadcast_buffers`: False
291
+ - `dataloader_pin_memory`: True
292
+ - `dataloader_persistent_workers`: True
293
+ - `skip_memory_metrics`: True
294
+ - `use_legacy_prediction_loop`: False
295
+ - `push_to_hub`: True
296
+ - `resume_from_checkpoint`: None
297
+ - `hub_model_id`: LamaDiab/MiniLM-V26Data-256HardBATCH-SemanticEngine
298
+ - `hub_strategy`: all_checkpoints
299
+ - `hub_private_repo`: None
300
+ - `hub_always_push`: False
301
+ - `hub_revision`: None
302
+ - `gradient_checkpointing`: False
303
+ - `gradient_checkpointing_kwargs`: None
304
+ - `include_inputs_for_metrics`: False
305
+ - `include_for_metrics`: []
306
+ - `eval_do_concat_batches`: True
307
+ - `fp16_backend`: auto
308
+ - `push_to_hub_model_id`: None
309
+ - `push_to_hub_organization`: None
310
+ - `mp_parameters`:
311
+ - `auto_find_batch_size`: False
312
+ - `full_determinism`: False
313
+ - `torchdynamo`: None
314
+ - `ray_scope`: last
315
+ - `ddp_timeout`: 1800
316
+ - `torch_compile`: False
317
+ - `torch_compile_backend`: None
318
+ - `torch_compile_mode`: None
319
+ - `include_tokens_per_second`: False
320
+ - `include_num_input_tokens_seen`: False
321
+ - `neftune_noise_alpha`: None
322
+ - `optim_target_modules`: None
323
+ - `batch_eval_metrics`: False
324
+ - `eval_on_start`: False
325
+ - `use_liger_kernel`: False
326
+ - `liger_kernel_config`: None
327
+ - `eval_use_gather_object`: False
328
+ - `average_tokens_across_devices`: False
329
+ - `prompts`: None
330
+ - `batch_sampler`: batch_sampler
331
+ - `multi_dataset_batch_sampler`: proportional
332
+ - `router_mapping`: {}
333
+ - `learning_rate_mapping`: {}
334
+
335
+ </details>
336
+
337
+ ### Framework Versions
338
+ - Python: 3.11.13
339
+ - Sentence Transformers: 5.1.2
340
+ - Transformers: 4.53.3
341
+ - PyTorch: 2.6.0+cu124
342
+ - Accelerate: 1.9.0
343
+ - Datasets: 4.4.1
344
+ - Tokenizers: 0.21.2
345
+
346
+ ## Citation
347
+
348
+ ### BibTeX
349
+
350
+ #### Sentence Transformers
351
+ ```bibtex
352
+ @inproceedings{reimers-2019-sentence-bert,
353
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
354
+ author = "Reimers, Nils and Gurevych, Iryna",
355
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
356
+ month = "11",
357
+ year = "2019",
358
+ publisher = "Association for Computational Linguistics",
359
+ url = "https://arxiv.org/abs/1908.10084",
360
+ }
361
+ ```
362
+
363
+ <!--
364
+ ## Glossary
365
+
366
+ *Clearly define terms in order to be accessible across audiences.*
367
+ -->
368
+
369
+ <!--
370
+ ## Model Card Authors
371
+
372
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
373
+ -->
374
+
375
+ <!--
376
+ ## Model Card Contact
377
+
378
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
379
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.2",
4
+ "transformers": "4.53.3",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
3
+ "do_lower_case": false
4
+ }