Felix Marty
commited on
Commit
•
65240f0
1
Parent(s):
fc0e98a
add model
Browse files- README.md +14 -0
- config.json +31 -0
- eval_results.json +3 -0
- model_quantized.onnx +3 -0
- ort_config.json +30 -0
- tokenizer_config.json +1 -0
- vocab.txt +0 -0
README.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- sst2
|
5 |
+
- glue
|
6 |
---
|
7 |
+
This model is a fork of https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english , quantized using dynamic Post-Training Quantization (PTQ) with ONNX Runtime and 🤗 Optimum library.
|
8 |
+
|
9 |
+
It achieves 0.901 on the validation set.
|
10 |
+
|
11 |
+
To load this model:
|
12 |
+
|
13 |
+
```python
|
14 |
+
from optimum.onnxruntime import ORTModelForSequenceClassification
|
15 |
+
|
16 |
+
model = ORTModelForSequenceClassification.from_pretrained("fxmarty/distilbert-base-uncased-finetuned-sst-2-english-int8-dynamic")
|
17 |
+
```
|
config.json
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation": "gelu",
|
3 |
+
"architectures": [
|
4 |
+
"DistilBertForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.1,
|
7 |
+
"dim": 768,
|
8 |
+
"dropout": 0.1,
|
9 |
+
"finetuning_task": "sst-2",
|
10 |
+
"hidden_dim": 3072,
|
11 |
+
"id2label": {
|
12 |
+
"0": "NEGATIVE",
|
13 |
+
"1": "POSITIVE"
|
14 |
+
},
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"label2id": {
|
17 |
+
"NEGATIVE": 0,
|
18 |
+
"POSITIVE": 1
|
19 |
+
},
|
20 |
+
"max_position_embeddings": 512,
|
21 |
+
"model_type": "distilbert",
|
22 |
+
"n_heads": 12,
|
23 |
+
"n_layers": 6,
|
24 |
+
"output_past": true,
|
25 |
+
"pad_token_id": 0,
|
26 |
+
"qa_dropout": 0.1,
|
27 |
+
"seq_classif_dropout": 0.2,
|
28 |
+
"sinusoidal_pos_embds": false,
|
29 |
+
"tie_weights_": true,
|
30 |
+
"vocab_size": 30522
|
31 |
+
}
|
eval_results.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"accuracy": 0.9013761467889908
|
3 |
+
}
|
model_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f7ab313ff70257c0099095793bcf0f224b1264047e62a1a2e89e0c1b38a6cc7a
|
3 |
+
size 138748915
|
ort_config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_commit_hash": null,
|
3 |
+
"opset": null,
|
4 |
+
"optimization": {},
|
5 |
+
"optimum_version": "1.4.1.dev0",
|
6 |
+
"quantization": {
|
7 |
+
"activations_dtype": "QUInt8",
|
8 |
+
"activations_symmetric": false,
|
9 |
+
"format": "QOperator",
|
10 |
+
"is_static": false,
|
11 |
+
"mode": "IntegerOps",
|
12 |
+
"nodes_to_exclude": [],
|
13 |
+
"nodes_to_quantize": [],
|
14 |
+
"operators_to_quantize": [
|
15 |
+
"MatMul",
|
16 |
+
"Add"
|
17 |
+
],
|
18 |
+
"per_channel": false,
|
19 |
+
"qdq_add_pair_to_weight": false,
|
20 |
+
"qdq_dedicated_pair": false,
|
21 |
+
"qdq_op_type_per_channel_support_to_axis": {
|
22 |
+
"MatMul": 1
|
23 |
+
},
|
24 |
+
"reduce_range": false,
|
25 |
+
"weights_dtype": "QInt8",
|
26 |
+
"weights_symmetric": true
|
27 |
+
},
|
28 |
+
"transformers_version": "4.23.0.dev0",
|
29 |
+
"use_external_data_format": false
|
30 |
+
}
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"model_max_length": 512, "do_lower_case": true}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|