rizwan3d commited on
Commit
1629152
·
verified ·
1 Parent(s): dfdd922

Update TinyE5 main model files

Browse files
Files changed (5) hide show
  1. README.md +31 -22
  2. config.json +30 -25
  3. embedding_config.json +10 -10
  4. model.safetensors +3 -0
  5. tokenizer_config.json +24 -65
README.md CHANGED
@@ -66,31 +66,40 @@ where model size, CPU latency, and deployment efficiency matter.
66
 
67
  | Model | Size | STS Spearman ↑ | SciFact Recall@10 ↑ | SciFact nDCG@10 ↑ |
68
  | ------------------------------- | ----------: | -------------: | ------------------: | ----------------: |
69
- | **TinyE5-L6-384 (Safetensors)** | 86.7 MB | 0.8138 | 0.7148 | 0.5701 |
70
- | **TinyE5-L6-384 (FP32 ONNX)** | 86.2 MB | 0.8138 | 0.7148 | 0.5701 |
71
- | **TinyE5-L6-384 (INT8 ONNX)** | **21.8 MB** | 0.8070 | 0.7259 | 0.5791 |
72
- | E5-small-v2 | 133 MB | **0.8574** | **0.8093** | **0.6797** |
73
 
74
  ### CPU Inference Performance
75
 
76
- | Model | Precision | Size | Latency ↓ | Throughput ↑ |
77
- | ---------------------- | --------- | ----------: | ---------------: | ----------------: |
78
- | TinyE5-L6-384 ONNX | FP32 | 86.2 MB | 3.65 ms/text | 274.3 texts/s |
79
- | **TinyE5-L6-384 ONNX** | **INT8** | **21.8 MB** | **2.65 ms/text** | **377.7 texts/s** |
80
 
81
  ### INT8 vs FP32 ONNX
82
 
83
- | Metric | FP32 | INT8 | Change |
84
- | ----------------- | ------------: | ----------------: | ---------------: |
85
- | Model size | 86.2 MB | **21.8 MB** | **~75% smaller** |
86
- | CPU latency | 3.65 ms/text | **2.65 ms/text** | **~27% lower** |
87
- | CPU throughput | 274.3 texts/s | **377.7 texts/s** | **~38% higher** |
88
- | STS Spearman | **0.8138** | 0.8070 | -0.0068 |
89
- | SciFact Recall@10 | 0.7148 | **0.7259** | +0.0111 |
90
- | SciFact nDCG@10 | 0.5701 | **0.5791** | +0.0090 |
 
91
 
92
- > **Summary:** INT8 quantization reduces TinyE5-L6-384 to just **21.8 MB** while increasing CPU throughput to approximately **378 texts/s**, with only a small change in semantic similarity performance and no degradation on the tested SciFact retrieval benchmark.
93
 
 
 
 
 
 
 
 
 
94
 
95
  ## Docker Example
96
 
@@ -106,7 +115,7 @@ services:
106
  - ./data:/data
107
  command:
108
  - --model-id
109
- - rizwan3d/tinye5
110
  - --revision
111
  - int8-onnx
112
  - --pooling
@@ -118,7 +127,7 @@ services:
118
  All variants are published under the same Hugging Face repository:
119
 
120
  ```text
121
- rizwan3d/tinye5
122
  ```
123
 
124
  | Variant | Revision | Model |
@@ -132,7 +141,7 @@ rizwan3d/tinye5
132
  ```yaml
133
  command:
134
  - --model-id
135
- - rizwan3d/tinye5
136
  - --revision
137
  - main
138
  - --pooling
@@ -144,7 +153,7 @@ command:
144
  ```yaml
145
  command:
146
  - --model-id
147
- - rizwan3d/tinye5
148
  - --revision
149
  - fp32-onnx
150
  - --pooling
