upload int8 onnx model
Browse filesSigned-off-by: yuwenzho <yuwen.zhou@intel.com>
- README.md +35 -0
- added_tokens.json +3 -0
- config.json +44 -0
- model.onnx +3 -0
- special_tokens_map.json +9 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
README.md
CHANGED
@@ -1,3 +1,38 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
tags:
|
4 |
+
- text-classfication
|
5 |
+
- int8
|
6 |
+
- Intel® Neural Compressor
|
7 |
+
- neural-compressor
|
8 |
+
- PostTrainingDynamic
|
9 |
+
- onnx
|
10 |
+
datasets:
|
11 |
+
- glue
|
12 |
+
metrics:
|
13 |
+
- f1
|
14 |
---
|
15 |
+
# INT8 deberta-v3-base-mrpc
|
16 |
+
|
17 |
+
## Post-training Dynamic quantization
|
18 |
+
|
19 |
+
### ONNX
|
20 |
+
|
21 |
+
This is an INT8 ONNX model quantized with [Intel® Neural Compressor](https://github.com/intel/neural-compressor).
|
22 |
+
|
23 |
+
The original fp32 model comes from the fine-tuned model [Intel/deberta-v3-base-mrpc](https://huggingface.co/Intel/deberta-v3-base-mrpc).
|
24 |
+
|
25 |
+
#### Test result
|
26 |
+
|
27 |
+
| |INT8|FP32|
|
28 |
+
|---|:---:|:---:|
|
29 |
+
| **Accuracy (eval-f1)** |0.9205|0.9223|
|
30 |
+
| **Model size (MB)** |350|705|
|
31 |
+
|
32 |
+
|
33 |
+
#### Load ONNX model:
|
34 |
+
|
35 |
+
```python
|
36 |
+
from optimum.onnxruntime import ORTModelForSequenceClassification
|
37 |
+
model = ORTModelForSequenceClassification.from_pretrained('Intel/deberta-v3-base-mrpc-int8-dynamic')
|
38 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[MASK]": 128000
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Intel/deberta-v3-base-mrpc",
|
3 |
+
"architectures": [
|
4 |
+
"DebertaV2ForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"finetuning_task": "mrpc",
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "not_equivalent",
|
13 |
+
"1": "equivalent"
|
14 |
+
},
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"intermediate_size": 3072,
|
17 |
+
"label2id": {
|
18 |
+
"equivalent": 1,
|
19 |
+
"not_equivalent": 0
|
20 |
+
},
|
21 |
+
"layer_norm_eps": 1e-07,
|
22 |
+
"max_position_embeddings": 512,
|
23 |
+
"max_relative_positions": -1,
|
24 |
+
"model_type": "deberta-v2",
|
25 |
+
"norm_rel_ebd": "layer_norm",
|
26 |
+
"num_attention_heads": 12,
|
27 |
+
"num_hidden_layers": 12,
|
28 |
+
"pad_token_id": 0,
|
29 |
+
"pooler_dropout": 0,
|
30 |
+
"pooler_hidden_act": "gelu",
|
31 |
+
"pooler_hidden_size": 768,
|
32 |
+
"pos_att_type": [
|
33 |
+
"p2c",
|
34 |
+
"c2p"
|
35 |
+
],
|
36 |
+
"position_biased_input": false,
|
37 |
+
"position_buckets": 256,
|
38 |
+
"relative_attention": true,
|
39 |
+
"share_att_key": true,
|
40 |
+
"torch_dtype": "float32",
|
41 |
+
"transformers_version": "4.29.1",
|
42 |
+
"type_vocab_size": 0,
|
43 |
+
"vocab_size": 128100
|
44 |
+
}
|
model.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e32e2dd88de9085c9c23e3ab289d64288df1030a401bfd2568518c4b91db196
|
3 |
+
size 366330774
|
special_tokens_map.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "[CLS]",
|
3 |
+
"cls_token": "[CLS]",
|
4 |
+
"eos_token": "[SEP]",
|
5 |
+
"mask_token": "[MASK]",
|
6 |
+
"pad_token": "[PAD]",
|
7 |
+
"sep_token": "[SEP]",
|
8 |
+
"unk_token": "[UNK]"
|
9 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "[CLS]",
|
3 |
+
"clean_up_tokenization_spaces": true,
|
4 |
+
"cls_token": "[CLS]",
|
5 |
+
"do_lower_case": false,
|
6 |
+
"eos_token": "[SEP]",
|
7 |
+
"mask_token": "[MASK]",
|
8 |
+
"model_max_length": 1000000000000000019884624838656,
|
9 |
+
"pad_token": "[PAD]",
|
10 |
+
"sep_token": "[SEP]",
|
11 |
+
"sp_model_kwargs": {},
|
12 |
+
"split_by_punct": false,
|
13 |
+
"tokenizer_class": "DebertaV2Tokenizer",
|
14 |
+
"unk_token": "[UNK]",
|
15 |
+
"vocab_type": "spm"
|
16 |
+
}
|