upload int8 onnx model
Browse filesSigned-off-by: yuwenzho <[email protected]>
- README.md +37 -0
- config.json +37 -0
- model.onnx +3 -0
- tokenizer.json +0 -0
README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- text-classfication
|
| 6 |
+
- int8
|
| 7 |
+
- Intel® Neural Compressor
|
| 8 |
+
- PostTrainingDynamic
|
| 9 |
+
- onnx
|
| 10 |
+
datasets:
|
| 11 |
+
- mrpc
|
| 12 |
+
metrics:
|
| 13 |
+
- f1
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# INT8 roberta base finetuned MRPC
|
| 17 |
+
|
| 18 |
+
## Post-training dynamic quantization
|
| 19 |
+
|
| 20 |
+
### ONNX
|
| 21 |
+
|
| 22 |
+
This is an INT8 ONNX model quantized with [Intel® Neural Compressor](https://github.com/intel/neural-compressor).
|
| 23 |
+
|
| 24 |
+
The original fp32 model comes from the fine-tuned model [Intel/roberta-base-mrpc](https://huggingface.co/Intel/roberta-base-mrpc).
|
| 25 |
+
|
| 26 |
+
#### Test result
|
| 27 |
+
|
| 28 |
+
| |INT8|FP32|
|
| 29 |
+
|---|:---:|:---:|
|
| 30 |
+
| **Accuracy (eval-f1)** |0.9085|0.9138|
|
| 31 |
+
| **Model size (MB)** |122|476|
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
#### Load ONNX model:
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 38 |
+
model = ORTModelForSequenceClassification.from_pretrained('Intel/roberta-base-mrpc-int8-dynamic')
|
| 39 |
+
```
|
| 40 |
+
|
config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "roberta-base",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"finetuning_task": "mrpc",
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "not_equivalent",
|
| 16 |
+
"1": "equivalent"
|
| 17 |
+
},
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 3072,
|
| 20 |
+
"label2id": {
|
| 21 |
+
"equivalent": 1,
|
| 22 |
+
"not_equivalent": 0
|
| 23 |
+
},
|
| 24 |
+
"layer_norm_eps": 1e-05,
|
| 25 |
+
"max_position_embeddings": 514,
|
| 26 |
+
"model_type": "roberta",
|
| 27 |
+
"num_attention_heads": 12,
|
| 28 |
+
"num_hidden_layers": 12,
|
| 29 |
+
"pad_token_id": 1,
|
| 30 |
+
"position_embedding_type": "absolute",
|
| 31 |
+
"problem_type": "single_label_classification",
|
| 32 |
+
"torch_dtype": "float32",
|
| 33 |
+
"transformers_version": "4.18.0",
|
| 34 |
+
"type_vocab_size": 1,
|
| 35 |
+
"use_cache": true,
|
| 36 |
+
"vocab_size": 50265
|
| 37 |
+
}
|
model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4385f8989ef927321b1688a9994c5cb50b72ed4fe25ac256ea1be9ff497755ce
|
| 3 |
+
size 127041708
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|