Qwe1325 commited on
Commit
33ace41
·
verified ·
1 Parent(s): e409760

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}
2
+ {%- if messages[0]['role'] == 'system' -%}
3
+ {%- if messages[0]['content'] is string -%}
4
+ {%- set first_user_prefix = messages[0]['content'] + '
5
+
6
+ ' -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
9
+
10
+ ' -%}
11
+ {%- endif -%}
12
+ {%- set loop_messages = messages[1:] -%}
13
+ {%- else -%}
14
+ {%- set first_user_prefix = "" -%}
15
+ {%- set loop_messages = messages -%}
16
+ {%- endif -%}
17
+ {%- for message in loop_messages -%}
18
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
19
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
20
+ {%- endif -%}
21
+ {%- if (message['role'] == 'assistant') -%}
22
+ {%- set role = "model" -%}
23
+ {%- else -%}
24
+ {%- set role = message['role'] -%}
25
+ {%- endif -%}
26
+ {{ '<start_of_turn>' + role + '
27
+ ' + (first_user_prefix if loop.first else "") }}
28
+ {%- if message['content'] is string -%}
29
+ {{ message['content'] | trim }}
30
+ {%- elif message['content'] is iterable -%}
31
+ {%- for item in message['content'] -%}
32
+ {%- if item['type'] == 'audio' -%}
33
+ {{ '<audio_soft_token>' }}
34
+ {%- elif item['type'] == 'image' -%}
35
+ {{ '<image_soft_token>' }}
36
+ {%- elif item['type'] == 'text' -%}
37
+ {{ item['text'] | trim }}
38
+ {%- endif -%}
39
+ {%- endfor -%}
40
+ {%- else -%}
41
+ {{ raise_exception("Invalid content type") }}
42
+ {%- endif -%}
43
+ {{ '<end_of_turn>
44
+ ' }}
45
+ {%- endfor -%}
46
+ {%- if add_generation_prompt -%}
47
+ {{'<start_of_turn>model
48
+ '}}
49
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma3nForConditionalGeneration"
4
+ ],
5
+ "audio_config": {
6
+ "conf_attention_chunk_size": 12,
7
+ "conf_attention_context_left": 13,
8
+ "conf_attention_context_right": 0,
9
+ "conf_attention_logit_cap": 50.0,
10
+ "conf_conv_kernel_size": 5,
11
+ "conf_num_attention_heads": 8,
12
+ "conf_num_hidden_layers": 12,
13
+ "conf_positional_bias_size": 256,
14
+ "conf_reduction_factor": 4,
15
+ "conf_residual_weight": 0.5,
16
+ "gradient_clipping": 10000000000.0,
17
+ "hidden_size": 1536,
18
+ "input_feat_size": 128,
19
+ "model_type": "gemma3n_audio",
20
+ "rms_norm_eps": 1e-06,
21
+ "sscp_conv_channel_size": [
22
+ 128,
23
+ 32
24
+ ],
25
+ "sscp_conv_eps": 0.001,
26
+ "sscp_conv_group_norm_eps": 0.001,
27
+ "sscp_conv_kernel_size": [
28
+ [
29
+ 3,
30
+ 3
31
+ ],
32
+ [
33
+ 3,
34
+ 3
35
+ ]
36
+ ],
37
+ "sscp_conv_stride_size": [
38
+ [
39
+ 2,
40
+ 2
41
+ ],
42
+ [
43
+ 2,
44
+ 2
45
+ ]
46
+ ],
47
+ "torch_dtype": "bfloat16",
48
+ "vocab_offset": 262272,
49
+ "vocab_size": 128
50
+ },
51
+ "audio_soft_tokens_per_image": 188,
52
+ "audio_token_id": 262273,
53
+ "boa_token_id": 256000,
54
+ "boi_token_id": 255999,
55
+ "eoa_token_id": 262272,
56
+ "eoi_token_id": 262144,
57
+ "eos_token_id": [
58
+ 1,
59
+ 106
60
+ ],
61
+ "image_token_id": 262145,
62
+ "initializer_range": 0.02,
63
+ "model_type": "gemma3n",
64
+ "quantization_config": {
65
+ "_load_in_4bit": true,
66
+ "_load_in_8bit": false,
67
+ "bnb_4bit_compute_dtype": "bfloat16",
68
+ "bnb_4bit_quant_storage": "uint8",
69
+ "bnb_4bit_quant_type": "nf4",
70
+ "bnb_4bit_use_double_quant": true,
71
+ "llm_int8_enable_fp32_cpu_offload": false,
72
+ "llm_int8_has_fp16_weight": false,
73
+ "llm_int8_skip_modules": [
74
+ "embed_tokens",
75
+ "embedding",
76
+ "lm_head",
77
+ "multi_modal_projector",
78
+ "merger",
79
+ "modality_projection",
80
+ "correction_coefs",
81
+ "prediction_coefs",
82
+ "modality_router",
83
+ "embedding_projection",
84
+ "input_proj_linear",
85
+ "per_layer_projection",
86
+ "audio_tower",
87
+ "embed_vision",
88
+ "embed_audio",
89
+ "altup_projections",
90
+ "altup_unembed_projections"
91
+ ],
92
+ "llm_int8_threshold": 6.0,
93
+ "load_in_4bit": true,
94
+ "load_in_8bit": false,
95
+ "quant_method": "bitsandbytes"
96
+ },
97
+ "text_config": {
98
+ "activation_sparsity_pattern": [
99
+ 0.95,
100
+ 0.95,
101
+ 0.95,
102
+ 0.95,
103
+ 0.95,
104
+ 0.95,
105
+ 0.95,
106
+ 0.95,
107
+ 0.95,
108
+ 0.95,
109
+ 0.0,
110
+ 0.0,
111
+ 0.0,
112
+ 0.0,
113
+ 0.0,
114
+ 0.0,
115
+ 0.0,
116
+ 0.0,
117
+ 0.0,
118
+ 0.0,
119
+ 0.0,
120
+ 0.0,
121
+ 0.0,
122
+ 0.0,
123
+ 0.0,
124
+ 0.0,
125
+ 0.0,
126
+ 0.0,
127
+ 0.0,
128
+ 0.0,
129
+ 0.0,
130
+ 0.0,
131
+ 0.0,
132
+ 0.0,
133
+ 0.0
134
+ ],
135
+ "altup_active_idx": 0,
136
+ "altup_coef_clip": 120.0,
137
+ "altup_correct_scale": true,
138
+ "altup_lr_multiplier": 1.0,
139
+ "altup_num_inputs": 4,
140
+ "attention_bias": false,
141
+ "attention_dropout": 0.0,
142
+ "final_logit_softcapping": 30.0,
143
+ "head_dim": 256,
144
+ "hidden_activation": "gelu_pytorch_tanh",
145
+ "hidden_size": 2048,
146
+ "hidden_size_per_layer_input": 256,
147
+ "initializer_range": 0.02,
148
+ "intermediate_size": [
149
+ 16384,
150
+ 16384,
151
+ 16384,
152
+ 16384,
153
+ 16384,
154
+ 16384,
155
+ 16384,
156
+ 16384,
157
+ 16384,
158
+ 16384,
159
+ 16384,
160
+ 16384,
161
+ 16384,
162
+ 16384,
163
+ 16384,
164
+ 16384,
165
+ 16384,
166
+ 16384,
167
+ 16384,
168
+ 16384,
169
+ 16384,
170
+ 16384,
171
+ 16384,
172
+ 16384,
173
+ 16384,
174
+ 16384,
175
+ 16384,
176
+ 16384,
177
+ 16384,
178
+ 16384,
179
+ 16384,
180
+ 16384,
181
+ 16384,
182
+ 16384,
183
+ 16384
184
+ ],
185
+ "laurel_rank": 64,
186
+ "layer_types": [
187
+ "sliding_attention",
188
+ "sliding_attention",
189
+ "sliding_attention",
190
+ "sliding_attention",
191
+ "full_attention",
192
+ "sliding_attention",
193
+ "sliding_attention",
194
+ "sliding_attention",
195
+ "sliding_attention",
196
+ "full_attention",
197
+ "sliding_attention",
198
+ "sliding_attention",
199
+ "sliding_attention",
200
+ "sliding_attention",
201
+ "full_attention",
202
+ "sliding_attention",
203
+ "sliding_attention",
204
+ "sliding_attention",
205
+ "sliding_attention",
206
+ "full_attention",
207
+ "sliding_attention",
208
+ "sliding_attention",
209
+ "sliding_attention",
210
+ "sliding_attention",
211
+ "full_attention",
212
+ "sliding_attention",
213
+ "sliding_attention",
214
+ "sliding_attention",
215
+ "sliding_attention",
216
+ "full_attention",
217
+ "sliding_attention",
218
+ "sliding_attention",
219
+ "sliding_attention",
220
+ "sliding_attention",
221
+ "full_attention"
222
+ ],
223
+ "max_position_embeddings": 32768,
224
+ "model_type": "gemma3n_text",
225
+ "num_attention_heads": 8,
226
+ "num_hidden_layers": 35,
227
+ "num_key_value_heads": 2,
228
+ "num_kv_shared_layers": 15,
229
+ "query_pre_attn_scalar": 256,
230
+ "rms_norm_eps": 1e-06,
231
+ "rope_local_base_freq": 10000.0,
232
+ "rope_scaling": null,
233
+ "rope_theta": 1000000.0,
234
+ "sliding_window": 512,
235
+ "torch_dtype": "bfloat16",
236
+ "use_cache": true,
237
+ "vocab_size": 262400,
238
+ "vocab_size_per_layer_input": 262144
239
+ },
240
+ "torch_dtype": "bfloat16",
241
+ "transformers_version": "4.53.1",
242
+ "vision_config": {
243
+ "architecture": "mobilenetv5_300m_enc",
244
+ "do_pooling": true,
245
+ "hidden_size": 2048,
246
+ "initializer_range": 0.02,
247
+ "label_names": [
248
+ "LABEL_0",
249
+ "LABEL_1"
250
+ ],
251
+ "model_args": null,
252
+ "model_type": "gemma3n_vision",
253
+ "num_classes": 2,
254
+ "rms_norm_eps": 1e-06,
255
+ "torch_dtype": "bfloat16",
256
+ "vocab_offset": 262144,
257
+ "vocab_size": 128
258
+ },
259
+ "vision_soft_tokens_per_image": 256
260
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 1,
7
+ 106
8
+ ],
9
+ "pad_token_id": 0,
10
+ "top_k": 64,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.53.1"
13
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3cbd0e2cd22f46f8b3f2e060d2f339e6218bb65f14c8c269f48ebe061723db11
3
+ size 1997489153
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fd22c533616c3f0425ba2170dc9b2dc68b0aab3b5207734934d764f593eba69
3
+ size 4697620648
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64648b4796f6616f638bb84ddbf850db4425d7f02c0cdc88b5f0d1b55c16d279
3
+ size 1996654554
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b215d940b1442e27d2a33070fd871c5e08973599517ae35226ae02e058afa581
3
+ size 1167419608
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": null,
3
+ "data_format": "channels_first",
4
+ "default_to_square": false,
5
+ "device": null,
6
+ "dither": 0.0,
7
+ "do_center_crop": null,
8
+ "do_convert_rgb": null,
9
+ "do_normalize": false,
10
+ "do_rescale": true,
11
+ "do_resize": true,
12
+ "feature_extractor_type": "Gemma3nAudioFeatureExtractor",
13
+ "feature_size": 128,
14
+ "fft_length": 1024,
15
+ "fft_overdrive": true,
16
+ "frame_length": 512,
17
+ "hop_length": 160,
18
+ "image_mean": [
19
+ 0.5,
20
+ 0.5,
21
+ 0.5
22
+ ],
23
+ "image_processor_type": "SiglipImageProcessorFast",
24
+ "image_seq_length": 256,
25
+ "image_std": [
26
+ 0.5,
27
+ 0.5,
28
+ 0.5
29
+ ],
30
+ "input_data_format": null,
31
+ "input_scale_factor": 1.0,
32
+ "max_frequency": 7600.0,
33
+ "mel_floor": 1e-05,
34
+ "min_frequency": 125.0,
35
+ "padding_side": "right",
36
+ "padding_value": 0.0,
37
+ "per_bin_mean": null,
38
+ "per_bin_stddev": null,
39
+ "preemphasis": 0.97,
40
+ "preemphasis_htk_flavor": true,
41
+ "processor_class": "Gemma3nProcessor",
42
+ "resample": 2,
43
+ "rescale_factor": 0.00392156862745098,
44
+ "return_attention_mask": false,
45
+ "return_tensors": null,
46
+ "sampling_rate": 16000,
47
+ "size": {
48
+ "height": 768,
49
+ "width": 768
50
+ }
51
+ }
processor_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "audio_seq_length": 188,
3
+ "image_seq_length": 256,
4
+ "processor_class": "Gemma3nProcessor"
5
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_token": "<audio_soft_token>",
3
+ "boa_token": "<start_of_audio>",
4
+ "boi_token": "<start_of_image>",
5
+ "bos_token": {
6
+ "content": "<bos>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "eoa_token": "<end_of_audio>",
13
+ "eoi_token": "<end_of_image>",
14
+ "eos_token": {
15
+ "content": "<eos>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "image_token": "<image_soft_token>",
22
+ "pad_token": {
23
+ "content": "<pad>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false
28
+ },
29
+ "unk_token": {
30
+ "content": "<unk>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false
35
+ }
36
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6c35ee648c07754b44cd9e371c75d4caa05c4504910b7ad29b1847ee9d8ba5d
3
+ size 33442553
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea5f0cc48abfbfc04d14562270a32e02149a3e7035f368cc5a462786f4a59961
3
+ size 4696020
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff