OPEA
/

Safetensors
mllama
4-bit precision
auto-round
cicdatopea commited on
Commit
b55abea
·
verified ·
1 Parent(s): 6be8cdf

update to transfomers 4.52

Browse files
Files changed (3) hide show
  1. 1 +249 -0
  2. README.md +2 -3
  3. config.json +2 -2
1 ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/models/Llama-3.2-11B-Vision-Instruct",
3
+ "architectures": [
4
+ "MllamaForConditionalGeneration"
5
+ ],
6
+ "image_token_index": 128256,
7
+ "model_type": "mllama",
8
+ "quantization_config": {
9
+ "amp": true,
10
+ "autoround_version": "0.4.0.dev",
11
+ "batch_size": 1,
12
+ "bits": 4,
13
+ "data_type": "int",
14
+ "dataset": "/dataset/vlm/vlm_eval_dataset.json",
15
+ "enable_minmax_tuning": true,
16
+ "enable_norm_bias_tuning": false,
17
+ "enable_quanted_input": true,
18
+ "gradient_accumulate_steps": 8,
19
+ "group_size": 128,
20
+ "iters": 1000,
21
+ "low_gpu_mem_usage": false,
22
+ "lr": 0.001,
23
+ "minmax_lr": 0.001,
24
+ "nsamples": 512,
25
+ "quant_method": "auto-round",
26
+ "scale_dtype": "torch.float16",
27
+ "seqlen": 512,
28
+ "sym": true,
29
+ "block_name_to_quantize":"language_model.model.layers,model.language_model.layers"
30
+ },
31
+ "text_config": {
32
+ "_attn_implementation_autoset": false,
33
+ "_name_or_path": "",
34
+ "add_cross_attention": false,
35
+ "architectures": null,
36
+ "bad_words_ids": null,
37
+ "begin_suppress_tokens": null,
38
+ "bos_token_id": 128000,
39
+ "chunk_size_feed_forward": 0,
40
+ "cross_attention_hidden_size": null,
41
+ "cross_attention_layers": [
42
+ 3,
43
+ 8,
44
+ 13,
45
+ 18,
46
+ 23,
47
+ 28,
48
+ 33,
49
+ 38
50
+ ],
51
+ "decoder_start_token_id": null,
52
+ "diversity_penalty": 0.0,
53
+ "do_sample": false,
54
+ "dropout": 0,
55
+ "early_stopping": false,
56
+ "encoder_no_repeat_ngram_size": 0,
57
+ "eos_token_id": [
58
+ 128001,
59
+ 128008,
60
+ 128009
61
+ ],
62
+ "exponential_decay_length_penalty": null,
63
+ "finetuning_task": null,
64
+ "forced_bos_token_id": null,
65
+ "forced_eos_token_id": null,
66
+ "hidden_act": "silu",
67
+ "hidden_size": 4096,
68
+ "id2label": {
69
+ "0": "LABEL_0",
70
+ "1": "LABEL_1"
71
+ },
72
+ "initializer_range": 0.02,
73
+ "intermediate_size": 14336,
74
+ "is_decoder": false,
75
+ "is_encoder_decoder": false,
76
+ "label2id": {
77
+ "LABEL_0": 0,
78
+ "LABEL_1": 1
79
+ },
80
+ "length_penalty": 1.0,
81
+ "max_length": 20,
82
+ "max_position_embeddings": 131072,
83
+ "min_length": 0,
84
+ "model_type": "mllama_text_model",
85
+ "no_repeat_ngram_size": 0,
86
+ "num_attention_heads": 32,
87
+ "num_beam_groups": 1,
88
+ "num_beams": 1,
89
+ "num_hidden_layers": 40,
90
+ "num_key_value_heads": 8,
91
+ "num_return_sequences": 1,
92
+ "output_attentions": false,
93
+ "output_hidden_states": false,
94
+ "output_scores": false,
95
+ "pad_token_id": 128004,
96
+ "prefix": null,
97
+ "problem_type": null,
98
+ "pruned_heads": {},
99
+ "remove_invalid_values": false,
100
+ "repetition_penalty": 1.0,
101
+ "return_dict": true,
102
+ "return_dict_in_generate": false,
103
+ "rms_norm_eps": 1e-05,
104
+ "rope_scaling": {
105
+ "factor": 8.0,
106
+ "high_freq_factor": 4.0,
107
+ "low_freq_factor": 1.0,
108
+ "original_max_position_embeddings": 8192,
109
+ "rope_type": "llama3"
110
+ },
111
+ "rope_theta": 500000.0,
112
+ "sep_token_id": null,
113
+ "suppress_tokens": null,
114
+ "task_specific_params": null,
115
+ "temperature": 1.0,
116
+ "tf_legacy_loss": false,
117
+ "tie_encoder_decoder": false,
118
+ "tie_word_embeddings": false,
119
+ "tokenizer_class": null,
120
+ "top_k": 50,
121
+ "top_p": 1.0,
122
+ "torch_dtype": "float16",
123
+ "torchscript": false,
124
+ "typical_p": 1.0,
125
+ "use_bfloat16": false,
126
+ "use_cache": true,
127
+ "vocab_size": 128256
128
+ },
129
+ "torch_dtype": "float16",
130
+ "transformers_version": "4.46.1",
131
+ "vision_config": {
132
+ "_attn_implementation_autoset": false,
133
+ "_name_or_path": "",
134
+ "add_cross_attention": false,
135
+ "architectures": null,
136
+ "attention_heads": 16,
137
+ "bad_words_ids": null,
138
+ "begin_suppress_tokens": null,
139
+ "bos_token_id": null,
140
+ "chunk_size_feed_forward": 0,
141
+ "cross_attention_hidden_size": null,
142
+ "decoder_start_token_id": null,
143
+ "diversity_penalty": 0.0,
144
+ "do_sample": false,
145
+ "early_stopping": false,
146
+ "encoder_no_repeat_ngram_size": 0,
147
+ "eos_token_id": null,
148
+ "exponential_decay_length_penalty": null,
149
+ "finetuning_task": null,
150
+ "forced_bos_token_id": null,
151
+ "forced_eos_token_id": null,
152
+ "hidden_act": "gelu",
153
+ "hidden_size": 1280,
154
+ "id2label": {
155
+ "0": "LABEL_0",
156
+ "1": "LABEL_1"
157
+ },
158
+ "image_size": 560,
159
+ "initializer_range": 0.02,
160
+ "intermediate_layers_indices": [
161
+ 3,
162
+ 7,
163
+ 15,
164
+ 23,
165
+ 30
166
+ ],
167
+ "intermediate_size": 5120,
168
+ "is_decoder": false,
169
+ "is_encoder_decoder": false,
170
+ "label2id": {
171
+ "LABEL_0": 0,
172
+ "LABEL_1": 1
173
+ },
174
+ "length_penalty": 1.0,
175
+ "max_length": 20,
176
+ "max_num_tiles": 4,
177
+ "min_length": 0,
178
+ "model_type": "mllama_vision_model",
179
+ "no_repeat_ngram_size": 0,
180
+ "norm_eps": 1e-05,
181
+ "num_beam_groups": 1,
182
+ "num_beams": 1,
183
+ "num_channels": 3,
184
+ "num_global_layers": 8,
185
+ "num_hidden_layers": 32,
186
+ "num_return_sequences": 1,
187
+ "output_attentions": false,
188
+ "output_hidden_states": false,
189
+ "output_scores": false,
190
+ "pad_token_id": null,
191
+ "patch_size": 14,
192
+ "prefix": null,
193
+ "problem_type": null,
194
+ "pruned_heads": {},
195
+ "remove_invalid_values": false,
196
+ "repetition_penalty": 1.0,
197
+ "return_dict": true,
198
+ "return_dict_in_generate": false,
199
+ "sep_token_id": null,
200
+ "supported_aspect_ratios": [
201
+ [
202
+ 1,
203
+ 1
204
+ ],
205
+ [
206
+ 1,
207
+ 2
208
+ ],
209
+ [
210
+ 1,
211
+ 3
212
+ ],
213
+ [
214
+ 1,
215
+ 4
216
+ ],
217
+ [
218
+ 2,
219
+ 1
220
+ ],
221
+ [
222
+ 2,
223
+ 2
224
+ ],
225
+ [
226
+ 3,
227
+ 1
228
+ ],
229
+ [
230
+ 4,
231
+ 1
232
+ ]
233
+ ],
234
+ "suppress_tokens": null,
235
+ "task_specific_params": null,
236
+ "temperature": 1.0,
237
+ "tf_legacy_loss": false,
238
+ "tie_encoder_decoder": false,
239
+ "tie_word_embeddings": true,
240
+ "tokenizer_class": null,
241
+ "top_k": 50,
242
+ "top_p": 1.0,
243
+ "torch_dtype": "float16",
244
+ "torchscript": false,
245
+ "typical_p": 1.0,
246
+ "use_bfloat16": false,
247
+ "vision_output_dim": 7680
248
+ }
249
+ }
README.md CHANGED
@@ -14,11 +14,10 @@ This model is an int4 model with group_size 128 and symmetric quantization of [m
14
 
15
  ### Requirements
16
  Please use Transformers version 4.45.0 or later
17
- AutoRound version >= 0.4.1
18
 
19
  ### INT4 Inference
20
  ```python
21
- from auto_round import AutoRoundConfig ## must import for auto-round format
22
  import requests
23
  import torch
24
  from PIL import Image
@@ -148,4 +147,4 @@ The license on this model does not constitute legal advice. We are not responsib
148
 
149
  @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
150
 
151
- [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
 
14
 
15
  ### Requirements
16
  Please use Transformers version 4.45.0 or later
17
+ AutoRound version >= 0.5.2
18
 
19
  ### INT4 Inference
20
  ```python
 
21
  import requests
22
  import torch
23
  from PIL import Image
 
147
 
148
  @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
149
 
150
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
config.json CHANGED
@@ -26,7 +26,7 @@
26
  "scale_dtype": "torch.float16",
27
  "seqlen": 512,
28
  "sym": true,
29
- "block_name_to_quantize":"language_model.model.layers"
30
  },
31
  "text_config": {
32
  "_attn_implementation_autoset": false,
@@ -240,7 +240,7 @@
240
  "tokenizer_class": null,
241
  "top_k": 50,
242
  "top_p": 1.0,
243
- "torch_dtype": "float16",
244
  "torchscript": false,
245
  "typical_p": 1.0,
246
  "use_bfloat16": false,
 
26
  "scale_dtype": "torch.float16",
27
  "seqlen": 512,
28
  "sym": true,
29
+ "block_name_to_quantize":"language_model.model.layers,model.language_model.layers"
30
  },
31
  "text_config": {
32
  "_attn_implementation_autoset": false,
 
240
  "tokenizer_class": null,
241
  "top_k": 50,
242
  "top_p": 1.0,
243
+ "torch_dtype": "bfloat16",
244
  "torchscript": false,
245
  "typical_p": 1.0,
246
  "use_bfloat16": false,