rvo commited on
Commit
8bddb8b
·
verified ·
1 Parent(s): d8c82d3

Upload 25 files

Browse files
README.md CHANGED
@@ -1,3 +1,209 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: microsoft/MiniLM-L6-v2
4
+ tags:
5
+ - transformers
6
+ - sentence-transformers
7
+ - sentence-similarity
8
+ - feature-extraction
9
+ - text-embeddings-inference
10
+ - information-retrieval
11
+ - knowledge-distillation
12
+ language:
13
+ - en
14
+ ---
15
+
16
+ <div style="display: flex; justify-content: center;">
17
+ <div style="display: flex; align-items: center; gap: 10px;">
18
+ <img src="logo.webp" alt="MongoDB Logo" style="height: 36px; width: auto; border-radius: 4px;">
19
+ <span style="font-size: 32px; font-weight: bold">MongoDB/mdbr-leaf-ir-asym</span>
20
+ </div>
21
+ </div>
22
+
23
+ # Content
24
+
25
+ 1. [Introduction](#introduction)
26
+ 2. [Technical Report](#technical-report)
27
+ 3. [Highlights](#highlights)
28
+ 4. [Benchmarks](#benchmark-comparison)
29
+ 5. [Quickstart](#quickstart)
30
+ 6. [Citation](#citation)
31
+
32
+ # Introduction
33
+
34
+ `mdbr-leaf-ir-asym` is a compact high-performance text embedding model specifically designed for **information retrieval (IR)** tasks, e.g., the retrieval stage of Retrieval-Augmented Generation (RAG) pipelines.
35
+
36
+ This model is the asymmetric variant of [`mdbr-leaf-ir`](https://huggingface.co/MongoDB/mdbr-leaf-ir), which uses `mdbr-leaf-ir` for queries and [`Snowflake/snowflake-arctic-embed-m-v1.5`](https://huggingface.co/Snowflake/snowflake-arctic-embed-m-v1.5) for documents. The model is robust to [vector quantization](#vector-quantization) and [MRL truncation](#mrl-truncation).
37
+
38
+ If you are looking to perform other tasks such as classification, clustering, semantic sentence similarity, summarization, please check out our [`mdbr-leaf-mt`](https://huggingface.co/MongoDB/mdbr-leaf-mt) model.
39
+
40
+ > [!Note]
41
+ > **Note**: this model has been developed by the ML team of MongoDB Research. At the time of writing it is not used in any of MongoDB's commercial product or service offerings.
42
+
43
+ # Technical Report
44
+
45
+ A technical report detailing our proposed `LEAF` training procedure is [available here](https://arxiv.org/abs/2509.12539).
46
+
47
+ # Highlights
48
+
49
+ * **State-of-the-Art Performance**: `mdbr-leaf-ir-asym` achieves state-of-the-art results for compact embedding models, **ranking #1** on the public [BEIR benchmark leaderboard](https://huggingface.co/spaces/mteb/leaderboard) for models with ≤100M parameters.
50
+ * **Flexible Architecture Support**: `mdbr-leaf-ir-asym` uses an asymmetric retrieval architecture enabling even greater retrieval results.
51
+ * **MRL and Quantization Support**: embedding vectors generated by `mdbr-leaf-ir-asym` compress well when truncated (MRL) and can be stored using more efficient types like `int8` and `binary`. [See below](#mrl-truncation) for more information.
52
+
53
+ ## Benchmark Comparison
54
+
55
+ The table below shows the average BEIR benchmark scores (nDCG@10) for `mdbr-leaf-ir-asym` compared to other retrieval models.
56
+
57
+ `mdbr-leaf-ir` ranks #1 on the BEIR public leaderboard, and when run in asymmetric "**(asym.)**" mode, the results improve even further.
58
+
59
+ | Model | Size | BEIR Avg. (nDCG@10) |
60
+ |------------------------------------|---------|----------------------|
61
+ | OpenAI text-embedding-3-large | Unknown | 55.43 |
62
+ | **mdbr-leaf-ir (asym.)** | 23M | **54.03** |
63
+ | **mdbr-leaf-ir** | 23M | **53.55** |
64
+ | snowflake-arctic-embed-s | 32M | 51.98 |
65
+ | bge-small-en-v1.5 | 33M | 51.65 |
66
+ | OpenAI text-embedding-3-small | Unknown | 51.08 |
67
+ | granite-embedding-small-english-r2 | 47M | 50.87 |
68
+ | snowflake-arctic-embed-xs | 23M | 50.15 |
69
+ | e5-small-v2 | 33M | 49.04 |
70
+ | SPLADE++ | 110M | 48.88 |
71
+ | MiniLM-L6-v2 | 23M | 41.95 |
72
+ | BM25 | – | 41.14 |
73
+
74
+ # Quickstart
75
+
76
+ ## Sentence Transformers
77
+
78
+ ```python
79
+ from sentence_transformers import SentenceTransformer
80
+
81
+ # Load the model
82
+ model = SentenceTransformer("MongoDB/mdbr-leaf-ir-asym")
83
+
84
+ # Example queries and documents
85
+ queries = [
86
+ "What is machine learning?",
87
+ "How does neural network training work?",
88
+ ]
89
+
90
+ documents = [
91
+ "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn from data.",
92
+ "Neural networks are trained through backpropagation, adjusting weights to minimize prediction errors.",
93
+ ]
94
+
95
+ # Encode queries and documents
96
+ query_embeddings = model.encode_query(queries)
97
+ document_embeddings = model.encode_document(documents)
98
+
99
+ # Compute similarity scores
100
+ scores = model.similarity(query_embeddings, document_embeddings)
101
+
102
+ # Print results
103
+ for i, query in enumerate(queries):
104
+ print(f"Query: {query}")
105
+ for j, doc in enumerate(documents):
106
+ print(f" Similarity: {scores[i, j]:.4f} | Document {j}: {doc[:80]}...")
107
+
108
+ # Query: What is machine learning?
109
+ # Similarity: 0.6729 | Document 0: Machine learning is a subset of artificial intelligence that focuses on algorith...
110
+ # Similarity: 0.4472 | Document 1: Neural networks are trained through backpropagation, adjusting weights to minimi...
111
+
112
+ # Query: How does neural network training work?
113
+ # Similarity: 0.4080 | Document 0: Machine learning is a subset of artificial intelligence that focuses on algorith...
114
+ # Similarity: 0.5477 | Document 1: Neural networks are trained through backpropagation, adjusting weights to minimi...
115
+ ```
116
+
117
+ ## Transformers Usage
118
+
119
+ See full example notebook [here](https://huggingface.co/MongoDB/mdbr-leaf-ir/blob/main/transformers_example.ipynb).
120
+
121
+ ## Asymmetric Retrieval Setup
122
+
123
+ `mdbr-leaf-ir` is *aligned* to [`snowflake-arctic-embed-m-v1.5`](https://huggingface.co/Snowflake/snowflake-arctic-embed-m-v1.5), the model it has been distilled from. This enables flexible architectures in which, for example, documents are encoded using the larger model, while queries can be encoded faster and more efficiently with the compact `leaf` model. This generally outperforms the symmetric setup in which both queries and documents are encoded with `leaf`.
124
+
125
+ To use exclusively the leaf model, use [`mdbr-leaf-ir`](https://huggingface.co/MongoDB/mdbr-leaf-ir).
126
+
127
+ ## MRL Truncation
128
+
129
+ Embeddings have been trained via [MRL](https://arxiv.org/abs/2205.13147) and can be truncated for more efficient storage:
130
+ ```python
131
+ query_embeds = model.encode_query(queries, truncate_dim=256)
132
+ doc_embeds = model.encode_document(documents, truncate_dim=256)
133
+
134
+ similarities = model.similarity(query_embeds, doc_embeds)
135
+
136
+ print('After MRL:')
137
+ print(f"* Embeddings dimension: {query_embeds.shape[1]}")
138
+ print(f"* Similarities:\n{similarities}")
139
+
140
+ # * Embeddings dimension: 256
141
+ # * Similarities:
142
+ # tensor([[0.7027, 0.4943],
143
+ # [0.4388, 0.5820]])
144
+ ```
145
+
146
+ ## Vector Quantization
147
+ Vector quantization, for example to `int8` or `binary`, can be performed as follows:
148
+
149
+ **Note**: For vector quantization to types other than binary, we suggest performing a calibration to determine the optimal ranges, [see here](https://sbert.net/examples/sentence_transformer/applications/embedding-quantization/README.html#scalar-int8-quantization).
150
+ Good initial values, according to the [teacher model's documentation](https://huggingface.co/Snowflake/snowflake-arctic-embed-m-v1.5#compressing-to-128-bytes), are:
151
+ * `int8`: -0.3 and +0.3
152
+ * `int4`: -0.18 and +0.18
153
+ ```python
154
+ from sentence_transformers.quantization import quantize_embeddings
155
+ import torch
156
+
157
+ query_embeds = model.encode(queries, prompt_name="query")
158
+ doc_embeds = model.encode(documents)
159
+
160
+ # Quantize embeddings to int8 using -0.3 and +0.3 as calibration ranges
161
+ ranges = torch.tensor([[-0.3], [+0.3]]).expand(2, query_embeds.shape[1]).cpu().numpy()
162
+ query_embeds = quantize_embeddings(query_embeds, "int8", ranges=ranges)
163
+ doc_embeds = quantize_embeddings(doc_embeds, "int8", ranges=ranges)
164
+
165
+ # Calculate similarities; cast to int64 to avoid under/overflow
166
+ similarities = query_embeds.astype(int) @ doc_embeds.astype(int).T
167
+
168
+ print('After quantization:')
169
+ print(f"* Embeddings type: {query_embeds.dtype}")
170
+ print(f"* Similarities:\n{similarities}")
171
+
172
+ # After quantization:
173
+ # * Embeddings type: int8
174
+ # * Similarities:
175
+ # [[118022 79111]
176
+ # [ 72961 98333]]
177
+ ```
178
+
179
+ # Evaluation
180
+
181
+ Please [see here](https://huggingface.co/MongoDB/mdbr-leaf-ir/blob/main/evaluate_models.ipynb).
182
+
183
+ # Citation
184
+
185
+ If you use this model in your work, please cite:
186
+
187
+ ```bibtex
188
+ @misc{mdbr_leaf,
189
+ title={LEAF: Knowledge Distillation of Text Embedding Models with Teacher-Aligned Representations},
190
+ author={Robin Vujanic and Thomas Rueckstiess},
191
+ year={2025},
192
+ eprint={2509.12539},
193
+ archivePrefix={arXiv},
194
+ primaryClass={cs.IR},
195
+ url={https://arxiv.org/abs/2509.12539},
196
+ }
197
+ ```
198
+
199
+ # License
200
+
201
+ This model is released under Apache 2.0 License.
202
+
203
+ # Contact
204
+
205
+ For questions or issues, please open an issue or pull request. You can also contact the MongoDB ML research team at [email protected].
206
+
207
+ # Acknowledgments
208
+
209
+ This model was created by @tomaarsen - we thank him for his contribution to this project.
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SentenceTransformer",
3
+ "__version__": {
4
+ "sentence_transformers": "5.1.0",
5
+ "transformers": "4.56.1",
6
+ "pytorch": "2.8.0+cu126"
7
+ },
8
+ "prompts": {
9
+ "query": "Represent this sentence for searching relevant passages: ",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
document_0_Transformer/config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-12,
15
+ "matryoshka_dimensions": [
16
+ 256
17
+ ],
18
+ "max_position_embeddings": 512,
19
+ "model_type": "bert",
20
+ "num_attention_heads": 12,
21
+ "num_hidden_layers": 12,
22
+ "pad_token_id": 0,
23
+ "position_embedding_type": "absolute",
24
+ "transformers_version": "4.56.1",
25
+ "type_vocab_size": 2,
26
+ "use_cache": true,
27
+ "vocab_size": 30522
28
+ }
document_0_Transformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbc309c04977a2cfd24bc111354eeb102ade3eaf2e881d4edc8b99d67725660f
3
+ size 134
document_0_Transformer/sentence_bert_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false,
4
+ "model_args": {
5
+ "add_pooling_layer": false
6
+ }
7
+ }
document_0_Transformer/special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
document_0_Transformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
document_0_Transformer/tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "max_length": 512,
50
+ "model_max_length": 512,
51
+ "pad_to_multiple_of": null,
52
+ "pad_token": "[PAD]",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
+ "sep_token": "[SEP]",
56
+ "stride": 0,
57
+ "strip_accents": null,
58
+ "tokenize_chinese_chars": true,
59
+ "tokenizer_class": "BertTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
+ "unk_token": "[UNK]"
63
+ }
document_0_Transformer/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
document_1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
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
+ }
logo.png ADDED
logo.webp ADDED
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Router"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Normalize",
12
+ "type": "sentence_transformers.models.Normalize"
13
+ }
14
+ ]
query_0_Transformer/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 384,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 6,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.56.1",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
query_0_Transformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad488006ff63f39aa5a080ba7ceb59174e0c8d2e42ffe6d1dec42d19a48787b4
3
+ size 133
query_0_Transformer/sentence_bert_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false,
4
+ "model_args": {
5
+ "add_pooling_layer": false
6
+ }
7
+ }
query_0_Transformer/special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
query_0_Transformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
query_0_Transformer/tokenizer_config.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 128,
51
+ "model_max_length": 512,
52
+ "never_split": null,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]"
65
+ }
query_0_Transformer/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
query_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
+ }
query_2_Dense/config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "in_features": 384,
3
+ "out_features": 768,
4
+ "bias": true,
5
+ "activation_function": "torch.nn.modules.linear.Identity"
6
+ }
query_2_Dense/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1881669a55f4e4bb33b715c522020fc322f2bc4cf2a96ec9a327b902cff0d582
3
+ size 132
router_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "types": {
3
+ "query_0_Transformer": "sentence_transformers.models.Transformer.Transformer",
4
+ "query_1_Pooling": "sentence_transformers.models.Pooling.Pooling",
5
+ "query_2_Dense": "sentence_transformers.models.Dense.Dense",
6
+ "document_0_Transformer": "sentence_transformers.models.Transformer.Transformer",
7
+ "document_1_Pooling": "sentence_transformers.models.Pooling.Pooling"
8
+ },
9
+ "structure": {
10
+ "query": [
11
+ "query_0_Transformer",
12
+ "query_1_Pooling",
13
+ "query_2_Dense"
14
+ ],
15
+ "document": [
16
+ "document_0_Transformer",
17
+ "document_1_Pooling"
18
+ ]
19
+ },
20
+ "parameters": {
21
+ "default_route": "document",
22
+ "allow_empty_key": true
23
+ }
24
+ }