yuwenz commited on
Commit
e2d898a
1 Parent(s): 50e8d45

upload int8 onnx model

Browse files

Signed-off-by: yuwenzho <yuwen.zhou@intel.com>

Files changed (4) hide show
  1. README.md +37 -0
  2. config.json +35 -0
  3. model.onnx +3 -0
  4. 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 MiniLM-L12-H384-uncased-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/MiniLM-L12-H384-uncased-mrpc](https://huggingface.co/Intel/MiniLM-L12-H384-uncased-mrpc).
25
+
26
+ #### Test result
27
+
28
+ | |INT8|FP32|
29
+ |---|:---:|:---:|
30
+ | **Accuracy (eval-f1)** |0.9107|0.9097|
31
+ | **Model size (MB)** |33|128|
32
+
33
+
34
+ #### Load ONNX model:
35
+
36
+ ```python
37
+ from optimum.onnxruntime import ORTModelForSequenceClassification
38
+ model = ORTModelForSequenceClassification.from_pretrained('Intel/MiniLM-L12-H384-uncased-mrpc-int8-dynamic')
39
+ ```
40
+
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/MiniLM-L12-H384-uncased",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "finetuning_task": "mrpc",
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 384,
12
+ "id2label": {
13
+ "0": "not_equivalent",
14
+ "1": "equivalent"
15
+ },
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 1536,
18
+ "label2id": {
19
+ "equivalent": 1,
20
+ "not_equivalent": 0
21
+ },
22
+ "layer_norm_eps": 1e-12,
23
+ "max_position_embeddings": 512,
24
+ "model_type": "bert",
25
+ "num_attention_heads": 12,
26
+ "num_hidden_layers": 12,
27
+ "pad_token_id": 0,
28
+ "position_embedding_type": "absolute",
29
+ "problem_type": "single_label_classification",
30
+ "torch_dtype": "float32",
31
+ "transformers_version": "4.18.0",
32
+ "type_vocab_size": 2,
33
+ "use_cache": true,
34
+ "vocab_size": 30522
35
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a59a4cf033517bc9cfff376f62bc984c1f49925d4277e1ac4ae3c91581fd0013
3
+ size 34146742
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff