yuwenz commited on
Commit
b7ae378
1 Parent(s): 83f4197

upload int8 onnx model

Browse files

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

Files changed (5) hide show
  1. .gitattributes +1 -0
  2. README.md +37 -0
  3. config.json +38 -0
  4. model.onnx +3 -0
  5. tokenizer.json +3 -0
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
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/xlm-roberta-base-mrpc](https://huggingface.co/Intel/xlm-roberta-base-mrpc).
25
+
26
+ #### Test result
27
+
28
+ | |INT8|FP32|
29
+ |---|:---:|:---:|
30
+ | **Accuracy (eval-f1)** |0.8945|0.9010|
31
+ | **Model size (MB)** |275|1061|
32
+
33
+
34
+ #### Load ONNX model:
35
+
36
+ ```python
37
+ from optimum.onnxruntime import ORTModelForSequenceClassification
38
+ model = ORTModelForSequenceClassification.from_pretrained('Intel/xlm-roberta-base-mrpc-int8-dynamic')
39
+ ```
40
+
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "xlm-roberta-base",
3
+ "architectures": [
4
+ "XLMRobertaForSequenceClassification"
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": "xlm-roberta",
27
+ "num_attention_heads": 12,
28
+ "num_hidden_layers": 12,
29
+ "output_past": true,
30
+ "pad_token_id": 1,
31
+ "position_embedding_type": "absolute",
32
+ "problem_type": "single_label_classification",
33
+ "torch_dtype": "float32",
34
+ "transformers_version": "4.18.0",
35
+ "type_vocab_size": 1,
36
+ "use_cache": true,
37
+ "vocab_size": 250002
38
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d813dd10c5fe77b93e9f93b50fe31b73f84c18cbb223b3ee126d728dadb4ea
3
+ size 287513036
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626
3
+ size 17082660