Sentence Similarity
sentence-transformers
Safetensors
xlm-roberta
feature-extraction
Generated from Trainer
dataset_size:4858
loss:MultipleNegativesRankingLoss
text-embeddings-inference
Instructions to use Sathvik0101/srag-biencoder-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Sathvik0101/srag-biencoder-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Sathvik0101/srag-biencoder-v1") sentences = [ "I've achieved a lot in my career, but I still feel a deep sense of emptiness. I thought reaching these milestones would bring lasting satisfaction, but it hasn't. Was it all for nothing? What is my true purpose if external achievements don't fulfill me?", "abhyāsa-yoga-yuktena cetasā nānya-gāminā | paramaṃ puruṣaṃ divyaṃ yāti pārthānucintayan ||8||", "abhyāse 'py asamartho 'si mat-karma-paramo bhava | mad-artham api karmāṇi kurvan siddhim avāpsyasi ||10||", "na kartṛtvaṃ na karmāṇi lokasya sṛjati prabhuḥ | na karma-phala-saṃyogaṃ svabhāvas tu pravartate ||14||" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- 1_Pooling/config.json +5 -0
- README.md +385 -0
- config.json +30 -0
- config_sentence_transformers.json +14 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +10 -0
- tokenizer.json +3 -0
- tokenizer_config.json +24 -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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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sentence-transformers
|
| 4 |
+
- sentence-similarity
|
| 5 |
+
- feature-extraction
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
- dataset_size:4858
|
| 8 |
+
- loss:MultipleNegativesRankingLoss
|
| 9 |
+
base_model: sanganaka/bge-m3-sanskritFT
|
| 10 |
+
widget:
|
| 11 |
+
- source_sentence: I've achieved a lot in my career, but I still feel a deep sense
|
| 12 |
+
of emptiness. I thought reaching these milestones would bring lasting satisfaction,
|
| 13 |
+
but it hasn't. Was it all for nothing? What is my true purpose if external achievements
|
| 14 |
+
don't fulfill me?
|
| 15 |
+
sentences:
|
| 16 |
+
- abhyāsa-yoga-yuktena cetasā nānya-gāminā | paramaṃ puruṣaṃ divyaṃ yāti pārthānucintayan
|
| 17 |
+
||8||
|
| 18 |
+
- abhyāse 'py asamartho 'si mat-karma-paramo bhava | mad-artham api karmāṇi kurvan
|
| 19 |
+
siddhim avāpsyasi ||10||
|
| 20 |
+
- na kartṛtvaṃ na karmāṇi lokasya sṛjati prabhuḥ | na karma-phala-saṃyogaṃ svabhāvas
|
| 21 |
+
tu pravartate ||14||
|
| 22 |
+
- source_sentence: I always feel so tired and sluggish, even after a full night's
|
| 23 |
+
sleep. My mind feels foggy, and I can't concentrate at work. What can I do to
|
| 24 |
+
regain my vitality and focus?
|
| 25 |
+
sentences:
|
| 26 |
+
- ye tu dharmyāmṛtam idaṃ yathoktaṃ paryupāsate | śraddadhānā mat-paramā bhaktās
|
| 27 |
+
te 'tīva me priyāḥ ||20||
|
| 28 |
+
- āyuḥ-sattva-balārogya-sukha-prīti-vivardhanāḥ | rasyāḥ snigdhāḥ sthirā hṛdyā āhārāḥ
|
| 29 |
+
sāttvika-priyāḥ ||8||
|
| 30 |
+
- devān bhāvayatānena te devā bhāvayantu vaḥ | parasparaṃ bhāvayantaḥ śreyaḥ param
|
| 31 |
+
avāpsyatha ||11||
|
| 32 |
+
- source_sentence: I'm a working parent, constantly juggling responsibilities, and
|
| 33 |
+
I feel utterly overwhelmed and burnt out. I don't have a moment for myself, and
|
| 34 |
+
I'm losing my sense of self.
|
| 35 |
+
sentences:
|
| 36 |
+
- idaṃ jñānam upāśritya mama sādharmyam āgatāḥ | sarge 'pi nopajāyante pralaye na
|
| 37 |
+
vyathanti ca ||2||
|
| 38 |
+
- teṣām evānukampārtham aham ajñānajaṃ tamaḥ | nāśayāmy ātma-bhāva-stho jñāna-dīpena
|
| 39 |
+
bhāsvatā ||11||
|
| 40 |
+
- amānitvam adambhitvam ahiṃsā kṣāntir ārjavam | ācāryopāsanaṃ śaucaṃ sthairyam
|
| 41 |
+
ātma-vinigrahaḥ ||7|| indriyārtheṣu vairāgyam anahaṃkāra eva ca | janma-mṛtyu-jarā-vyādhi-duḥkha-doṣānudarśanam
|
| 42 |
+
||8|| asaktir anabhiṣvaṅgaḥ putra-dāra-gṛhādiṣu | nityaṃ ca sama-cittatvam iṣṭāniṣṭopapattiṣu
|
| 43 |
+
||9|| mayi cānanya-yogena bhaktir avyabhicāriṇī | vivikta-deśa-sevitvam aratir
|
| 44 |
+
jana-saṃsadi ||10|| adhyātma-jñāna-nityatvaṃ tattva-jñānārtha-darśanam | etaj
|
| 45 |
+
jñānam iti proktam ajñānaṃ yad ato 'nyathā ||11||
|
| 46 |
+
- source_sentence: I've always been so worried about what others think of me, especially
|
| 47 |
+
online. One negative comment can ruin my entire day, even if there are hundreds
|
| 48 |
+
of positive ones. How can I develop a stronger sense of self-worth that isn't
|
| 49 |
+
dependent on external validation?
|
| 50 |
+
sentences:
|
| 51 |
+
- nirmāna-mohā jita-saṅga-doṣā adhyātma-nityā vinivṛtta-kāmāḥ | dvandvair vimuktāḥ
|
| 52 |
+
sukha-duḥkha-saṃjñair gacchanty amūḍhāḥ padam avyayaṃ tat ||5||
|
| 53 |
+
- pravṛttiṃ ca nivṛttiṃ ca janā na vidur āsurāḥ | na śaucaṃ nāpi cācāro na satyaṃ
|
| 54 |
+
teṣu vidyate ||7||
|
| 55 |
+
- samaḥ śatrau ca mitre ca tathā mānāpamānayoḥ | śītoṣṇa-sukha-duḥkheṣu samaḥ saṅga-vivarjitaḥ
|
| 56 |
+
||18|| tulya-nindā-stutir maunī saṃtuṣṭo yena kenacit | aniketaḥ sthira-matir
|
| 57 |
+
bhaktimān me priyo naraḥ ||19||
|
| 58 |
+
- source_sentence: I've been grieving a significant loss for a long time, and while
|
| 59 |
+
I know I need to move forward, my thoughts constantly pull me back to the past.
|
| 60 |
+
How do I let go and find peace?
|
| 61 |
+
sentences:
|
| 62 |
+
- daivī saṃpad vimokṣāya nibandhāyāsurī matā | mā śucaḥ saṃpadaṃ daivīm abhijāto
|
| 63 |
+
'si pāṇḍava ||5||
|
| 64 |
+
- etair vimuktaḥ kaunteya tamo-dvārais tribhir naraḥ | ācaraty ātmanaḥ śreyas tato
|
| 65 |
+
yāti parāṃ gatim ||22||
|
| 66 |
+
- uddhared ātmanātmānaṃ nātmānam avasādayet | ātmaiva hy ātmano bandhur ātmaiva
|
| 67 |
+
ripur ātmanaḥ ||5||
|
| 68 |
+
pipeline_tag: sentence-similarity
|
| 69 |
+
library_name: sentence-transformers
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
# SentenceTransformer based on sanganaka/bge-m3-sanskritFT
|
| 73 |
+
|
| 74 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sanganaka/bge-m3-sanskritFT](https://huggingface.co/sanganaka/bge-m3-sanskritFT). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.
|
| 75 |
+
|
| 76 |
+
## Model Details
|
| 77 |
+
|
| 78 |
+
### Model Description
|
| 79 |
+
- **Model Type:** Sentence Transformer
|
| 80 |
+
- **Base model:** [sanganaka/bge-m3-sanskritFT](https://huggingface.co/sanganaka/bge-m3-sanskritFT) <!-- at revision bcad4d3ffe0990d09bbc07f821bbbd5050ba0530 -->
|
| 81 |
+
- **Maximum Sequence Length:** 256 tokens
|
| 82 |
+
- **Output Dimensionality:** 1024 dimensions
|
| 83 |
+
- **Similarity Function:** Cosine Similarity
|
| 84 |
+
- **Supported Modality:** Text
|
| 85 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 86 |
+
<!-- - **Language:** Unknown -->
|
| 87 |
+
<!-- - **License:** Unknown -->
|
| 88 |
+
|
| 89 |
+
### Model Sources
|
| 90 |
+
|
| 91 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 92 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
|
| 93 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 94 |
+
|
| 95 |
+
### Full Model Architecture
|
| 96 |
+
|
| 97 |
+
```
|
| 98 |
+
SentenceTransformer(
|
| 99 |
+
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
|
| 100 |
+
(1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'cls', 'include_prompt': True})
|
| 101 |
+
(2): Normalize({})
|
| 102 |
+
)
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
## Usage
|
| 106 |
+
|
| 107 |
+
### Direct Usage (Sentence Transformers)
|
| 108 |
+
|
| 109 |
+
First install the Sentence Transformers library:
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
pip install -U sentence-transformers
|
| 113 |
+
```
|
| 114 |
+
Then you can load this model and run inference.
|
| 115 |
+
```python
|
| 116 |
+
from sentence_transformers import SentenceTransformer
|
| 117 |
+
|
| 118 |
+
# Download from the 🤗 Hub
|
| 119 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
| 120 |
+
# Run inference
|
| 121 |
+
sentences = [
|
| 122 |
+
"I've been grieving a significant loss for a long time, and while I know I need to move forward, my thoughts constantly pull me back to the past. How do I let go and find peace?",
|
| 123 |
+
'uddhared ātmanātmānaṃ nātmānam avasādayet | ātmaiva hy ātmano bandhur ātmaiva ripur ātmanaḥ ||5||',
|
| 124 |
+
'etair vimuktaḥ kaunteya tamo-dvārais tribhir naraḥ | ācaraty ātmanaḥ śreyas tato yāti parāṃ gatim ||22||',
|
| 125 |
+
]
|
| 126 |
+
embeddings = model.encode(sentences)
|
| 127 |
+
print(embeddings.shape)
|
| 128 |
+
# [3, 1024]
|
| 129 |
+
|
| 130 |
+
# Get the similarity scores for the embeddings
|
| 131 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 132 |
+
print(similarities)
|
| 133 |
+
# tensor([[1.0000, 0.4964, 0.1087],
|
| 134 |
+
# [0.4964, 1.0000, 0.3406],
|
| 135 |
+
# [0.1087, 0.3406, 1.0000]])
|
| 136 |
+
```
|
| 137 |
+
<!--
|
| 138 |
+
### Direct Usage (Transformers)
|
| 139 |
+
|
| 140 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 141 |
+
|
| 142 |
+
</details>
|
| 143 |
+
-->
|
| 144 |
+
|
| 145 |
+
<!--
|
| 146 |
+
### Downstream Usage (Sentence Transformers)
|
| 147 |
+
|
| 148 |
+
You can finetune this model on your own dataset.
|
| 149 |
+
|
| 150 |
+
<details><summary>Click to expand</summary>
|
| 151 |
+
|
| 152 |
+
</details>
|
| 153 |
+
-->
|
| 154 |
+
|
| 155 |
+
<!--
|
| 156 |
+
### Out-of-Scope Use
|
| 157 |
+
|
| 158 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 159 |
+
-->
|
| 160 |
+
|
| 161 |
+
<!--
|
| 162 |
+
## Bias, Risks and Limitations
|
| 163 |
+
|
| 164 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 165 |
+
-->
|
| 166 |
+
|
| 167 |
+
<!--
|
| 168 |
+
### Recommendations
|
| 169 |
+
|
| 170 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 171 |
+
-->
|
| 172 |
+
|
| 173 |
+
## Training Details
|
| 174 |
+
|
| 175 |
+
### Training Dataset
|
| 176 |
+
|
| 177 |
+
#### Unnamed Dataset
|
| 178 |
+
|
| 179 |
+
* Size: 4,858 training samples
|
| 180 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>
|
| 181 |
+
* Approximate statistics based on the first 100 samples:
|
| 182 |
+
| | sentence_0 | sentence_1 | sentence_2 |
|
| 183 |
+
|:---------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
| 184 |
+
| type | string | string | string |
|
| 185 |
+
| modality | text | text | text |
|
| 186 |
+
| details | <ul><li>min: 18 tokens</li><li>mean: 46.5 tokens</li><li>max: 72 tokens</li></ul> | <ul><li>min: 34 tokens</li><li>mean: 66.11 tokens</li><li>max: 242 tokens</li></ul> | <ul><li>min: 42 tokens</li><li>mean: 84.2 tokens</li><li>max: 256 tokens</li></ul> |
|
| 187 |
+
* Samples:
|
| 188 |
+
| sentence_0 | sentence_1 | sentence_2 |
|
| 189 |
+
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------|
|
| 190 |
+
| <code>As a professional, I feel constantly burnt out, always chasing the next promotion or project. I've lost touch with why I even started, and joy seems like a distant memory. Is there a way to reconnect with my passion?</code> | <code>yaṃ labdhvā cāparaṃ lābhaṃ manyate nādhikaṃ tataḥ \| yasmin sthito na duḥkhena guruṇāpi vicālyate \|\|22\|\| taṃ vidyād duḥkha-saṃyoga-viyogaṃ yoga-saṃjñitam \| sa niścayena yoktavyo yogo 'nirviṇṇa-cetasā \|\|23\|\|</code> | <code>yaṃ hi na vyathayanty ete puruṣaṃ puruṣarṣabha \| sama-duḥkha-sukhaṃ dhīraṃ so 'mṛtatvāya kalpate \|\|15\|\|</code> |
|
| 191 |
+
| <code>My teenage son is rebelling and pushing me away. I feel like I'm losing him. What can I do?</code> | <code>ayaneṣu ca sarveṣu yathābhāgam avasthitāḥ \| bhīṣmam evābhirakṣantu bhavantaḥ sarva eva hi \|\|11\|\|</code> | <code>acchedyo 'yam adāhyo 'yam akledyo 'śoṣya eva ca \| nityaḥ sarva-gataḥ sthāṇur acalo 'yaṃ sanātanaḥ \|\|24\|\|</code> |
|
| 192 |
+
| <code>I'm constantly worried about the future – what if my plans fail? What if things don't go my way? This anxiety paralyzes me and prevents me from acting.</code> | <code>yajñadānatapaḥkarma na tyājyaṃ kāryam eva tat \| yajño dānaṃ tapaś caiva pāvanāni manīṣiṇām \|\|5\|\|</code> | <code>ahiṃsā samatā tuṣṭis tapo dānaṃ yaśo 'yaśaḥ \| bhavanti bhāvā bhūtānāṃ matta eva pṛthagvidhāḥ \|\|5\|\|</code> |
|
| 193 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 194 |
+
```json
|
| 195 |
+
{
|
| 196 |
+
"scale": 20.0,
|
| 197 |
+
"similarity_fct": "cos_sim",
|
| 198 |
+
"gather_across_devices": false,
|
| 199 |
+
"directions": [
|
| 200 |
+
"query_to_doc"
|
| 201 |
+
],
|
| 202 |
+
"partition_mode": "joint",
|
| 203 |
+
"hardness_mode": null,
|
| 204 |
+
"hardness_strength": 0.0
|
| 205 |
+
}
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
### Training Hyperparameters
|
| 209 |
+
#### Non-Default Hyperparameters
|
| 210 |
+
|
| 211 |
+
- `per_device_train_batch_size`: 16
|
| 212 |
+
- `num_train_epochs`: 2
|
| 213 |
+
- `per_device_eval_batch_size`: 16
|
| 214 |
+
- `multi_dataset_batch_sampler`: round_robin
|
| 215 |
+
|
| 216 |
+
#### All Hyperparameters
|
| 217 |
+
<details><summary>Click to expand</summary>
|
| 218 |
+
|
| 219 |
+
- `per_device_train_batch_size`: 16
|
| 220 |
+
- `num_train_epochs`: 2
|
| 221 |
+
- `max_steps`: -1
|
| 222 |
+
- `learning_rate`: 5e-05
|
| 223 |
+
- `lr_scheduler_type`: linear
|
| 224 |
+
- `lr_scheduler_kwargs`: None
|
| 225 |
+
- `warmup_steps`: 0
|
| 226 |
+
- `optim`: adamw_torch_fused
|
| 227 |
+
- `optim_args`: None
|
| 228 |
+
- `weight_decay`: 0.0
|
| 229 |
+
- `adam_beta1`: 0.9
|
| 230 |
+
- `adam_beta2`: 0.999
|
| 231 |
+
- `adam_epsilon`: 1e-08
|
| 232 |
+
- `optim_target_modules`: None
|
| 233 |
+
- `gradient_accumulation_steps`: 1
|
| 234 |
+
- `average_tokens_across_devices`: True
|
| 235 |
+
- `max_grad_norm`: 1
|
| 236 |
+
- `label_smoothing_factor`: 0.0
|
| 237 |
+
- `bf16`: False
|
| 238 |
+
- `fp16`: False
|
| 239 |
+
- `bf16_full_eval`: False
|
| 240 |
+
- `fp16_full_eval`: False
|
| 241 |
+
- `tf32`: None
|
| 242 |
+
- `gradient_checkpointing`: False
|
| 243 |
+
- `gradient_checkpointing_kwargs`: None
|
| 244 |
+
- `torch_compile`: False
|
| 245 |
+
- `torch_compile_backend`: None
|
| 246 |
+
- `torch_compile_mode`: None
|
| 247 |
+
- `use_liger_kernel`: False
|
| 248 |
+
- `liger_kernel_config`: None
|
| 249 |
+
- `use_cache`: False
|
| 250 |
+
- `neftune_noise_alpha`: None
|
| 251 |
+
- `torch_empty_cache_steps`: None
|
| 252 |
+
- `auto_find_batch_size`: False
|
| 253 |
+
- `log_on_each_node`: True
|
| 254 |
+
- `logging_nan_inf_filter`: True
|
| 255 |
+
- `include_num_input_tokens_seen`: no
|
| 256 |
+
- `log_level`: passive
|
| 257 |
+
- `log_level_replica`: warning
|
| 258 |
+
- `disable_tqdm`: False
|
| 259 |
+
- `project`: huggingface
|
| 260 |
+
- `trackio_space_id`: None
|
| 261 |
+
- `trackio_bucket_id`: None
|
| 262 |
+
- `trackio_static_space_id`: None
|
| 263 |
+
- `per_device_eval_batch_size`: 16
|
| 264 |
+
- `prediction_loss_only`: True
|
| 265 |
+
- `eval_on_start`: False
|
| 266 |
+
- `eval_do_concat_batches`: True
|
| 267 |
+
- `eval_use_gather_object`: False
|
| 268 |
+
- `eval_accumulation_steps`: None
|
| 269 |
+
- `include_for_metrics`: []
|
| 270 |
+
- `batch_eval_metrics`: False
|
| 271 |
+
- `save_only_model`: False
|
| 272 |
+
- `save_on_each_node`: False
|
| 273 |
+
- `enable_jit_checkpoint`: False
|
| 274 |
+
- `push_to_hub`: False
|
| 275 |
+
- `hub_private_repo`: None
|
| 276 |
+
- `hub_model_id`: None
|
| 277 |
+
- `hub_strategy`: every_save
|
| 278 |
+
- `hub_always_push`: False
|
| 279 |
+
- `hub_revision`: None
|
| 280 |
+
- `load_best_model_at_end`: False
|
| 281 |
+
- `ignore_data_skip`: False
|
| 282 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 283 |
+
- `full_determinism`: False
|
| 284 |
+
- `seed`: 42
|
| 285 |
+
- `data_seed`: None
|
| 286 |
+
- `use_cpu`: False
|
| 287 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 288 |
+
- `parallelism_config`: None
|
| 289 |
+
- `dataloader_drop_last`: False
|
| 290 |
+
- `dataloader_num_workers`: 0
|
| 291 |
+
- `dataloader_pin_memory`: True
|
| 292 |
+
- `dataloader_persistent_workers`: False
|
| 293 |
+
- `dataloader_prefetch_factor`: None
|
| 294 |
+
- `remove_unused_columns`: True
|
| 295 |
+
- `label_names`: None
|
| 296 |
+
- `train_sampling_strategy`: random
|
| 297 |
+
- `length_column_name`: length
|
| 298 |
+
- `ddp_find_unused_parameters`: None
|
| 299 |
+
- `ddp_bucket_cap_mb`: None
|
| 300 |
+
- `ddp_broadcast_buffers`: False
|
| 301 |
+
- `ddp_static_graph`: None
|
| 302 |
+
- `ddp_backend`: None
|
| 303 |
+
- `ddp_timeout`: 1800
|
| 304 |
+
- `fsdp`: None
|
| 305 |
+
- `fsdp_config`: None
|
| 306 |
+
- `deepspeed`: None
|
| 307 |
+
- `debug`: []
|
| 308 |
+
- `skip_memory_metrics`: True
|
| 309 |
+
- `do_predict`: False
|
| 310 |
+
- `resume_from_checkpoint`: None
|
| 311 |
+
- `warmup_ratio`: None
|
| 312 |
+
- `local_rank`: -1
|
| 313 |
+
- `prompts`: None
|
| 314 |
+
- `batch_sampler`: batch_sampler
|
| 315 |
+
- `multi_dataset_batch_sampler`: round_robin
|
| 316 |
+
- `router_mapping`: {}
|
| 317 |
+
- `learning_rate_mapping`: {}
|
| 318 |
+
|
| 319 |
+
</details>
|
| 320 |
+
|
| 321 |
+
### Training Logs
|
| 322 |
+
| Epoch | Step | Training Loss |
|
| 323 |
+
|:------:|:----:|:-------------:|
|
| 324 |
+
| 1.6447 | 500 | 2.8599 |
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
### Training Time
|
| 328 |
+
- **Training**: 10.0 minutes
|
| 329 |
+
|
| 330 |
+
### Framework Versions
|
| 331 |
+
- Python: 3.11.12
|
| 332 |
+
- Sentence Transformers: 5.5.1
|
| 333 |
+
- Transformers: 5.12.1
|
| 334 |
+
- PyTorch: 2.12.0+cu130
|
| 335 |
+
- Accelerate: 1.14.0
|
| 336 |
+
- Datasets: 5.0.0
|
| 337 |
+
- Tokenizers: 0.22.2
|
| 338 |
+
|
| 339 |
+
## Citation
|
| 340 |
+
|
| 341 |
+
### BibTeX
|
| 342 |
+
|
| 343 |
+
#### Sentence Transformers
|
| 344 |
+
```bibtex
|
| 345 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 346 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 347 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 348 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 349 |
+
month = "11",
|
| 350 |
+
year = "2019",
|
| 351 |
+
publisher = "Association for Computational Linguistics",
|
| 352 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 353 |
+
}
|
| 354 |
+
```
|
| 355 |
+
|
| 356 |
+
#### MultipleNegativesRankingLoss
|
| 357 |
+
```bibtex
|
| 358 |
+
@misc{oord2019representationlearningcontrastivepredictive,
|
| 359 |
+
title={Representation Learning with Contrastive Predictive Coding},
|
| 360 |
+
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
|
| 361 |
+
year={2019},
|
| 362 |
+
eprint={1807.03748},
|
| 363 |
+
archivePrefix={arXiv},
|
| 364 |
+
primaryClass={cs.LG},
|
| 365 |
+
url={https://arxiv.org/abs/1807.03748},
|
| 366 |
+
}
|
| 367 |
+
```
|
| 368 |
+
|
| 369 |
+
<!--
|
| 370 |
+
## Glossary
|
| 371 |
+
|
| 372 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 373 |
+
-->
|
| 374 |
+
|
| 375 |
+
<!--
|
| 376 |
+
## Model Card Authors
|
| 377 |
+
|
| 378 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 379 |
+
-->
|
| 380 |
+
|
| 381 |
+
<!--
|
| 382 |
+
## Model Card Contact
|
| 383 |
+
|
| 384 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 385 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"XLMRobertaModel"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 1024,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 4096,
|
| 16 |
+
"is_decoder": false,
|
| 17 |
+
"layer_norm_eps": 1e-05,
|
| 18 |
+
"max_position_embeddings": 8194,
|
| 19 |
+
"model_type": "xlm-roberta",
|
| 20 |
+
"num_attention_heads": 16,
|
| 21 |
+
"num_hidden_layers": 24,
|
| 22 |
+
"output_past": true,
|
| 23 |
+
"pad_token_id": 1,
|
| 24 |
+
"position_embedding_type": "absolute",
|
| 25 |
+
"tie_word_embeddings": true,
|
| 26 |
+
"transformers_version": "5.12.1",
|
| 27 |
+
"type_vocab_size": 1,
|
| 28 |
+
"use_cache": false,
|
| 29 |
+
"vocab_size": 250002
|
| 30 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"pytorch": "2.12.0+cu130",
|
| 4 |
+
"sentence_transformers": "5.5.1",
|
| 5 |
+
"transformers": "5.12.1"
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"model_type": "SentenceTransformer",
|
| 9 |
+
"prompts": {
|
| 10 |
+
"document": "",
|
| 11 |
+
"query": ""
|
| 12 |
+
},
|
| 13 |
+
"similarity_fn_name": "cosine"
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf54045e0b3e5bdda6e596814d3bd1941476f83a7c9c30d09760aa58374ff87d
|
| 3 |
+
size 2271064456
|
modules.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.base.modules.transformer.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"idx": 2,
|
| 16 |
+
"name": "2",
|
| 17 |
+
"path": "2_Normalize",
|
| 18 |
+
"type": "sentence_transformers.sentence_transformer.modules.normalize.Normalize"
|
| 19 |
+
}
|
| 20 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformer_task": "feature-extraction",
|
| 3 |
+
"modality_config": {
|
| 4 |
+
"text": {
|
| 5 |
+
"method": "forward",
|
| 6 |
+
"method_output_name": "last_hidden_state"
|
| 7 |
+
}
|
| 8 |
+
},
|
| 9 |
+
"module_output_name": "token_embeddings"
|
| 10 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a514807cffabd8abaf028cfaffe7ff0c4f60b97ea2db80c41f14172ae6b018ca
|
| 3 |
+
size 17082987
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": true,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"clean_up_tokenization_spaces": true,
|
| 6 |
+
"cls_token": "<s>",
|
| 7 |
+
"eos_token": "</s>",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"max_length": 8192,
|
| 12 |
+
"model_max_length": 256,
|
| 13 |
+
"pad_to_multiple_of": null,
|
| 14 |
+
"pad_token": "<pad>",
|
| 15 |
+
"pad_token_type_id": 0,
|
| 16 |
+
"padding_side": "right",
|
| 17 |
+
"sep_token": "</s>",
|
| 18 |
+
"sp_model_kwargs": {},
|
| 19 |
+
"stride": 0,
|
| 20 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
| 21 |
+
"truncation_side": "right",
|
| 22 |
+
"truncation_strategy": "longest_first",
|
| 23 |
+
"unk_token": "<unk>"
|
| 24 |
+
}
|