@@ -156,7 +165,7 @@ command:
156
  ```yaml
157
  command:
158
  - --model-id
159
- - rizwan3d/tinye5
160
  - --revision
161
  - int8-onnx
162
  - --pooling
 
66
 
67
  | Model | Size | STS Spearman ↑ | SciFact Recall@10 ↑ | SciFact nDCG@10 ↑ |
68
  | ------------------------------- | ----------: | -------------: | ------------------: | ----------------: |
69
+ | **TinyE5-L6-384 (Safetensors)** | 86.7 MB | 0.8138 | 0.7342 | 0.5897 |
70
+ | **TinyE5-L6-384 (FP32 ONNX)** | 86.2 MB | 0.8138 | 0.7342 | 0.5897 |
71
+ | **TinyE5-L6-384 (INT8 ONNX)** | **21.8 MB** | 0.8058 | 0.7599 | 0.6020 |
72
+ | all-MiniLM-L6-v2 | | **0.8194** | **0.7923** | **0.6494** |
73
 
74
  ### CPU Inference Performance
75
 
76
+ | Model | Precision | Size | Latency ↓ | Throughput ↑ | Session RAM ↓ |
77
+ | ---------------------- | --------- | ----------: | ---------------: | -----------------: | ------------: |
78
+ | TinyE5-L6-384 ONNX | FP32 | 86.2 MB | 2.35 ms/text | 424.7 texts/s | 90.4 MB |
79
+ | **TinyE5-L6-384 ONNX** | **INT8** | **21.8 MB** | **0.77 ms/text** | **1299.4 texts/s** | **11.2 MB** |
80
 
81
  ### INT8 vs FP32 ONNX
82
 
83
+ | Metric | FP32 | INT8 | Change |
84
+ | ----------------- | ------------: | -----------------: | -----------------: |
85
+ | Model size | 86.2 MB | **21.8 MB** | **~74.7% smaller** |
86
+ | CPU latency | 2.35 ms/text | **0.77 ms/text** | **~67.2% lower** |
87
+ | CPU throughput | 424.7 texts/s | **1299.4 texts/s** | **~205.9% higher** |
88
+ | Session RAM | 90.4 MB | **11.2 MB** | **~87.6% lower** |
89
+ | STS Spearman | **0.8138** | 0.8058 | -0.0080 |
90
+ | SciFact Recall@10 | 0.7342 | **0.7599** | **+0.0257** |
91
+ | SciFact nDCG@10 | 0.5897 | **0.6020** | **+0.0123** |
92
 
93
+ ### End-to-End Benchmark Time
94
 
95
+ | Model | STS Time ↓ | SciFact Time ↓ |
96
+ | ------------------------------- | ---------: | -------------: |
97
+ | **TinyE5-L6-384 (Safetensors)** | 0.72s | 3.71s |
98
+ | TinyE5-L6-384 (FP32 ONNX) | 8.82s | 265.58s |
99
+ | TinyE5-L6-384 (INT8 ONNX) | 5.46s | 179.11s |
100
+ | **all-MiniLM-L6-v2** | **0.62s** | **3.62s** |
101
+
102
+ > **Summary:** INT8 quantization reduces TinyE5-L6-384 from **86.2 MB to 21.8 MB (~74.7% smaller)**, lowers CPU inference latency from **2.35 ms/text to 0.77 ms/text (~67.2% lower)**, and increases CPU throughput from **424.7 to 1299.4 texts/s (~3.06× throughput)**. Session RAM also drops from **90.4 MB to 11.2 MB (~87.6% lower)**. STS Spearman decreases slightly from **0.8138 to 0.8058**, while SciFact Recall@10 improves from **0.7342 to 0.7599** and nDCG@10 improves from **0.5897 to 0.6020**. The all-MiniLM-L6-v2 baseline still achieves the highest overall quality, with **0.8194 STS Spearman, 0.7923 Recall@10, and 0.6494 nDCG@10**.
103
 
104
  ## Docker Example
105
 
 
115
  - ./data:/data
116
  command:
117
  - --model-id
118
+ - GrowBitLabs/tinye5
119
  - --revision
120
  - int8-onnx
121
  - --pooling
 
127
  All variants are published under the same Hugging Face repository:
128
 
129
  ```text
130
+ GrowBitLabs/tinye5
131
  ```
132
 
133
  | Variant | Revision | Model |
 
141
  ```yaml
142
  command:
143
  - --model-id
144
+ - GrowBitLabs/tinye5
145
  - --revision
146
  - main
147
  - --pooling
 
153
  ```yaml
154
  command:
155
  - --model-id
156
+ - GrowBitLabs/tinye5
157
  - --revision
158
  - fp32-onnx
159
  - --pooling
 
165
  ```yaml
166
  command:
167
  - --model-id
168
+ - GrowBitLabs/tinye5
169
  - --revision
170
  - int8-onnx
171
  - --pooling
config.json CHANGED
@@ -1,25 +1,30 @@
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.57.6",
22
- "type_vocab_size": 2,
23
- "use_cache": true,
24
- "vocab_size": 30522
25
- }
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 384,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 1536,
17
+ "is_decoder": false,
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 6,
23
+ "pad_token_id": 0,
24
+ "position_embedding_type": "absolute",
25
+ "tie_word_embeddings": true,
26
+ "transformers_version": "5.16.1",
27
+ "type_vocab_size": 2,
28
+ "use_cache": true,
29
+ "vocab_size": 30522
30
+ }
embedding_config.json CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "name": "TinyE5-L6-384",
3
- "embedding_dimension": 384,
4
- "pooling": "mean",
5
- "normalize": true,
6
- "query_prefix": "query: ",
7
- "passage_prefix": "passage: ",
8
- "base_model": "sentence-transformers/all-MiniLM-L6-v2",
9
- "training_dataset": "sentence-transformers/msmarco-bm25/triplet",
10
- "train_last_n_layers": 2
11
  }
 
1
+ {
2
+ "name": "TinyE5-L6-384",
3
+ "embedding_dimension": 384,
4
+ "pooling": "mean",
5
+ "normalize": true,
6
+ "query_prefix": "query: ",
7
+ "passage_prefix": "passage: ",
8
+ "base_model": "sentence-transformers/all-MiniLM-L6-v2",
9
+ "training_dataset": "sentence-transformers/msmarco-bm25/triplet",
10
+ "train_last_n_layers": 2
11
  }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fb8de9bbf527353997deb64a4a6daee75da86a2eb9e711b825a6e7fa7ed2d01
3
+ size 90864192
tokenizer_config.json CHANGED
@@ -1,65 +1,24 @@
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
- }
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": true,
6
+ "is_local": false,
7
+ "local_files_only": false,
8
+ "mask_token": "[MASK]",
9
+ "max_length": 128,
10
+ "model_max_length": 512,
11
+ "never_split": null,
12
+ "pad_to_multiple_of": null,
13
+ "pad_token": "[PAD]",
14
+ "pad_token_type_id": 0,
15
+ "padding_side": "right",
16
+ "sep_token": "[SEP]",
17
+ "stride": 0,
18
+ "strip_accents": null,
19
+ "tokenize_chinese_chars": true,
20
+ "tokenizer_class": "BertTokenizer",
21
+ "truncation_side": "right",
22
+ "truncation_strategy": "longest_first",
23
+ "unk_token": "[UNK]"
24
+ }