FareedKhan
commited on
Commit
•
08d0564
1
Parent(s):
fb025a8
Add new SentenceTransformer model.
Browse files- .gitattributes +1 -0
- 1_Pooling/config.json +10 -0
- README.md +140 -0
- added_tokens.json +4 -0
- config.json +28 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +55 -0
- tokenizer.json +3 -0
- tokenizer_config.json +74 -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_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 1024,
|
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,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: sentence-transformers
|
3 |
+
pipeline_tag: sentence-similarity
|
4 |
+
tags:
|
5 |
+
- sentence-transformers
|
6 |
+
- sentence-similarity
|
7 |
+
- feature-extraction
|
8 |
+
---
|
9 |
+
|
10 |
+
# SentenceTransformer
|
11 |
+
|
12 |
+
This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
### Model Description
|
17 |
+
- **Model Type:** Sentence Transformer
|
18 |
+
<!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
|
19 |
+
- **Maximum Sequence Length:** 512 tokens
|
20 |
+
- **Output Dimensionality:** 1024 tokens
|
21 |
+
- **Similarity Function:** Cosine Similarity
|
22 |
+
<!-- - **Training Dataset:** Unknown -->
|
23 |
+
<!-- - **Language:** Unknown -->
|
24 |
+
<!-- - **License:** Unknown -->
|
25 |
+
|
26 |
+
### Model Sources
|
27 |
+
|
28 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
29 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
30 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
31 |
+
|
32 |
+
### Full Model Architecture
|
33 |
+
|
34 |
+
```
|
35 |
+
SentenceTransformer(
|
36 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
|
37 |
+
(1): Pooling({'word_embedding_dimension': 1024, '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})
|
38 |
+
)
|
39 |
+
```
|
40 |
+
|
41 |
+
## Usage
|
42 |
+
|
43 |
+
### Direct Usage (Sentence Transformers)
|
44 |
+
|
45 |
+
First install the Sentence Transformers library:
|
46 |
+
|
47 |
+
```bash
|
48 |
+
pip install -U sentence-transformers
|
49 |
+
```
|
50 |
+
|
51 |
+
Then you can load this model and run inference.
|
52 |
+
```python
|
53 |
+
from sentence_transformers import SentenceTransformer
|
54 |
+
|
55 |
+
# Download from the 🤗 Hub
|
56 |
+
model = SentenceTransformer("FareedKhan/mx_bai_test_full_2")
|
57 |
+
# Run inference
|
58 |
+
sentences = [
|
59 |
+
'The weather is lovely today.',
|
60 |
+
"It's so sunny outside!",
|
61 |
+
'He drove to the stadium.',
|
62 |
+
]
|
63 |
+
embeddings = model.encode(sentences)
|
64 |
+
print(embeddings.shape)
|
65 |
+
# [3, 1024]
|
66 |
+
|
67 |
+
# Get the similarity scores for the embeddings
|
68 |
+
similarities = model.similarity(embeddings, embeddings)
|
69 |
+
print(similarities.shape)
|
70 |
+
# [3, 3]
|
71 |
+
```
|
72 |
+
|
73 |
+
<!--
|
74 |
+
### Direct Usage (Transformers)
|
75 |
+
|
76 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
77 |
+
|
78 |
+
</details>
|
79 |
+
-->
|
80 |
+
|
81 |
+
<!--
|
82 |
+
### Downstream Usage (Sentence Transformers)
|
83 |
+
|
84 |
+
You can finetune this model on your own dataset.
|
85 |
+
|
86 |
+
<details><summary>Click to expand</summary>
|
87 |
+
|
88 |
+
</details>
|
89 |
+
-->
|
90 |
+
|
91 |
+
<!--
|
92 |
+
### Out-of-Scope Use
|
93 |
+
|
94 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
95 |
+
-->
|
96 |
+
|
97 |
+
<!--
|
98 |
+
## Bias, Risks and Limitations
|
99 |
+
|
100 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
101 |
+
-->
|
102 |
+
|
103 |
+
<!--
|
104 |
+
### Recommendations
|
105 |
+
|
106 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
107 |
+
-->
|
108 |
+
|
109 |
+
## Training Details
|
110 |
+
|
111 |
+
### Framework Versions
|
112 |
+
- Python: 3.10.12
|
113 |
+
- Sentence Transformers: 3.2.0
|
114 |
+
- Transformers: 4.44.2
|
115 |
+
- PyTorch: 2.4.1+cu121
|
116 |
+
- Accelerate: 0.34.2
|
117 |
+
- Datasets:
|
118 |
+
- Tokenizers: 0.19.1
|
119 |
+
|
120 |
+
## Citation
|
121 |
+
|
122 |
+
### BibTeX
|
123 |
+
|
124 |
+
<!--
|
125 |
+
## Glossary
|
126 |
+
|
127 |
+
*Clearly define terms in order to be accessible across audiences.*
|
128 |
+
-->
|
129 |
+
|
130 |
+
<!--
|
131 |
+
## Model Card Authors
|
132 |
+
|
133 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
134 |
+
-->
|
135 |
+
|
136 |
+
<!--
|
137 |
+
## Model Card Contact
|
138 |
+
|
139 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
140 |
+
-->
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[MXBAI_P]": 178884,
|
3 |
+
"[MXBAI_Q]": 178883
|
4 |
+
}
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models/full",
|
3 |
+
"architectures": [
|
4 |
+
"XLMRobertaModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 1024,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 4096,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 514,
|
17 |
+
"model_type": "xlm-roberta",
|
18 |
+
"num_attention_heads": 16,
|
19 |
+
"num_hidden_layers": 24,
|
20 |
+
"output_past": true,
|
21 |
+
"pad_token_id": 1,
|
22 |
+
"position_embedding_type": "absolute",
|
23 |
+
"torch_dtype": "float32",
|
24 |
+
"transformers_version": "4.44.2",
|
25 |
+
"type_vocab_size": 1,
|
26 |
+
"use_cache": false,
|
27 |
+
"vocab_size": 178885
|
28 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.2.0",
|
4 |
+
"transformers": "4.44.2",
|
5 |
+
"pytorch": "2.4.1+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc86ff649c52f78abf74d226e8d13467059bebdba2ebadf8a5271efbd2811235
|
3 |
+
size 1948311760
|
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 |
+
}
|
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,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"[MXBAI_Q]",
|
4 |
+
"[MXBAI_P]"
|
5 |
+
],
|
6 |
+
"bos_token": {
|
7 |
+
"content": "<s>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false
|
12 |
+
},
|
13 |
+
"cls_token": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"eos_token": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false
|
26 |
+
},
|
27 |
+
"mask_token": {
|
28 |
+
"content": "<mask>",
|
29 |
+
"lstrip": true,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false
|
33 |
+
},
|
34 |
+
"pad_token": {
|
35 |
+
"content": "<pad>",
|
36 |
+
"lstrip": false,
|
37 |
+
"normalized": false,
|
38 |
+
"rstrip": false,
|
39 |
+
"single_word": false
|
40 |
+
},
|
41 |
+
"sep_token": {
|
42 |
+
"content": "</s>",
|
43 |
+
"lstrip": false,
|
44 |
+
"normalized": false,
|
45 |
+
"rstrip": false,
|
46 |
+
"single_word": false
|
47 |
+
},
|
48 |
+
"unk_token": {
|
49 |
+
"content": "<unk>",
|
50 |
+
"lstrip": false,
|
51 |
+
"normalized": false,
|
52 |
+
"rstrip": false,
|
53 |
+
"single_word": false
|
54 |
+
}
|
55 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b319c37e4f1e5f8f1c8dba7e1bc7b1a424184365d7f982ada0f18ab60c514c07
|
3 |
+
size 12283980
|
tokenizer_config.json
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"178882": {
|
36 |
+
"content": "<mask>",
|
37 |
+
"lstrip": true,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"178883": {
|
44 |
+
"content": "[MXBAI_Q]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"178884": {
|
52 |
+
"content": "[MXBAI_P]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
}
|
59 |
+
},
|
60 |
+
"additional_special_tokens": [
|
61 |
+
"[MXBAI_Q]",
|
62 |
+
"[MXBAI_P]"
|
63 |
+
],
|
64 |
+
"bos_token": "<s>",
|
65 |
+
"clean_up_tokenization_spaces": true,
|
66 |
+
"cls_token": "<s>",
|
67 |
+
"eos_token": "</s>",
|
68 |
+
"mask_token": "<mask>",
|
69 |
+
"model_max_length": 512,
|
70 |
+
"pad_token": "<pad>",
|
71 |
+
"sep_token": "</s>",
|
72 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
73 |
+
"unk_token": "<unk>"
|
74 |
+
}
|