yujiepan commited on
Commit
0bdf55c
·
verified ·
1 Parent(s): 6ffde10

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
README.md ADDED
@@ -0,0 +1,653 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ pipeline_tag: image-text-to-text
4
+ inference: true
5
+ widget:
6
+ - text: Hello!
7
+ example_title: Hello world
8
+ group: Python
9
+ base_model:
10
+ - google/gemma-3n-E4B-it
11
+ ---
12
+
13
+ This tiny model is for debugging. It is randomly initialized with the config adapted from [google/gemma-3n-E4B-it](https://huggingface.co/google/gemma-3n-E4B-it).
14
+
15
+ ### Example usage:
16
+
17
+ ```python
18
+ import torch
19
+
20
+ from transformers import pipeline
21
+
22
+ model_id = "tiny-random/gemma-3n-dim4"
23
+ pipe = pipeline(
24
+ task="image-text-to-text",
25
+ model=model_id,
26
+ device=0,
27
+ torch_dtype=torch.bfloat16
28
+ )
29
+
30
+ # temporary patch for audio tower
31
+ from accelerate.hooks import ModelHook, add_hook_to_module
32
+
33
+ class EnsureDtype(ModelHook):
34
+ def pre_forward(self, module, *args, **kwargs):
35
+ args = list(args)
36
+ args[0] = args[0].to(module.dtype)
37
+ return super().pre_forward(module, *args, **kwargs)
38
+ add_hook_to_module(pipe.model.audio_tower, EnsureDtype())
39
+
40
+ messages = [
41
+ {
42
+ "role": "system",
43
+ "content": [
44
+ {"type": "text", "text": "You are a helpful assistant."}
45
+ ]
46
+ },
47
+ {
48
+ "role": "user",
49
+ "content": [
50
+ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg"},
51
+ # audio is buggy for now: bf16 x fp32
52
+ {"type": "audio", "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Audio/glass-breaking-151256.mp3"},
53
+ {"type": "text", "text": "Which image is cuter?"},
54
+ ]
55
+ },
56
+ ]
57
+ result = pipe(messages, min_new_tokens=512, max_new_tokens=512, do_sample=True)
58
+ print(result)
59
+ ```
60
+
61
+ ### Codes to create this repo:
62
+
63
+ ```python
64
+ import json
65
+ from pathlib import Path
66
+
67
+ import torch
68
+
69
+ import accelerate
70
+ from huggingface_hub import file_exists, hf_hub_download
71
+ from timm.models.mobilenetv5 import decode_arch_def
72
+ from transformers import (
73
+ AutoConfig,
74
+ AutoModelForCausalLM,
75
+ AutoProcessor,
76
+ AutoTokenizer,
77
+ Gemma3nForConditionalGeneration,
78
+ GenerationConfig,
79
+ set_seed,
80
+ )
81
+
82
+ source_model_id = "google/gemma-3n-E4B-it"
83
+ save_folder = "/tmp/tiny-random/gemma-3n-dim4"
84
+
85
+ processor = AutoProcessor.from_pretrained(source_model_id)
86
+ processor.save_pretrained(save_folder)
87
+
88
+ with open(hf_hub_download(source_model_id, filename='config.json', repo_type='model'), 'r', encoding='utf-8') as f:
89
+ config_json = json.load(f)
90
+
91
+ config_json['audio_config'].update({
92
+ "conf_num_attention_heads": 2,
93
+ "conf_num_hidden_layers": 2,
94
+ "hidden_size": 4,
95
+ })
96
+ config_json['text_config'].update({
97
+ "activation_sparsity_pattern": [0.95, 0.95, 0.0, 0.0],
98
+ "head_dim": 2,
99
+ "hidden_size": 4,
100
+ "hidden_size_per_layer_input": 1,
101
+ "intermediate_size": 8,
102
+ "laurel_rank": 1,
103
+ "layer_types": ['sliding_attention', 'full_attention', 'sliding_attention', 'full_attention'],
104
+ "num_attention_heads": 2,
105
+ "num_hidden_layers": 4,
106
+ "num_key_value_heads": 1,
107
+ "num_kv_shared_layers": 2,
108
+ "sliding_window": 512,
109
+ })
110
+ block_args = decode_arch_def(
111
+ [
112
+ # Stage 0: 128x128 in
113
+ [
114
+ 'er_r1_k3_s2_e4_c4',
115
+ 'er_r1_k3_s1_e4_c4',
116
+ ],
117
+ # Stage 1: 256x256 in
118
+ [
119
+ 'uir_r1_a3_k5_s2_e6_c4',
120
+ 'uir_r1_a5_k0_s1_e4_c4',
121
+ 'uir_r1_a3_k0_s1_e4_c4',
122
+ ],
123
+ # Stage 2: 640x640 in
124
+ [
125
+ "uir_r1_a5_k5_s2_e6_c4",
126
+ "uir_r1_a0_k0_s1_e1_c4",
127
+ "mqa_r1_k3_h2_v2_s1_d8_c4",
128
+ "uir_r1_a0_k0_s1_e2_c4",
129
+ ],
130
+ # Stage 3: 1280x1280 in
131
+ [
132
+ "uir_r1_a5_k5_s2_e6_c4",
133
+ "mqa_r1_k3_h2_s1_d8_c4",
134
+ "uir_r1_a0_k0_s1_e2_c4",
135
+ ],
136
+ ]
137
+ )
138
+ config_json['vision_config'].update({
139
+ "hidden_size": 2048, # hard-coded in timm
140
+ "model_args": {
141
+ "block_args": block_args,
142
+ }
143
+ })
144
+ config_json['tie_word_embeddings'] = True
145
+
146
+ with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
147
+ json.dump(config_json, f, indent=2)
148
+
149
+ config = AutoConfig.from_pretrained(
150
+ save_folder,
151
+ trust_remote_code=True,
152
+ )
153
+ print(config)
154
+
155
+ torch.set_default_dtype(torch.bfloat16)
156
+ model = Gemma3nForConditionalGeneration(config)
157
+ torch.set_default_dtype(torch.float32)
158
+ if file_exists(filename="generation_config.json", repo_id=source_model_id, repo_type='model'):
159
+ model.generation_config = GenerationConfig.from_pretrained(
160
+ source_model_id, trust_remote_code=True,
161
+ )
162
+ set_seed(42)
163
+ model = model.cpu()
164
+ all_numels = 0
165
+ for name, p in sorted(model.named_parameters()):
166
+ all_numels += p.numel()
167
+ with torch.no_grad():
168
+ for name, p in sorted(model.named_parameters()):
169
+ torch.nn.init.normal_(p, 0, 0.2)
170
+ print(name, p.shape, f'{p.numel() / all_numels * 100: .4f}%')
171
+ model.save_pretrained(save_folder)
172
+ ```
173
+
174
+ ### Printing the model:
175
+
176
+ ```text
177
+ Gemma3nForConditionalGeneration(
178
+ (model): Gemma3nModel(
179
+ (vision_tower): TimmWrapperModel(
180
+ (timm_model): MobileNetV5Encoder(
181
+ (conv_stem): ConvNormAct(
182
+ (conv): Conv2dSame(3, 64, kernel_size=(3, 3), stride=(2, 2), bias=False)
183
+ (bn): RmsNormAct2d(
184
+ (drop): Identity()
185
+ (act): GELU(approximate='none')
186
+ )
187
+ )
188
+ (blocks): Sequential(
189
+ (0): Sequential(
190
+ (0): EdgeResidual(
191
+ (conv_exp): Conv2dSame(64, 256, kernel_size=(3, 3), stride=(2, 2), bias=False)
192
+ (bn1): RmsNormAct2d(
193
+ (drop): Identity()
194
+ (act): GELU(approximate='none')
195
+ )
196
+ (aa): Identity()
197
+ (se): Identity()
198
+ (conv_pwl): Conv2d(256, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
199
+ (bn2): RmsNormAct2d(
200
+ (drop): Identity()
201
+ (act): Identity()
202
+ )
203
+ (drop_path): Identity()
204
+ )
205
+ (1): EdgeResidual(
206
+ (conv_exp): Conv2d(8, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
207
+ (bn1): RmsNormAct2d(
208
+ (drop): Identity()
209
+ (act): GELU(approximate='none')
210
+ )
211
+ (aa): Identity()
212
+ (se): Identity()
213
+ (conv_pwl): Conv2d(32, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
214
+ (bn2): RmsNormAct2d(
215
+ (drop): Identity()
216
+ (act): Identity()
217
+ )
218
+ (drop_path): Identity()
219
+ )
220
+ )
221
+ (1): Sequential(
222
+ (0): UniversalInvertedResidual(
223
+ (dw_start): ConvNormAct(
224
+ (conv): Conv2d(8, 8, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=8, bias=False)
225
+ (bn): RmsNormAct2d(
226
+ (drop): Identity()
227
+ (act): Identity()
228
+ )
229
+ )
230
+ (pw_exp): ConvNormAct(
231
+ (conv): Conv2d(8, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)
232
+ (bn): RmsNormAct2d(
233
+ (drop): Identity()
234
+ (act): GELU(approximate='none')
235
+ )
236
+ )
237
+ (dw_mid): ConvNormAct(
238
+ (conv): Conv2dSame(48, 48, kernel_size=(5, 5), stride=(2, 2), groups=48, bias=False)
239
+ (bn): RmsNormAct2d(
240
+ (drop): Identity()
241
+ (act): GELU(approximate='none')
242
+ )
243
+ )
244
+ (se): Identity()
245
+ (pw_proj): ConvNormAct(
246
+ (conv): Conv2d(48, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
247
+ (bn): RmsNormAct2d(
248
+ (drop): Identity()
249
+ (act): Identity()
250
+ )
251
+ )
252
+ (dw_end): Identity()
253
+ (layer_scale): LayerScale2d()
254
+ (drop_path): Identity()
255
+ )
256
+ (1): UniversalInvertedResidual(
257
+ (dw_start): ConvNormAct(
258
+ (conv): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=8, bias=False)
259
+ (bn): RmsNormAct2d(
260
+ (drop): Identity()
261
+ (act): Identity()
262
+ )
263
+ )
264
+ (pw_exp): ConvNormAct(
265
+ (conv): Conv2d(8, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
266
+ (bn): RmsNormAct2d(
267
+ (drop): Identity()
268
+ (act): GELU(approximate='none')
269
+ )
270
+ )
271
+ (dw_mid): Identity()
272
+ (se): Identity()
273
+ (pw_proj): ConvNormAct(
274
+ (conv): Conv2d(32, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
275
+ (bn): RmsNormAct2d(
276
+ (drop): Identity()
277
+ (act): Identity()
278
+ )
279
+ )
280
+ (dw_end): Identity()
281
+ (layer_scale): LayerScale2d()
282
+ (drop_path): Identity()
283
+ )
284
+ (2): UniversalInvertedResidual(
285
+ (dw_start): ConvNormAct(
286
+ (conv): Conv2d(8, 8, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=8, bias=False)
287
+ (bn): RmsNormAct2d(
288
+ (drop): Identity()
289
+ (act): Identity()
290
+ )
291
+ )
292
+ (pw_exp): ConvNormAct(
293
+ (conv): Conv2d(8, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
294
+ (bn): RmsNormAct2d(
295
+ (drop): Identity()
296
+ (act): GELU(approximate='none')
297
+ )
298
+ )
299
+ (dw_mid): Identity()
300
+ (se): Identity()
301
+ (pw_proj): ConvNormAct(
302
+ (conv): Conv2d(32, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
303
+ (bn): RmsNormAct2d(
304
+ (drop): Identity()
305
+ (act): Identity()
306
+ )
307
+ )
308
+ (dw_end): Identity()
309
+ (layer_scale): LayerScale2d()
310
+ (drop_path): Identity()
311
+ )
312
+ )
313
+ (2): Sequential(
314
+ (0): UniversalInvertedResidual(
315
+ (dw_start): ConvNormAct(
316
+ (conv): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=8, bias=False)
317
+ (bn): RmsNormAct2d(
318
+ (drop): Identity()
319
+ (act): Identity()
320
+ )
321
+ )
322
+ (pw_exp): ConvNormAct(
323
+ (conv): Conv2d(8, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)
324
+ (bn): RmsNormAct2d(
325
+ (drop): Identity()
326
+ (act): GELU(approximate='none')
327
+ )
328
+ )
329
+ (dw_mid): ConvNormAct(
330
+ (conv): Conv2dSame(48, 48, kernel_size=(5, 5), stride=(2, 2), groups=48, bias=False)
331
+ (bn): RmsNormAct2d(
332
+ (drop): Identity()
333
+ (act): GELU(approximate='none')
334
+ )
335
+ )
336
+ (se): Identity()
337
+ (pw_proj): ConvNormAct(
338
+ (conv): Conv2d(48, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
339
+ (bn): RmsNormAct2d(
340
+ (drop): Identity()
341
+ (act): Identity()
342
+ )
343
+ )
344
+ (dw_end): Identity()
345
+ (layer_scale): LayerScale2d()
346
+ (drop_path): Identity()
347
+ )
348
+ (1): UniversalInvertedResidual(
349
+ (dw_start): Identity()
350
+ (pw_exp): ConvNormAct(
351
+ (conv): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
352
+ (bn): RmsNormAct2d(
353
+ (drop): Identity()
354
+ (act): GELU(approximate='none')
355
+ )
356
+ )
357
+ (dw_mid): Identity()
358
+ (se): Identity()
359
+ (pw_proj): ConvNormAct(
360
+ (conv): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
361
+ (bn): RmsNormAct2d(
362
+ (drop): Identity()
363
+ (act): Identity()
364
+ )
365
+ )
366
+ (dw_end): Identity()
367
+ (layer_scale): LayerScale2d()
368
+ (drop_path): Identity()
369
+ )
370
+ (2): MobileAttention(
371
+ (norm): RmsNormAct2d(
372
+ (drop): Identity()
373
+ (act): Identity()
374
+ )
375
+ (attn): MultiQueryAttention2d(
376
+ (query): Sequential(
377
+ (proj): Conv2d(8, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
378
+ )
379
+ (key): Sequential(
380
+ (down_conv): Conv2dSame(8, 8, kernel_size=(3, 3), stride=(2, 2), groups=8, bias=False)
381
+ (norm): RmsNorm2d()
382
+ (proj): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
383
+ )
384
+ (value): Sequential(
385
+ (down_conv): Conv2dSame(8, 8, kernel_size=(3, 3), stride=(2, 2), groups=8, bias=False)
386
+ (norm): RmsNorm2d()
387
+ (proj): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
388
+ )
389
+ (attn_drop): Dropout(p=0.0, inplace=False)
390
+ (output): Sequential(
391
+ (proj): Conv2d(16, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
392
+ (drop): Dropout(p=0.0, inplace=False)
393
+ )
394
+ )
395
+ (layer_scale): LayerScale2d()
396
+ (drop_path): Identity()
397
+ )
398
+ (3): UniversalInvertedResidual(
399
+ (dw_start): Identity()
400
+ (pw_exp): ConvNormAct(
401
+ (conv): Conv2d(8, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
402
+ (bn): RmsNormAct2d(
403
+ (drop): Identity()
404
+ (act): GELU(approximate='none')
405
+ )
406
+ )
407
+ (dw_mid): Identity()
408
+ (se): Identity()
409
+ (pw_proj): ConvNormAct(
410
+ (conv): Conv2d(16, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
411
+ (bn): RmsNormAct2d(
412
+ (drop): Identity()
413
+ (act): Identity()
414
+ )
415
+ )
416
+ (dw_end): Identity()
417
+ (layer_scale): LayerScale2d()
418
+ (drop_path): Identity()
419
+ )
420
+ )
421
+ (3): Sequential(
422
+ (0): UniversalInvertedResidual(
423
+ (dw_start): ConvNormAct(
424
+ (conv): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=8, bias=False)
425
+ (bn): RmsNormAct2d(
426
+ (drop): Identity()
427
+ (act): Identity()
428
+ )
429
+ )
430
+ (pw_exp): ConvNormAct(
431
+ (conv): Conv2d(8, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)
432
+ (bn): RmsNormAct2d(
433
+ (drop): Identity()
434
+ (act): GELU(approximate='none')
435
+ )
436
+ )
437
+ (dw_mid): ConvNormAct(
438
+ (conv): Conv2dSame(48, 48, kernel_size=(5, 5), stride=(2, 2), groups=48, bias=False)
439
+ (bn): RmsNormAct2d(
440
+ (drop): Identity()
441
+ (act): GELU(approximate='none')
442
+ )
443
+ )
444
+ (se): Identity()
445
+ (pw_proj): ConvNormAct(
446
+ (conv): Conv2d(48, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
447
+ (bn): RmsNormAct2d(
448
+ (drop): Identity()
449
+ (act): Identity()
450
+ )
451
+ )
452
+ (dw_end): Identity()
453
+ (layer_scale): LayerScale2d()
454
+ (drop_path): Identity()
455
+ )
456
+ (1): MobileAttention(
457
+ (norm): RmsNormAct2d(
458
+ (drop): Identity()
459
+ (act): Identity()
460
+ )
461
+ (attn): MultiQueryAttention2d(
462
+ (query): Sequential(
463
+ (proj): Conv2d(8, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
464
+ )
465
+ (key): Sequential(
466
+ (proj): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
467
+ )
468
+ (value): Sequential(
469
+ (proj): Conv2d(8, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
470
+ )
471
+ (attn_drop): Dropout(p=0.0, inplace=False)
472
+ (output): Sequential(
473
+ (proj): Conv2d(16, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
474
+ (drop): Dropout(p=0.0, inplace=False)
475
+ )
476
+ )
477
+ (layer_scale): LayerScale2d()
478
+ (drop_path): Identity()
479
+ )
480
+ (2): UniversalInvertedResidual(
481
+ (dw_start): Identity()
482
+ (pw_exp): ConvNormAct(
483
+ (conv): Conv2d(8, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
484
+ (bn): RmsNormAct2d(
485
+ (drop): Identity()
486
+ (act): GELU(approximate='none')
487
+ )
488
+ )
489
+ (dw_mid): Identity()
490
+ (se): Identity()
491
+ (pw_proj): ConvNormAct(
492
+ (conv): Conv2d(16, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
493
+ (bn): RmsNormAct2d(
494
+ (drop): Identity()
495
+ (act): Identity()
496
+ )
497
+ )
498
+ (dw_end): Identity()
499
+ (layer_scale): LayerScale2d()
500
+ (drop_path): Identity()
501
+ )
502
+ )
503
+ )
504
+ (msfa): MobileNetV5MultiScaleFusionAdapter(
505
+ (ffn): UniversalInvertedResidual(
506
+ (dw_start): Identity()
507
+ (pw_exp): ConvNormAct(
508
+ (conv): Conv2d(16, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
509
+ (bn): RmsNormAct2d(
510
+ (drop): Identity()
511
+ (act): GELU(approximate='none')
512
+ )
513
+ )
514
+ (dw_mid): Identity()
515
+ (se): Identity()
516
+ (pw_proj): ConvNormAct(
517
+ (conv): Conv2d(32, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
518
+ (bn): RmsNormAct2d(
519
+ (drop): Identity()
520
+ (act): Identity()
521
+ )
522
+ )
523
+ (dw_end): Identity()
524
+ (layer_scale): Identity()
525
+ (drop_path): Identity()
526
+ )
527
+ (norm): RmsNorm2d()
528
+ )
529
+ )
530
+ )
531
+ (language_model): Gemma3nTextModel(
532
+ (embed_tokens): Gemma3nTextScaledWordEmbedding(262400, 4, padding_idx=0)
533
+ (layers): ModuleList(
534
+ (0-3): 4 x Gemma3nTextDecoderLayer(
535
+ (self_attn): Gemma3nTextAttention(
536
+ (q_proj): Linear(in_features=4, out_features=4, bias=False)
537
+ (k_proj): Linear(in_features=4, out_features=2, bias=False)
538
+ (v_proj): Linear(in_features=4, out_features=2, bias=False)
539
+ (o_proj): Linear(in_features=4, out_features=4, bias=False)
540
+ (q_norm): Gemma3nRMSNorm((2,), eps=1e-06)
541
+ (k_norm): Gemma3nRMSNorm((2,), eps=1e-06)
542
+ (v_norm): Gemma3nRMSNorm((), eps=1e-06)
543
+ )
544
+ (mlp): Gemma3nTextMLP(
545
+ (gate_proj): Linear(in_features=4, out_features=8, bias=False)
546
+ (up_proj): Linear(in_features=4, out_features=8, bias=False)
547
+ (down_proj): Linear(in_features=8, out_features=4, bias=False)
548
+ (act_fn): PytorchGELUTanh()
549
+ )
550
+ (input_layernorm): Gemma3nRMSNorm((4,), eps=1e-06)
551
+ (post_attention_layernorm): Gemma3nRMSNorm((4,), eps=1e-06)
552
+ (pre_feedforward_layernorm): Gemma3nRMSNorm((4,), eps=1e-06)
553
+ (post_feedforward_layernorm): Gemma3nRMSNorm((4,), eps=1e-06)
554
+ (act_fn): PytorchGELUTanh()
555
+ (altup): Gemma3nTextAltUp(
556
+ (correction_coefs): Linear(in_features=4, out_features=4, bias=False)
557
+ (prediction_coefs): Linear(in_features=4, out_features=16, bias=False)
558
+ (modality_router): Linear(in_features=4, out_features=4, bias=False)
559
+ (router_norm): Gemma3nRMSNorm((4,), eps=1e-06)
560
+ )
561
+ (laurel): Gemma3nTextLaurelBlock(
562
+ (linear_left): Linear(in_features=4, out_features=1, bias=False)
563
+ (linear_right): Linear(in_features=1, out_features=4, bias=False)
564
+ (post_laurel_norm): Gemma3nRMSNorm((4,), eps=1e-06)
565
+ )
566
+ (per_layer_input_gate): Linear(in_features=4, out_features=1, bias=False)
567
+ (per_layer_projection): Linear(in_features=1, out_features=4, bias=False)
568
+ (post_per_layer_input_norm): Gemma3nRMSNorm((4,), eps=1e-06)
569
+ )
570
+ )
571
+ (norm): Gemma3nRMSNorm((4,), eps=1e-06)
572
+ (rotary_emb): Gemma3nTextRotaryEmbedding()
573
+ (rotary_emb_local): Gemma3nTextRotaryEmbedding()
574
+ (embed_tokens_per_layer): Gemma3nTextScaledWordEmbedding(262144, 4, padding_idx=0)
575
+ (per_layer_model_projection): Linear(in_features=4, out_features=4, bias=False)
576
+ (per_layer_projection_norm): Gemma3nRMSNorm((1,), eps=1e-06)
577
+ (altup_projections): ModuleList(
578
+ (0-2): 3 x Linear(in_features=4, out_features=4, bias=False)
579
+ )
580
+ (altup_unembed_projections): ModuleList(
581
+ (0-2): 3 x Linear(in_features=4, out_features=4, bias=False)
582
+ )
583
+ )
584
+ (audio_tower): Gemma3nAudioEncoder(
585
+ (subsample_conv_projection): Gemma3nAudioSubSampleConvProjection(
586
+ (conv_0): Gemma3nAudioSSCPConvBlock(
587
+ (conv): Conv2d(1, 128, kernel_size=(3, 3), stride=(2, 2), bias=False)
588
+ (norm): Gemma3nAudioCumulativeGroupNorm()
589
+ (activation): ReLU()
590
+ )
591
+ (conv_1): Gemma3nAudioSSCPConvBlock(
592
+ (conv): Conv2d(128, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)
593
+ (norm): Gemma3nAudioCumulativeGroupNorm()
594
+ (activation): ReLU()
595
+ )
596
+ (input_proj_linear): Linear(in_features=1024, out_features=4, bias=False)
597
+ )
598
+ (conformer): ModuleList(
599
+ (0-1): 2 x Gemma3nAudioConformerBlock(
600
+ (ffw_layer_start): Gemma3nAudioConformerFeedForward(
601
+ (pre_layer_norm): Gemma3nRMSNorm((4,), eps=1e-06)
602
+ (ffw_layer_1): Linear(in_features=4, out_features=16, bias=False)
603
+ (ffw_layer_2): Linear(in_features=16, out_features=4, bias=False)
604
+ (post_layer_norm): Gemma3nRMSNorm((4,), eps=1e-06)
605
+ )
606
+ (attention): Gemma3nAudioConformerAttention(
607
+ (pre_attn_norm): Gemma3nRMSNorm((4,), eps=1e-06)
608
+ (attn): Gemma3nAudioAttention(
609
+ (relative_position_embedding): Gemma3nAudioRelativePositionEmbedding(
610
+ (pos_proj): Linear(in_features=4, out_features=4, bias=False)
611
+ )
612
+ (q_proj): Linear(in_features=4, out_features=4, bias=False)
613
+ (k_proj): Linear(in_features=4, out_features=4, bias=False)
614
+ (v_proj): Linear(in_features=4, out_features=4, bias=False)
615
+ )
616
+ (post): Linear(in_features=4, out_features=4, bias=False)
617
+ (post_norm): Gemma3nRMSNorm((4,), eps=1e-06)
618
+ )
619
+ (lconv1d): Gemma3nAudioConformerLightConv1d(
620
+ (pre_layer_norm): Gemma3nRMSNorm((4,), eps=1e-06)
621
+ (linear_start): Linear(in_features=4, out_features=8, bias=False)
622
+ (depthwise_conv1d): Conv1d(4, 4, kernel_size=(5,), stride=(1,), groups=4, bias=False)
623
+ (conv_norm): Gemma3nRMSNorm((4,), eps=1e-06)
624
+ (linear_end): Linear(in_features=4, out_features=4, bias=False)
625
+ )
626
+ (ffw_layer_end): Gemma3nAudioConformerFeedForward(
627
+ (pre_layer_norm): Gemma3nRMSNorm((4,), eps=1e-06)
628
+ (ffw_layer_1): Linear(in_features=4, out_features=16, bias=False)
629
+ (ffw_layer_2): Linear(in_features=16, out_features=4, bias=False)
630
+ (post_layer_norm): Gemma3nRMSNorm((4,), eps=1e-06)
631
+ )
632
+ (norm): Gemma3nRMSNorm((4,), eps=1e-06)
633
+ )
634
+ )
635
+ )
636
+ (embed_vision): Gemma3nMultimodalEmbedder(
637
+ (embedding): Embedding(128, 2048)
638
+ (hard_embedding_norm): Gemma3nRMSNorm((2048,), eps=1e-06)
639
+ (soft_embedding_norm): Gemma3nRMSNorm((2048,), eps=1e-06)
640
+ (embedding_projection): Linear(in_features=2048, out_features=4, bias=False)
641
+ (embedding_post_projection_norm): Gemma3nRMSNorm((), eps=1e-06)
642
+ )
643
+ (embed_audio): Gemma3nMultimodalEmbedder(
644
+ (embedding): Embedding(128, 4)
645
+ (hard_embedding_norm): Gemma3nRMSNorm((4,), eps=1e-06)
646
+ (soft_embedding_norm): Gemma3nRMSNorm((4,), eps=1e-06)
647
+ (embedding_projection): Linear(in_features=4, out_features=4, bias=False)
648
+ (embedding_post_projection_norm): Gemma3nRMSNorm((), eps=1e-06)
649
+ )
650
+ )
651
+ (lm_head): Linear(in_features=4, out_features=262400, bias=False)
652
+ )
653
+ ```
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,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 2,
12
+ "conf_num_hidden_layers": 2,
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": 4,
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
+ "text_config": {
65
+ "activation_sparsity_pattern": [
66
+ 0.95,
67
+ 0.95,
68
+ 0.0,
69
+ 0.0
70
+ ],
71
+ "altup_active_idx": 0,
72
+ "altup_coef_clip": 120.0,
73
+ "altup_correct_scale": true,
74
+ "altup_lr_multiplier": 1.0,
75
+ "altup_num_inputs": 4,
76
+ "attention_bias": false,
77
+ "attention_dropout": 0.0,
78
+ "final_logit_softcapping": 30.0,
79
+ "head_dim": 2,
80
+ "hidden_activation": "gelu_pytorch_tanh",
81
+ "hidden_size": 4,
82
+ "hidden_size_per_layer_input": 1,
83
+ "initializer_range": 0.02,
84
+ "intermediate_size": [
85
+ 8,
86
+ 8,
87
+ 8,
88
+ 8
89
+ ],
90
+ "laurel_rank": 1,
91
+ "layer_types": [
92
+ "sliding_attention",
93
+ "full_attention",
94
+ "sliding_attention",
95
+ "full_attention"
96
+ ],
97
+ "max_position_embeddings": 32768,
98
+ "model_type": "gemma3n_text",
99
+ "num_attention_heads": 2,
100
+ "num_hidden_layers": 4,
101
+ "num_key_value_heads": 1,
102
+ "num_kv_shared_layers": 2,
103
+ "query_pre_attn_scalar": 256,
104
+ "rms_norm_eps": 1e-06,
105
+ "rope_local_base_freq": 10000.0,
106
+ "rope_scaling": null,
107
+ "rope_theta": 1000000.0,
108
+ "sliding_window": 512,
109
+ "torch_dtype": "bfloat16",
110
+ "use_cache": true,
111
+ "vocab_size": 262400,
112
+ "vocab_size_per_layer_input": 262144
113
+ },
114
+ "torch_dtype": "bfloat16",
115
+ "transformers_version": "4.54.0.dev0",
116
+ "vision_config": {
117
+ "architecture": "mobilenetv5_300m_enc",
118
+ "do_pooling": true,
119
+ "hidden_size": 2048,
120
+ "initializer_range": 0.02,
121
+ "label_names": [
122
+ "LABEL_0",
123
+ "LABEL_1"
124
+ ],
125
+ "model_args": {
126
+ "block_args": [
127
+ [
128
+ {
129
+ "act_layer": null,
130
+ "block_type": "er",
131
+ "exp_kernel_size": 3,
132
+ "exp_ratio": 4.0,
133
+ "force_in_chs": 0,
134
+ "noskip": false,
135
+ "out_chs": 4,
136
+ "pw_kernel_size": 1,
137
+ "se_ratio": 0.0,
138
+ "stride": 2
139
+ },
140
+ {
141
+ "act_layer": null,
142
+ "block_type": "er",
143
+ "exp_kernel_size": 3,
144
+ "exp_ratio": 4.0,
145
+ "force_in_chs": 0,
146
+ "noskip": false,
147
+ "out_chs": 4,
148
+ "pw_kernel_size": 1,
149
+ "se_ratio": 0.0,
150
+ "stride": 1
151
+ }
152
+ ],
153
+ [
154
+ {
155
+ "act_layer": null,
156
+ "block_type": "uir",
157
+ "dw_kernel_size_end": 0,
158
+ "dw_kernel_size_mid": 5,
159
+ "dw_kernel_size_start": 3,
160
+ "exp_ratio": 6.0,
161
+ "noskip": false,
162
+ "out_chs": 4,
163
+ "se_ratio": 0.0,
164
+ "stride": 2
165
+ },
166
+ {
167
+ "act_layer": null,
168
+ "block_type": "uir",
169
+ "dw_kernel_size_end": 0,
170
+ "dw_kernel_size_mid": 0,
171
+ "dw_kernel_size_start": 5,
172
+ "exp_ratio": 4.0,
173
+ "noskip": false,
174
+ "out_chs": 4,
175
+ "se_ratio": 0.0,
176
+ "stride": 1
177
+ },
178
+ {
179
+ "act_layer": null,
180
+ "block_type": "uir",
181
+ "dw_kernel_size_end": 0,
182
+ "dw_kernel_size_mid": 0,
183
+ "dw_kernel_size_start": 3,
184
+ "exp_ratio": 4.0,
185
+ "noskip": false,
186
+ "out_chs": 4,
187
+ "se_ratio": 0.0,
188
+ "stride": 1
189
+ }
190
+ ],
191
+ [
192
+ {
193
+ "act_layer": null,
194
+ "block_type": "uir",
195
+ "dw_kernel_size_end": 0,
196
+ "dw_kernel_size_mid": 5,
197
+ "dw_kernel_size_start": 5,
198
+ "exp_ratio": 6.0,
199
+ "noskip": false,
200
+ "out_chs": 4,
201
+ "se_ratio": 0.0,
202
+ "stride": 2
203
+ },
204
+ {
205
+ "act_layer": null,
206
+ "block_type": "uir",
207
+ "dw_kernel_size_end": 0,
208
+ "dw_kernel_size_mid": 0,
209
+ "dw_kernel_size_start": 0,
210
+ "exp_ratio": 1.0,
211
+ "noskip": false,
212
+ "out_chs": 4,
213
+ "se_ratio": 0.0,
214
+ "stride": 1
215
+ },
216
+ {
217
+ "act_layer": null,
218
+ "block_type": "mqa",
219
+ "dw_kernel_size": 3,
220
+ "key_dim": 8,
221
+ "kv_stride": 2,
222
+ "noskip": false,
223
+ "num_heads": 2,
224
+ "out_chs": 4,
225
+ "stride": 1,
226
+ "value_dim": 8
227
+ },
228
+ {
229
+ "act_layer": null,
230
+ "block_type": "uir",
231
+ "dw_kernel_size_end": 0,
232
+ "dw_kernel_size_mid": 0,
233
+ "dw_kernel_size_start": 0,
234
+ "exp_ratio": 2.0,
235
+ "noskip": false,
236
+ "out_chs": 4,
237
+ "se_ratio": 0.0,
238
+ "stride": 1
239
+ }
240
+ ],
241
+ [
242
+ {
243
+ "act_layer": null,
244
+ "block_type": "uir",
245
+ "dw_kernel_size_end": 0,
246
+ "dw_kernel_size_mid": 5,
247
+ "dw_kernel_size_start": 5,
248
+ "exp_ratio": 6.0,
249
+ "noskip": false,
250
+ "out_chs": 4,
251
+ "se_ratio": 0.0,
252
+ "stride": 2
253
+ },
254
+ {
255
+ "act_layer": null,
256
+ "block_type": "mqa",
257
+ "dw_kernel_size": 3,
258
+ "key_dim": 8,
259
+ "kv_stride": 1,
260
+ "noskip": false,
261
+ "num_heads": 2,
262
+ "out_chs": 4,
263
+ "stride": 1,
264
+ "value_dim": 8
265
+ },
266
+ {
267
+ "act_layer": null,
268
+ "block_type": "uir",
269
+ "dw_kernel_size_end": 0,
270
+ "dw_kernel_size_mid": 0,
271
+ "dw_kernel_size_start": 0,
272
+ "exp_ratio": 2.0,
273
+ "noskip": false,
274
+ "out_chs": 4,
275
+ "se_ratio": 0.0,
276
+ "stride": 1
277
+ }
278
+ ]
279
+ ]
280
+ },
281
+ "model_type": "gemma3n_vision",
282
+ "num_classes": 2,
283
+ "rms_norm_eps": 1e-06,
284
+ "torch_dtype": "bfloat16",
285
+ "vocab_offset": 262144,
286
+ "vocab_size": 128
287
+ },
288
+ "vision_soft_tokens_per_image": 256
289
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.54.0.dev0",
13
+ "trust_remote_code": true
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cb0e43b51de3ba0be8964a4bfc1e357e8526c2762209ab2e7230764b082ab86
3
+ size 5334298
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
+ "disable_grouping": null,
7
+ "dither": 0.0,
8
+ "do_center_crop": null,
9
+ "do_convert_rgb": null,
10
+ "do_normalize": false,
11
+ "do_rescale": true,
12
+ "do_resize": true,
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