Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- 1_Dense/config.json +1 -0
- 1_Dense/model.safetensors +3 -0
- README.md +437 -0
- added_tokens.json +4 -0
- config.json +26 -0
- config_sentence_transformers.json +49 -0
- model.safetensors +3 -0
- modules.json +14 -0
- optimizer.pt +3 -0
- rng_state.pth +3 -0
- scheduler.pt +3 -0
- sentence_bert_config.json +4 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +15 -0
- tokenizer.json +3 -0
- tokenizer_config.json +72 -0
- trainer_state.json +131 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
1_Dense/config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"in_features": 384, "out_features": 128, "bias": false, "activation_function": "torch.nn.modules.linear.Identity"}
|
1_Dense/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3bf55f94827a008d39186ef9a0fa258519acf29837517314a83b40d511ba01c1
|
3 |
+
size 196696
|
README.md
ADDED
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- ColBERT
|
6 |
+
- PyLate
|
7 |
+
- sentence-transformers
|
8 |
+
- sentence-similarity
|
9 |
+
- feature-extraction
|
10 |
+
- generated_from_trainer
|
11 |
+
- dataset_size:798036
|
12 |
+
- loss:Distillation
|
13 |
+
base_model: microsoft/Multilingual-MiniLM-L12-H384
|
14 |
+
datasets:
|
15 |
+
- Speedsy/ms-marco-tr-bge
|
16 |
+
pipeline_tag: sentence-similarity
|
17 |
+
library_name: PyLate
|
18 |
+
---
|
19 |
+
|
20 |
+
# PyLate model based on microsoft/Multilingual-MiniLM-L12-H384
|
21 |
+
|
22 |
+
This is a [PyLate](https://github.com/lightonai/pylate) model finetuned from [microsoft/Multilingual-MiniLM-L12-H384](https://huggingface.co/microsoft/Multilingual-MiniLM-L12-H384) on the [train](https://huggingface.co/datasets/Speedsy/ms-marco-tr-bge) dataset. It maps sentences & paragraphs to sequences of 128-dimensional dense vectors and can be used for semantic textual similarity using the MaxSim operator.
|
23 |
+
|
24 |
+
## Model Details
|
25 |
+
|
26 |
+
### Model Description
|
27 |
+
- **Model Type:** PyLate model
|
28 |
+
- **Base model:** [microsoft/Multilingual-MiniLM-L12-H384](https://huggingface.co/microsoft/Multilingual-MiniLM-L12-H384) <!-- at revision 6e8c1ec6b4ec4e3fc6eb7d2cd834fcd582b61daf -->
|
29 |
+
- **Document Length:** 180 tokens
|
30 |
+
- **Query Length:** 32 tokens
|
31 |
+
- **Output Dimensionality:** 128 tokens
|
32 |
+
- **Similarity Function:** MaxSim
|
33 |
+
- **Training Dataset:**
|
34 |
+
- [train](https://huggingface.co/datasets/Speedsy/ms-marco-tr-bge)
|
35 |
+
- **Language:** en
|
36 |
+
<!-- - **License:** Unknown -->
|
37 |
+
|
38 |
+
### Model Sources
|
39 |
+
|
40 |
+
- **Documentation:** [PyLate Documentation](https://lightonai.github.io/pylate/)
|
41 |
+
- **Repository:** [PyLate on GitHub](https://github.com/lightonai/pylate)
|
42 |
+
- **Hugging Face:** [PyLate models on Hugging Face](https://huggingface.co/models?library=PyLate)
|
43 |
+
|
44 |
+
### Full Model Architecture
|
45 |
+
|
46 |
+
```
|
47 |
+
ColBERT(
|
48 |
+
(0): Transformer({'max_seq_length': 179, 'do_lower_case': False}) with Transformer model: BertModel
|
49 |
+
(1): Dense({'in_features': 384, 'out_features': 128, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
|
50 |
+
)
|
51 |
+
```
|
52 |
+
|
53 |
+
## Usage
|
54 |
+
First install the PyLate library:
|
55 |
+
|
56 |
+
```bash
|
57 |
+
pip install -U pylate
|
58 |
+
```
|
59 |
+
|
60 |
+
### Retrieval
|
61 |
+
|
62 |
+
PyLate provides a streamlined interface to index and retrieve documents using ColBERT models. The index leverages the Voyager HNSW index to efficiently handle document embeddings and enable fast retrieval.
|
63 |
+
|
64 |
+
#### Indexing documents
|
65 |
+
|
66 |
+
First, load the ColBERT model and initialize the Voyager index, then encode and index your documents:
|
67 |
+
|
68 |
+
```python
|
69 |
+
from pylate import indexes, models, retrieve
|
70 |
+
|
71 |
+
# Step 1: Load the ColBERT model
|
72 |
+
model = models.ColBERT(
|
73 |
+
model_name_or_path=pylate_model_id,
|
74 |
+
)
|
75 |
+
|
76 |
+
# Step 2: Initialize the Voyager index
|
77 |
+
index = indexes.Voyager(
|
78 |
+
index_folder="pylate-index",
|
79 |
+
index_name="index",
|
80 |
+
override=True, # This overwrites the existing index if any
|
81 |
+
)
|
82 |
+
|
83 |
+
# Step 3: Encode the documents
|
84 |
+
documents_ids = ["1", "2", "3"]
|
85 |
+
documents = ["document 1 text", "document 2 text", "document 3 text"]
|
86 |
+
|
87 |
+
documents_embeddings = model.encode(
|
88 |
+
documents,
|
89 |
+
batch_size=32,
|
90 |
+
is_query=False, # Ensure that it is set to False to indicate that these are documents, not queries
|
91 |
+
show_progress_bar=True,
|
92 |
+
)
|
93 |
+
|
94 |
+
# Step 4: Add document embeddings to the index by providing embeddings and corresponding ids
|
95 |
+
index.add_documents(
|
96 |
+
documents_ids=documents_ids,
|
97 |
+
documents_embeddings=documents_embeddings,
|
98 |
+
)
|
99 |
+
```
|
100 |
+
|
101 |
+
Note that you do not have to recreate the index and encode the documents every time. Once you have created an index and added the documents, you can re-use the index later by loading it:
|
102 |
+
|
103 |
+
```python
|
104 |
+
# To load an index, simply instantiate it with the correct folder/name and without overriding it
|
105 |
+
index = indexes.Voyager(
|
106 |
+
index_folder="pylate-index",
|
107 |
+
index_name="index",
|
108 |
+
)
|
109 |
+
```
|
110 |
+
|
111 |
+
#### Retrieving top-k documents for queries
|
112 |
+
|
113 |
+
Once the documents are indexed, you can retrieve the top-k most relevant documents for a given set of queries.
|
114 |
+
To do so, initialize the ColBERT retriever with the index you want to search in, encode the queries and then retrieve the top-k documents to get the top matches ids and relevance scores:
|
115 |
+
|
116 |
+
```python
|
117 |
+
# Step 1: Initialize the ColBERT retriever
|
118 |
+
retriever = retrieve.ColBERT(index=index)
|
119 |
+
|
120 |
+
# Step 2: Encode the queries
|
121 |
+
queries_embeddings = model.encode(
|
122 |
+
["query for document 3", "query for document 1"],
|
123 |
+
batch_size=32,
|
124 |
+
is_query=True, # # Ensure that it is set to False to indicate that these are queries
|
125 |
+
show_progress_bar=True,
|
126 |
+
)
|
127 |
+
|
128 |
+
# Step 3: Retrieve top-k documents
|
129 |
+
scores = retriever.retrieve(
|
130 |
+
queries_embeddings=queries_embeddings,
|
131 |
+
k=10, # Retrieve the top 10 matches for each query
|
132 |
+
)
|
133 |
+
```
|
134 |
+
|
135 |
+
### Reranking
|
136 |
+
If you only want to use the ColBERT model to perform reranking on top of your first-stage retrieval pipeline without building an index, you can simply use rank function and pass the queries and documents to rerank:
|
137 |
+
|
138 |
+
```python
|
139 |
+
from pylate import rank, models
|
140 |
+
|
141 |
+
queries = [
|
142 |
+
"query A",
|
143 |
+
"query B",
|
144 |
+
]
|
145 |
+
|
146 |
+
documents = [
|
147 |
+
["document A", "document B"],
|
148 |
+
["document 1", "document C", "document B"],
|
149 |
+
]
|
150 |
+
|
151 |
+
documents_ids = [
|
152 |
+
[1, 2],
|
153 |
+
[1, 3, 2],
|
154 |
+
]
|
155 |
+
|
156 |
+
model = models.ColBERT(
|
157 |
+
model_name_or_path=pylate_model_id,
|
158 |
+
)
|
159 |
+
|
160 |
+
queries_embeddings = model.encode(
|
161 |
+
queries,
|
162 |
+
is_query=True,
|
163 |
+
)
|
164 |
+
|
165 |
+
documents_embeddings = model.encode(
|
166 |
+
documents,
|
167 |
+
is_query=False,
|
168 |
+
)
|
169 |
+
|
170 |
+
reranked_documents = rank.rerank(
|
171 |
+
documents_ids=documents_ids,
|
172 |
+
queries_embeddings=queries_embeddings,
|
173 |
+
documents_embeddings=documents_embeddings,
|
174 |
+
)
|
175 |
+
```
|
176 |
+
|
177 |
+
<!--
|
178 |
+
### Direct Usage (Transformers)
|
179 |
+
|
180 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
181 |
+
|
182 |
+
</details>
|
183 |
+
-->
|
184 |
+
|
185 |
+
<!--
|
186 |
+
### Downstream Usage (Sentence Transformers)
|
187 |
+
|
188 |
+
You can finetune this model on your own dataset.
|
189 |
+
|
190 |
+
<details><summary>Click to expand</summary>
|
191 |
+
|
192 |
+
</details>
|
193 |
+
-->
|
194 |
+
|
195 |
+
<!--
|
196 |
+
### Out-of-Scope Use
|
197 |
+
|
198 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
199 |
+
-->
|
200 |
+
|
201 |
+
<!--
|
202 |
+
## Bias, Risks and Limitations
|
203 |
+
|
204 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
205 |
+
-->
|
206 |
+
|
207 |
+
<!--
|
208 |
+
### Recommendations
|
209 |
+
|
210 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
211 |
+
-->
|
212 |
+
|
213 |
+
## Training Details
|
214 |
+
|
215 |
+
### Training Dataset
|
216 |
+
|
217 |
+
#### train
|
218 |
+
|
219 |
+
* Dataset: [train](https://huggingface.co/datasets/Speedsy/ms-marco-tr-bge) at [b9b0f7f](https://huggingface.co/datasets/Speedsy/ms-marco-tr-bge/tree/b9b0f7fd13c3ce3b632a3a1cd37f6ddbf8a040f5)
|
220 |
+
* Size: 798,036 training samples
|
221 |
+
* Columns: <code>query_id</code>, <code>document_ids</code>, and <code>scores</code>
|
222 |
+
* Approximate statistics based on the first 1000 samples:
|
223 |
+
| | query_id | document_ids | scores |
|
224 |
+
|:--------|:--------------------------------------------------------------------------------|:------------------------------------|:------------------------------------|
|
225 |
+
| type | string | list | list |
|
226 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 5.82 tokens</li><li>max: 6 tokens</li></ul> | <ul><li>size: 32 elements</li></ul> | <ul><li>size: 32 elements</li></ul> |
|
227 |
+
* Samples:
|
228 |
+
| query_id | document_ids | scores |
|
229 |
+
|:---------------------|:--------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------|
|
230 |
+
| <code>817836</code> | <code>['2716076', '6741935', '2681109', '5562684', '3507339', ...]</code> | <code>[1.0, 0.7059561610221863, 0.21702419221401215, 0.38270196318626404, 0.20812414586544037, ...]</code> |
|
231 |
+
| <code>1045170</code> | <code>['5088671', '2953295', '8783471', '4268439', '6339935', ...]</code> | <code>[1.0, 0.6493034362792969, 0.0692221149802208, 0.17963139712810516, 0.6697239875793457, ...]</code> |
|
232 |
+
| <code>1154488</code> | <code>['6498614', '3770829', '1060712', '2590533', '7672044', ...]</code> | <code>[0.9497447609901428, 0.6662212610244751, 0.7423420548439026, 1.0, 0.6580896973609924, ...]</code> |
|
233 |
+
* Loss: <code>pylate.losses.distillation.Distillation</code>
|
234 |
+
|
235 |
+
### Training Hyperparameters
|
236 |
+
#### Non-Default Hyperparameters
|
237 |
+
|
238 |
+
- `per_device_train_batch_size`: 16
|
239 |
+
- `learning_rate`: 3e-05
|
240 |
+
- `num_train_epochs`: 1
|
241 |
+
- `fp16`: True
|
242 |
+
|
243 |
+
#### All Hyperparameters
|
244 |
+
<details><summary>Click to expand</summary>
|
245 |
+
|
246 |
+
- `overwrite_output_dir`: False
|
247 |
+
- `do_predict`: False
|
248 |
+
- `eval_strategy`: no
|
249 |
+
- `prediction_loss_only`: True
|
250 |
+
- `per_device_train_batch_size`: 16
|
251 |
+
- `per_device_eval_batch_size`: 8
|
252 |
+
- `per_gpu_train_batch_size`: None
|
253 |
+
- `per_gpu_eval_batch_size`: None
|
254 |
+
- `gradient_accumulation_steps`: 1
|
255 |
+
- `eval_accumulation_steps`: None
|
256 |
+
- `torch_empty_cache_steps`: None
|
257 |
+
- `learning_rate`: 3e-05
|
258 |
+
- `weight_decay`: 0.0
|
259 |
+
- `adam_beta1`: 0.9
|
260 |
+
- `adam_beta2`: 0.999
|
261 |
+
- `adam_epsilon`: 1e-08
|
262 |
+
- `max_grad_norm`: 1.0
|
263 |
+
- `num_train_epochs`: 1
|
264 |
+
- `max_steps`: -1
|
265 |
+
- `lr_scheduler_type`: linear
|
266 |
+
- `lr_scheduler_kwargs`: {}
|
267 |
+
- `warmup_ratio`: 0.0
|
268 |
+
- `warmup_steps`: 0
|
269 |
+
- `log_level`: passive
|
270 |
+
- `log_level_replica`: warning
|
271 |
+
- `log_on_each_node`: True
|
272 |
+
- `logging_nan_inf_filter`: True
|
273 |
+
- `save_safetensors`: True
|
274 |
+
- `save_on_each_node`: False
|
275 |
+
- `save_only_model`: False
|
276 |
+
- `restore_callback_states_from_checkpoint`: False
|
277 |
+
- `no_cuda`: False
|
278 |
+
- `use_cpu`: False
|
279 |
+
- `use_mps_device`: False
|
280 |
+
- `seed`: 42
|
281 |
+
- `data_seed`: None
|
282 |
+
- `jit_mode_eval`: False
|
283 |
+
- `use_ipex`: False
|
284 |
+
- `bf16`: False
|
285 |
+
- `fp16`: True
|
286 |
+
- `fp16_opt_level`: O1
|
287 |
+
- `half_precision_backend`: auto
|
288 |
+
- `bf16_full_eval`: False
|
289 |
+
- `fp16_full_eval`: False
|
290 |
+
- `tf32`: None
|
291 |
+
- `local_rank`: 0
|
292 |
+
- `ddp_backend`: None
|
293 |
+
- `tpu_num_cores`: None
|
294 |
+
- `tpu_metrics_debug`: False
|
295 |
+
- `debug`: []
|
296 |
+
- `dataloader_drop_last`: False
|
297 |
+
- `dataloader_num_workers`: 0
|
298 |
+
- `dataloader_prefetch_factor`: None
|
299 |
+
- `past_index`: -1
|
300 |
+
- `disable_tqdm`: False
|
301 |
+
- `remove_unused_columns`: True
|
302 |
+
- `label_names`: None
|
303 |
+
- `load_best_model_at_end`: False
|
304 |
+
- `ignore_data_skip`: False
|
305 |
+
- `fsdp`: []
|
306 |
+
- `fsdp_min_num_params`: 0
|
307 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
308 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
309 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
310 |
+
- `deepspeed`: None
|
311 |
+
- `label_smoothing_factor`: 0.0
|
312 |
+
- `optim`: adamw_torch
|
313 |
+
- `optim_args`: None
|
314 |
+
- `adafactor`: False
|
315 |
+
- `group_by_length`: False
|
316 |
+
- `length_column_name`: length
|
317 |
+
- `ddp_find_unused_parameters`: None
|
318 |
+
- `ddp_bucket_cap_mb`: None
|
319 |
+
- `ddp_broadcast_buffers`: False
|
320 |
+
- `dataloader_pin_memory`: True
|
321 |
+
- `dataloader_persistent_workers`: False
|
322 |
+
- `skip_memory_metrics`: True
|
323 |
+
- `use_legacy_prediction_loop`: False
|
324 |
+
- `push_to_hub`: False
|
325 |
+
- `resume_from_checkpoint`: None
|
326 |
+
- `hub_model_id`: None
|
327 |
+
- `hub_strategy`: every_save
|
328 |
+
- `hub_private_repo`: None
|
329 |
+
- `hub_always_push`: False
|
330 |
+
- `gradient_checkpointing`: False
|
331 |
+
- `gradient_checkpointing_kwargs`: None
|
332 |
+
- `include_inputs_for_metrics`: False
|
333 |
+
- `include_for_metrics`: []
|
334 |
+
- `eval_do_concat_batches`: True
|
335 |
+
- `fp16_backend`: auto
|
336 |
+
- `push_to_hub_model_id`: None
|
337 |
+
- `push_to_hub_organization`: None
|
338 |
+
- `mp_parameters`:
|
339 |
+
- `auto_find_batch_size`: False
|
340 |
+
- `full_determinism`: False
|
341 |
+
- `torchdynamo`: None
|
342 |
+
- `ray_scope`: last
|
343 |
+
- `ddp_timeout`: 1800
|
344 |
+
- `torch_compile`: False
|
345 |
+
- `torch_compile_backend`: None
|
346 |
+
- `torch_compile_mode`: None
|
347 |
+
- `dispatch_batches`: None
|
348 |
+
- `split_batches`: None
|
349 |
+
- `include_tokens_per_second`: False
|
350 |
+
- `include_num_input_tokens_seen`: False
|
351 |
+
- `neftune_noise_alpha`: None
|
352 |
+
- `optim_target_modules`: None
|
353 |
+
- `batch_eval_metrics`: False
|
354 |
+
- `eval_on_start`: False
|
355 |
+
- `use_liger_kernel`: False
|
356 |
+
- `eval_use_gather_object`: False
|
357 |
+
- `average_tokens_across_devices`: False
|
358 |
+
- `prompts`: None
|
359 |
+
- `batch_sampler`: batch_sampler
|
360 |
+
- `multi_dataset_batch_sampler`: proportional
|
361 |
+
|
362 |
+
</details>
|
363 |
+
|
364 |
+
### Training Logs
|
365 |
+
| Epoch | Step | Training Loss |
|
366 |
+
|:------:|:----:|:-------------:|
|
367 |
+
| 0.0100 | 500 | 0.0305 |
|
368 |
+
| 0.0200 | 1000 | 0.027 |
|
369 |
+
| 0.0301 | 1500 | 0.026 |
|
370 |
+
| 0.0401 | 2000 | 0.0253 |
|
371 |
+
| 0.0501 | 2500 | 0.0249 |
|
372 |
+
| 0.0601 | 3000 | 0.0239 |
|
373 |
+
| 0.0702 | 3500 | 0.0239 |
|
374 |
+
| 0.0802 | 4000 | 0.0236 |
|
375 |
+
| 0.0902 | 4500 | 0.0236 |
|
376 |
+
| 0.1002 | 5000 | 0.0232 |
|
377 |
+
| 0.1103 | 5500 | 0.0229 |
|
378 |
+
| 0.1203 | 6000 | 0.0228 |
|
379 |
+
| 0.1303 | 6500 | 0.0226 |
|
380 |
+
| 0.1403 | 7000 | 0.0226 |
|
381 |
+
|
382 |
+
|
383 |
+
### Framework Versions
|
384 |
+
- Python: 3.11.11
|
385 |
+
- Sentence Transformers: 3.4.1
|
386 |
+
- PyLate: 1.1.7
|
387 |
+
- Transformers: 4.48.2
|
388 |
+
- PyTorch: 2.6.0+cu124
|
389 |
+
- Accelerate: 1.5.2
|
390 |
+
- Datasets: 3.5.0
|
391 |
+
- Tokenizers: 0.21.1
|
392 |
+
|
393 |
+
|
394 |
+
## Citation
|
395 |
+
|
396 |
+
### BibTeX
|
397 |
+
|
398 |
+
#### Sentence Transformers
|
399 |
+
```bibtex
|
400 |
+
@inproceedings{reimers-2019-sentence-bert,
|
401 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
402 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
403 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
404 |
+
month = "11",
|
405 |
+
year = "2019",
|
406 |
+
publisher = "Association for Computational Linguistics",
|
407 |
+
url = "https://arxiv.org/abs/1908.10084"
|
408 |
+
}
|
409 |
+
```
|
410 |
+
|
411 |
+
#### PyLate
|
412 |
+
```bibtex
|
413 |
+
@misc{PyLate,
|
414 |
+
title={PyLate: Flexible Training and Retrieval for Late Interaction Models},
|
415 |
+
author={Chaffin, Antoine and Sourty, Raphaël},
|
416 |
+
url={https://github.com/lightonai/pylate},
|
417 |
+
year={2024}
|
418 |
+
}
|
419 |
+
```
|
420 |
+
|
421 |
+
<!--
|
422 |
+
## Glossary
|
423 |
+
|
424 |
+
*Clearly define terms in order to be accessible across audiences.*
|
425 |
+
-->
|
426 |
+
|
427 |
+
<!--
|
428 |
+
## Model Card Authors
|
429 |
+
|
430 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
431 |
+
-->
|
432 |
+
|
433 |
+
<!--
|
434 |
+
## Model Card Contact
|
435 |
+
|
436 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
437 |
+
-->
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[D] ": 250003,
|
3 |
+
"[Q] ": 250002
|
4 |
+
}
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/Multilingual-MiniLM-L12-H384",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 384,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 1536,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.48.2",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 250004
|
26 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.4.1",
|
4 |
+
"transformers": "4.48.2",
|
5 |
+
"pytorch": "2.6.0+cu124"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": "MaxSim",
|
10 |
+
"query_prefix": "[Q] ",
|
11 |
+
"document_prefix": "[D] ",
|
12 |
+
"query_length": 32,
|
13 |
+
"document_length": 180,
|
14 |
+
"attend_to_expansion_tokens": false,
|
15 |
+
"skiplist_words": [
|
16 |
+
"!",
|
17 |
+
"\"",
|
18 |
+
"#",
|
19 |
+
"$",
|
20 |
+
"%",
|
21 |
+
"&",
|
22 |
+
"'",
|
23 |
+
"(",
|
24 |
+
")",
|
25 |
+
"*",
|
26 |
+
"+",
|
27 |
+
",",
|
28 |
+
"-",
|
29 |
+
".",
|
30 |
+
"/",
|
31 |
+
":",
|
32 |
+
";",
|
33 |
+
"<",
|
34 |
+
"=",
|
35 |
+
">",
|
36 |
+
"?",
|
37 |
+
"@",
|
38 |
+
"[",
|
39 |
+
"\\",
|
40 |
+
"]",
|
41 |
+
"^",
|
42 |
+
"_",
|
43 |
+
"`",
|
44 |
+
"{",
|
45 |
+
"|",
|
46 |
+
"}",
|
47 |
+
"~"
|
48 |
+
]
|
49 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:87a432834a2d6865fdfca7cd600355a8ad1f6439b671f25bbb4fb7455b018985
|
3 |
+
size 470586728
|
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_Dense",
|
12 |
+
"type": "pylate.models.Dense.Dense"
|
13 |
+
}
|
14 |
+
]
|
optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fee39847e33fdbd08d0334097f3df4b792a0e3ce63f0b9e10f48ef5c153a4a07
|
3 |
+
size 940504890
|
rng_state.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f77334d7b9762345314614e8c3476fc4ae7d3312abe431728f7b2a0a51d223ed
|
3 |
+
size 14244
|
scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b0a460653b8e10c692ff9cbf07d26bd33f15f236d0580a2321a315f40be13263
|
3 |
+
size 1064
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 179,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
sentencepiece.bpe.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
3 |
+
size 5069051
|
special_tokens_map.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": {
|
6 |
+
"content": "<mask>",
|
7 |
+
"lstrip": true,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"pad_token": "<mask>",
|
13 |
+
"sep_token": "</s>",
|
14 |
+
"unk_token": "<unk>"
|
15 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bbaf18e6f4df4b49f10d27c82632b907c43145b6abe2535f17e18059cb80fe3d
|
3 |
+
size 17098884
|
tokenizer_config.json
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"250001": {
|
36 |
+
"content": "<mask>",
|
37 |
+
"lstrip": true,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"250002": {
|
44 |
+
"content": "[Q] ",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": true,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": false
|
50 |
+
},
|
51 |
+
"250003": {
|
52 |
+
"content": "[D] ",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": true,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": false
|
58 |
+
}
|
59 |
+
},
|
60 |
+
"bos_token": "<s>",
|
61 |
+
"clean_up_tokenization_spaces": false,
|
62 |
+
"cls_token": "<s>",
|
63 |
+
"eos_token": "</s>",
|
64 |
+
"extra_special_tokens": {},
|
65 |
+
"mask_token": "<mask>",
|
66 |
+
"model_max_length": 1000000000000000019884624838656,
|
67 |
+
"pad_token": "<mask>",
|
68 |
+
"sep_token": "</s>",
|
69 |
+
"sp_model_kwargs": {},
|
70 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
71 |
+
"unk_token": "<unk>"
|
72 |
+
}
|
trainer_state.json
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 0.14034243554272424,
|
5 |
+
"eval_steps": 500,
|
6 |
+
"global_step": 7000,
|
7 |
+
"is_hyper_param_search": false,
|
8 |
+
"is_local_process_zero": true,
|
9 |
+
"is_world_process_zero": true,
|
10 |
+
"log_history": [
|
11 |
+
{
|
12 |
+
"epoch": 0.01002445968162316,
|
13 |
+
"grad_norm": 0.1908789426088333,
|
14 |
+
"learning_rate": 2.969926620955131e-05,
|
15 |
+
"loss": 0.0305,
|
16 |
+
"step": 500
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"epoch": 0.02004891936324632,
|
20 |
+
"grad_norm": 0.2333366870880127,
|
21 |
+
"learning_rate": 2.939853241910261e-05,
|
22 |
+
"loss": 0.027,
|
23 |
+
"step": 1000
|
24 |
+
},
|
25 |
+
{
|
26 |
+
"epoch": 0.03007337904486948,
|
27 |
+
"grad_norm": 0.18207737803459167,
|
28 |
+
"learning_rate": 2.9097798628653917e-05,
|
29 |
+
"loss": 0.026,
|
30 |
+
"step": 1500
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"epoch": 0.04009783872649264,
|
34 |
+
"grad_norm": 0.13153837621212006,
|
35 |
+
"learning_rate": 2.879706483820522e-05,
|
36 |
+
"loss": 0.0253,
|
37 |
+
"step": 2000
|
38 |
+
},
|
39 |
+
{
|
40 |
+
"epoch": 0.0501222984081158,
|
41 |
+
"grad_norm": 0.20580655336380005,
|
42 |
+
"learning_rate": 2.849633104775653e-05,
|
43 |
+
"loss": 0.0249,
|
44 |
+
"step": 2500
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"epoch": 0.06014675808973896,
|
48 |
+
"grad_norm": 0.16466622054576874,
|
49 |
+
"learning_rate": 2.8196198724888727e-05,
|
50 |
+
"loss": 0.0239,
|
51 |
+
"step": 3000
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"epoch": 0.07017121777136212,
|
55 |
+
"grad_norm": 0.1590748131275177,
|
56 |
+
"learning_rate": 2.7895464934440035e-05,
|
57 |
+
"loss": 0.0239,
|
58 |
+
"step": 3500
|
59 |
+
},
|
60 |
+
{
|
61 |
+
"epoch": 0.08019567745298528,
|
62 |
+
"grad_norm": 0.14150911569595337,
|
63 |
+
"learning_rate": 2.759473114399134e-05,
|
64 |
+
"loss": 0.0236,
|
65 |
+
"step": 4000
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"epoch": 0.09022013713460844,
|
69 |
+
"grad_norm": 0.09914161264896393,
|
70 |
+
"learning_rate": 2.7293997353542647e-05,
|
71 |
+
"loss": 0.0236,
|
72 |
+
"step": 4500
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"epoch": 0.1002445968162316,
|
76 |
+
"grad_norm": 0.16175945103168488,
|
77 |
+
"learning_rate": 2.6993263563093947e-05,
|
78 |
+
"loss": 0.0232,
|
79 |
+
"step": 5000
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"epoch": 0.11026905649785476,
|
83 |
+
"grad_norm": 0.14557033777236938,
|
84 |
+
"learning_rate": 2.6692529772645255e-05,
|
85 |
+
"loss": 0.0229,
|
86 |
+
"step": 5500
|
87 |
+
},
|
88 |
+
{
|
89 |
+
"epoch": 0.12029351617947792,
|
90 |
+
"grad_norm": 0.14236459136009216,
|
91 |
+
"learning_rate": 2.639179598219656e-05,
|
92 |
+
"loss": 0.0228,
|
93 |
+
"step": 6000
|
94 |
+
},
|
95 |
+
{
|
96 |
+
"epoch": 0.13031797586110108,
|
97 |
+
"grad_norm": 0.1859973669052124,
|
98 |
+
"learning_rate": 2.6091062191747867e-05,
|
99 |
+
"loss": 0.0226,
|
100 |
+
"step": 6500
|
101 |
+
},
|
102 |
+
{
|
103 |
+
"epoch": 0.14034243554272424,
|
104 |
+
"grad_norm": 0.21533679962158203,
|
105 |
+
"learning_rate": 2.5790929868880065e-05,
|
106 |
+
"loss": 0.0226,
|
107 |
+
"step": 7000
|
108 |
+
}
|
109 |
+
],
|
110 |
+
"logging_steps": 500,
|
111 |
+
"max_steps": 49878,
|
112 |
+
"num_input_tokens_seen": 0,
|
113 |
+
"num_train_epochs": 1,
|
114 |
+
"save_steps": 500,
|
115 |
+
"stateful_callbacks": {
|
116 |
+
"TrainerControl": {
|
117 |
+
"args": {
|
118 |
+
"should_epoch_stop": false,
|
119 |
+
"should_evaluate": false,
|
120 |
+
"should_log": false,
|
121 |
+
"should_save": true,
|
122 |
+
"should_training_stop": false
|
123 |
+
},
|
124 |
+
"attributes": {}
|
125 |
+
}
|
126 |
+
},
|
127 |
+
"total_flos": 0.0,
|
128 |
+
"train_batch_size": 16,
|
129 |
+
"trial_name": null,
|
130 |
+
"trial_params": null
|
131 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:83ddadab7c446e1c70096caab36841eb4033e7d6cd26f70fa7eece33bb12dd91
|
3 |
+
size 5688
|