richardr1126 commited on
Commit
d7c0836
·
verified ·
1 Parent(s): d29f871

Upload ONNX optimized RoBERTa model with quantization

Browse files
README.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - text-classification
5
+ - onnx
6
+ - quantized
7
+ - roberta
8
+ - tweet-topic
9
+ base_model: cardiffnlp/tweet-topic-21-multi
10
+ ---
11
+ This is an ONNX-optimized version of [`cardiffnlp/tweet-topic-21-multi`](https://huggingface.co/cardiffnlp/tweet-topic-21-multi) for efficient inference.
12
+
13
+ ## Model Description
14
+
15
+ This repository contains:
16
+ - **model.onnx**: Regular ONNX exported model
17
+ - **model_quantized.onnx**: INT8 dynamically quantized model for faster inference with minimal accuracy loss
18
+
19
+ The model is optimized for zero-shot classification tasks across multiple languages.
20
+
21
+ ## Acknowledgments
22
+
23
+ This ONNX optimization was created for efficient deployment in production environments. Special thanks to the original model authors and the Hugging Face Optimum team.
config.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "arts_&_culture",
16
+ "1": "business_&_entrepreneurs",
17
+ "2": "celebrity_&_pop_culture",
18
+ "3": "diaries_&_daily_life",
19
+ "4": "family",
20
+ "5": "fashion_&_style",
21
+ "6": "film_tv_&_video",
22
+ "7": "fitness_&_health",
23
+ "8": "food_&_dining",
24
+ "9": "gaming",
25
+ "10": "learning_&_educational",
26
+ "11": "music",
27
+ "12": "news_&_social_concern",
28
+ "13": "other_hobbies",
29
+ "14": "relationships",
30
+ "15": "science_&_technology",
31
+ "16": "sports",
32
+ "17": "travel_&_adventure",
33
+ "18": "youth_&_student_life"
34
+ },
35
+ "initializer_range": 0.02,
36
+ "intermediate_size": 3072,
37
+ "label2id": {
38
+ "arts_&_culture": 0,
39
+ "business_&_entrepreneurs": 1,
40
+ "celebrity_&_pop_culture": 2,
41
+ "diaries_&_daily_life": 3,
42
+ "family": 4,
43
+ "fashion_&_style": 5,
44
+ "film_tv_&_video": 6,
45
+ "fitness_&_health": 7,
46
+ "food_&_dining": 8,
47
+ "gaming": 9,
48
+ "learning_&_educational": 10,
49
+ "music": 11,
50
+ "news_&_social_concern": 12,
51
+ "other_hobbies": 13,
52
+ "relationships": 14,
53
+ "science_&_technology": 15,
54
+ "sports": 16,
55
+ "travel_&_adventure": 17,
56
+ "youth_&_student_life": 18
57
+ },
58
+ "layer_norm_eps": 1e-05,
59
+ "max_position_embeddings": 514,
60
+ "model_type": "roberta",
61
+ "num_attention_heads": 12,
62
+ "num_hidden_layers": 12,
63
+ "pad_token_id": 1,
64
+ "position_embedding_type": "absolute",
65
+ "problem_type": "multi_label_classification",
66
+ "transformers_version": "4.57.0",
67
+ "type_vocab_size": 1,
68
+ "use_cache": true,
69
+ "vocab_size": 50265
70
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e0262356d967bb0462fe0abb7d1fb1547210c6fcb810992f45a6fbc48e4a141
3
+ size 498913534
model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ec0f338c168218c766bf0c40bf79693131a27818a9a04090a315a36f0c431c7
3
+ size 125507841
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_token": "<pad>",
54
+ "sep_token": "</s>",
55
+ "tokenizer_class": "RobertaTokenizer",
56
+ "trim_offsets": true,
57
+ "unk_token": "<unk>"
58
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff