violetch24
commited on
Commit
•
0a058c1
1
Parent(s):
e7b38e9
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,40 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: en
|
3 |
+
license: apache-2.0
|
4 |
+
tags:
|
5 |
+
- text-classfication
|
6 |
+
- int8
|
7 |
+
- Intel® Neural Compressor
|
8 |
+
- PostTrainingStatic
|
9 |
+
- bert
|
10 |
+
datasets:
|
11 |
+
- mrpc
|
12 |
+
- stsb
|
13 |
+
metrics:
|
14 |
+
- f1
|
15 |
---
|
16 |
+
|
17 |
+
# INT8 BERT base uncased finetuned sst2
|
18 |
+
|
19 |
+
## Post-training static quantization
|
20 |
+
|
21 |
+
### PyTorch
|
22 |
+
|
23 |
+
This is an INT8 PyTorch model quantized with [huggingface/optimum-intel](https://github.com/huggingface/optimum-intel) through the usage of [Intel® Neural Compressor](https://github.com/intel/neural-compressor).
|
24 |
+
|
25 |
+
The original fp32 model comes from the fine-tuned model [gchhablani/bert-base-cased-finetuned-sst2](https://huggingface.co/gchhablani/bert-base-cased-finetuned-sst2).
|
26 |
+
|
27 |
+
#### Test result
|
28 |
+
|
29 |
+
| |INT8|FP32|
|
30 |
+
|---|:---:|:---:|
|
31 |
+
| **Accuracy (eval-f1)** |0.9151|0.9232|
|
32 |
+
| **Model size (MB)** |111|433|
|
33 |
+
|
34 |
+
#### Load with optimum:
|
35 |
+
|
36 |
+
```python
|
37 |
+
from optimum.intel.neural_compressor.quantization import IncQuantizedModelForSequenceClassification
|
38 |
+
int8_model = IncQuantizedModelForSequenceClassification.from_pretrained(
|
39 |
+
'Intel/bert-base-cased-finetuned-sst2-int8',
|
40 |
+
)
|