prince-canuma commited on
Commit
efb0604
·
verified ·
1 Parent(s): 6d36be9

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,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ library_name: transformers
4
+ pipeline_tag: image-text-to-text
5
+ extra_gated_heading: Access Gemma on Hugging Face
6
+ extra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and
7
+ agree to Google’s usage license. To do this, please ensure you’re logged in to Hugging
8
+ Face and click below. Requests are processed immediately.
9
+ extra_gated_button_content: Acknowledge license
10
+ base_model: google/gemma-3n-e4b
11
+ tags:
12
+ - automatic-speech-recognition
13
+ - automatic-speech-translation
14
+ - audio-text-to-text
15
+ - video-text-to-text
16
+ - mlx
17
+ ---
18
+
19
+ # mlx-community/gemma-3n-E2B-bf16
20
+ This model was converted to MLX format from [`google/gemma-3n-E2B`]() using mlx-vlm version **0.2.0**.
21
+ Refer to the [original model card](https://huggingface.co/google/gemma-3n-E2B) for more details on the model.
22
+ ## Use with mlx
23
+
24
+ ```bash
25
+ pip install -U mlx-vlm
26
+ ```
27
+
28
+ ```bash
29
+ python -m mlx_vlm.generate --model mlx-community/gemma-3n-E2B-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
30
+ ```
config.json ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "Gemma3nForConditionalGeneration"
5
+ ],
6
+ "audio_config": {
7
+ "return_dict": true,
8
+ "output_hidden_states": false,
9
+ "torchscript": false,
10
+ "torch_dtype": "bfloat16",
11
+ "use_bfloat16": false,
12
+ "tf_legacy_loss": false,
13
+ "pruned_heads": {},
14
+ "tie_word_embeddings": true,
15
+ "chunk_size_feed_forward": 0,
16
+ "is_encoder_decoder": false,
17
+ "is_decoder": false,
18
+ "cross_attention_hidden_size": null,
19
+ "add_cross_attention": false,
20
+ "tie_encoder_decoder": false,
21
+ "max_length": 20,
22
+ "min_length": 0,
23
+ "do_sample": false,
24
+ "early_stopping": false,
25
+ "num_beams": 1,
26
+ "num_beam_groups": 1,
27
+ "diversity_penalty": 0.0,
28
+ "temperature": 1.0,
29
+ "top_k": 50,
30
+ "top_p": 1.0,
31
+ "typical_p": 1.0,
32
+ "repetition_penalty": 1.0,
33
+ "length_penalty": 1.0,
34
+ "no_repeat_ngram_size": 0,
35
+ "encoder_no_repeat_ngram_size": 0,
36
+ "bad_words_ids": null,
37
+ "num_return_sequences": 1,
38
+ "output_scores": false,
39
+ "return_dict_in_generate": false,
40
+ "forced_bos_token_id": null,
41
+ "forced_eos_token_id": null,
42
+ "remove_invalid_values": false,
43
+ "exponential_decay_length_penalty": null,
44
+ "suppress_tokens": null,
45
+ "begin_suppress_tokens": null,
46
+ "architectures": null,
47
+ "finetuning_task": null,
48
+ "id2label": {
49
+ "0": "LABEL_0",
50
+ "1": "LABEL_1"
51
+ },
52
+ "label2id": {
53
+ "LABEL_0": 0,
54
+ "LABEL_1": 1
55
+ },
56
+ "tokenizer_class": null,
57
+ "prefix": null,
58
+ "bos_token_id": null,
59
+ "pad_token_id": null,
60
+ "eos_token_id": null,
61
+ "sep_token_id": null,
62
+ "decoder_start_token_id": null,
63
+ "task_specific_params": null,
64
+ "problem_type": null,
65
+ "_name_or_path": "",
66
+ "conf_positional_bias_size": 256,
67
+ "model_type": "gemma3n_audio",
68
+ "sscp_conv_eps": 0.001,
69
+ "input_feat_size": 128,
70
+ "hidden_size": 1536,
71
+ "rms_norm_eps": 1e-06,
72
+ "vocab_size": 128,
73
+ "vocab_offset": 262272,
74
+ "gradient_clipping": 10000000000.0,
75
+ "conf_attention_chunk_size": 12,
76
+ "conf_attention_context_left": 13,
77
+ "conf_attention_context_right": 0,
78
+ "conf_attention_logit_cap": 50.0,
79
+ "conf_num_attention_heads": 8,
80
+ "conf_num_hidden_layers": 12,
81
+ "conf_conv_kernel_size": 5,
82
+ "conf_reduction_factor": 4,
83
+ "conf_residual_weight": 0.5,
84
+ "sscp_conv_channel_size": [
85
+ 128,
86
+ 32
87
+ ],
88
+ "sscp_conv_group_norm_eps": 0.001,
89
+ "sscp_conv_kernel_size": [
90
+ [
91
+ 3,
92
+ 3
93
+ ],
94
+ [
95
+ 3,
96
+ 3
97
+ ]
98
+ ],
99
+ "sscp_conv_stride_size": [
100
+ [
101
+ 2,
102
+ 2
103
+ ],
104
+ [
105
+ 2,
106
+ 2
107
+ ]
108
+ ],
109
+ "output_attentions": false
110
+ },
111
+ "audio_soft_tokens_per_image": 188,
112
+ "audio_token_id": 262273,
113
+ "bad_words_ids": null,
114
+ "begin_suppress_tokens": null,
115
+ "boa_token_id": 256000,
116
+ "boi_token_id": 255999,
117
+ "bos_token_id": null,
118
+ "chunk_size_feed_forward": 0,
119
+ "cross_attention_hidden_size": null,
120
+ "decoder_start_token_id": null,
121
+ "diversity_penalty": 0.0,
122
+ "do_sample": false,
123
+ "early_stopping": false,
124
+ "encoder_no_repeat_ngram_size": 0,
125
+ "eoa_token_id": 262272,
126
+ "eoi_token_id": 262144,
127
+ "eos_token_id": null,
128
+ "exponential_decay_length_penalty": null,
129
+ "finetuning_task": null,
130
+ "forced_bos_token_id": null,
131
+ "forced_eos_token_id": null,
132
+ "id2label": {
133
+ "0": "LABEL_0",
134
+ "1": "LABEL_1"
135
+ },
136
+ "image_token_id": 262145,
137
+ "initializer_range": 0.02,
138
+ "is_decoder": false,
139
+ "is_encoder_decoder": false,
140
+ "label2id": {
141
+ "LABEL_0": 0,
142
+ "LABEL_1": 1
143
+ },
144
+ "length_penalty": 1.0,
145
+ "max_length": 20,
146
+ "min_length": 0,
147
+ "model_type": "gemma3n",
148
+ "no_repeat_ngram_size": 0,
149
+ "num_beam_groups": 1,
150
+ "num_beams": 1,
151
+ "num_return_sequences": 1,
152
+ "output_attentions": false,
153
+ "output_hidden_states": false,
154
+ "output_scores": false,
155
+ "pad_token_id": null,
156
+ "prefix": null,
157
+ "problem_type": null,
158
+ "pruned_heads": {},
159
+ "remove_invalid_values": false,
160
+ "repetition_penalty": 1.0,
161
+ "return_dict": true,
162
+ "return_dict_in_generate": false,
163
+ "sep_token_id": null,
164
+ "suppress_tokens": null,
165
+ "task_specific_params": null,
166
+ "temperature": 1.0,
167
+ "text_config": {
168
+ "return_dict": true,
169
+ "output_hidden_states": false,
170
+ "torchscript": false,
171
+ "torch_dtype": "bfloat16",
172
+ "use_bfloat16": false,
173
+ "tf_legacy_loss": false,
174
+ "pruned_heads": {},
175
+ "tie_word_embeddings": true,
176
+ "chunk_size_feed_forward": 0,
177
+ "is_encoder_decoder": false,
178
+ "is_decoder": false,
179
+ "cross_attention_hidden_size": null,
180
+ "add_cross_attention": false,
181
+ "tie_encoder_decoder": false,
182
+ "max_length": 20,
183
+ "min_length": 0,
184
+ "do_sample": false,
185
+ "early_stopping": false,
186
+ "num_beams": 1,
187
+ "num_beam_groups": 1,
188
+ "diversity_penalty": 0.0,
189
+ "temperature": 1.0,
190
+ "top_k": 50,
191
+ "top_p": 1.0,
192
+ "typical_p": 1.0,
193
+ "repetition_penalty": 1.0,
194
+ "length_penalty": 1.0,
195
+ "no_repeat_ngram_size": 0,
196
+ "encoder_no_repeat_ngram_size": 0,
197
+ "bad_words_ids": null,
198
+ "num_return_sequences": 1,
199
+ "output_scores": false,
200
+ "return_dict_in_generate": false,
201
+ "forced_bos_token_id": null,
202
+ "forced_eos_token_id": null,
203
+ "remove_invalid_values": false,
204
+ "exponential_decay_length_penalty": null,
205
+ "suppress_tokens": null,
206
+ "begin_suppress_tokens": null,
207
+ "architectures": null,
208
+ "finetuning_task": null,
209
+ "id2label": {
210
+ "0": "LABEL_0",
211
+ "1": "LABEL_1"
212
+ },
213
+ "label2id": {
214
+ "LABEL_0": 0,
215
+ "LABEL_1": 1
216
+ },
217
+ "tokenizer_class": null,
218
+ "prefix": null,
219
+ "bos_token_id": 2,
220
+ "pad_token_id": 0,
221
+ "eos_token_id": 1,
222
+ "sep_token_id": null,
223
+ "decoder_start_token_id": null,
224
+ "task_specific_params": null,
225
+ "problem_type": null,
226
+ "_name_or_path": "",
227
+ "altup_lr_multiplier": 1.0,
228
+ "model_type": "gemma3n_text",
229
+ "query_pre_attn_scalar": 256,
230
+ "vocab_size": 262400,
231
+ "vocab_size_per_layer_input": 262144,
232
+ "max_position_embeddings": 32768,
233
+ "hidden_size": 2048,
234
+ "intermediate_size": 8192,
235
+ "num_hidden_layers": 30,
236
+ "num_attention_heads": 8,
237
+ "head_dim": 256,
238
+ "num_key_value_heads": 2,
239
+ "initializer_range": 0.02,
240
+ "rms_norm_eps": 1e-06,
241
+ "use_cache": true,
242
+ "rope_theta": 1000000.0,
243
+ "attention_bias": false,
244
+ "attention_dropout": 0.0,
245
+ "hidden_activation": "gelu_pytorch_tanh",
246
+ "sliding_window": 512,
247
+ "final_logit_softcapping": 30.0,
248
+ "layer_types": [
249
+ "sliding_attention",
250
+ "sliding_attention",
251
+ "sliding_attention",
252
+ "sliding_attention",
253
+ "full_attention",
254
+ "sliding_attention",
255
+ "sliding_attention",
256
+ "sliding_attention",
257
+ "sliding_attention",
258
+ "full_attention",
259
+ "sliding_attention",
260
+ "sliding_attention",
261
+ "sliding_attention",
262
+ "sliding_attention",
263
+ "full_attention",
264
+ "sliding_attention",
265
+ "sliding_attention",
266
+ "sliding_attention",
267
+ "sliding_attention",
268
+ "full_attention",
269
+ "sliding_attention",
270
+ "sliding_attention",
271
+ "sliding_attention",
272
+ "sliding_attention",
273
+ "full_attention",
274
+ "sliding_attention",
275
+ "sliding_attention",
276
+ "sliding_attention",
277
+ "sliding_attention",
278
+ "full_attention"
279
+ ],
280
+ "rope_local_base_freq": 10000.0,
281
+ "rope_scaling": null,
282
+ "hidden_size_per_layer_input": 256,
283
+ "num_kv_shared_layers": 10,
284
+ "altup_active_idx": 0,
285
+ "altup_coef_clip": 120.0,
286
+ "altup_correct_scale": true,
287
+ "altup_num_inputs": 4,
288
+ "laurel_rank": 64,
289
+ "activation_sparsity_pattern": [
290
+ 0.95,
291
+ 0.95,
292
+ 0.95,
293
+ 0.95,
294
+ 0.95,
295
+ 0.95,
296
+ 0.95,
297
+ 0.95,
298
+ 0.95,
299
+ 0.95,
300
+ 0.0,
301
+ 0.0,
302
+ 0.0,
303
+ 0.0,
304
+ 0.0,
305
+ 0.0,
306
+ 0.0,
307
+ 0.0,
308
+ 0.0,
309
+ 0.0,
310
+ 0.0,
311
+ 0.0,
312
+ 0.0,
313
+ 0.0,
314
+ 0.0,
315
+ 0.0,
316
+ 0.0,
317
+ 0.0,
318
+ 0.0,
319
+ 0.0
320
+ ],
321
+ "output_attentions": false
322
+ },
323
+ "tf_legacy_loss": false,
324
+ "tie_encoder_decoder": false,
325
+ "tie_word_embeddings": true,
326
+ "tokenizer_class": null,
327
+ "top_k": 50,
328
+ "top_p": 1.0,
329
+ "torchscript": false,
330
+ "transformers_version": "4.53.0.dev0",
331
+ "typical_p": 1.0,
332
+ "use_bfloat16": false,
333
+ "vision_config": {
334
+ "return_dict": true,
335
+ "output_hidden_states": false,
336
+ "torchscript": false,
337
+ "torch_dtype": "bfloat16",
338
+ "use_bfloat16": false,
339
+ "tf_legacy_loss": false,
340
+ "pruned_heads": {},
341
+ "tie_word_embeddings": true,
342
+ "chunk_size_feed_forward": 0,
343
+ "is_encoder_decoder": false,
344
+ "is_decoder": false,
345
+ "cross_attention_hidden_size": null,
346
+ "add_cross_attention": false,
347
+ "tie_encoder_decoder": false,
348
+ "max_length": 20,
349
+ "min_length": 0,
350
+ "do_sample": false,
351
+ "early_stopping": false,
352
+ "num_beams": 1,
353
+ "num_beam_groups": 1,
354
+ "diversity_penalty": 0.0,
355
+ "temperature": 1.0,
356
+ "top_k": 50,
357
+ "top_p": 1.0,
358
+ "typical_p": 1.0,
359
+ "repetition_penalty": 1.0,
360
+ "length_penalty": 1.0,
361
+ "no_repeat_ngram_size": 0,
362
+ "encoder_no_repeat_ngram_size": 0,
363
+ "bad_words_ids": null,
364
+ "num_return_sequences": 1,
365
+ "output_scores": false,
366
+ "return_dict_in_generate": false,
367
+ "forced_bos_token_id": null,
368
+ "forced_eos_token_id": null,
369
+ "remove_invalid_values": false,
370
+ "exponential_decay_length_penalty": null,
371
+ "suppress_tokens": null,
372
+ "begin_suppress_tokens": null,
373
+ "architectures": null,
374
+ "finetuning_task": null,
375
+ "tokenizer_class": null,
376
+ "prefix": null,
377
+ "bos_token_id": null,
378
+ "pad_token_id": null,
379
+ "eos_token_id": null,
380
+ "sep_token_id": null,
381
+ "decoder_start_token_id": null,
382
+ "task_specific_params": null,
383
+ "problem_type": null,
384
+ "_name_or_path": "",
385
+ "label_names": [
386
+ "LABEL_0",
387
+ "LABEL_1"
388
+ ],
389
+ "model_type": "gemma3n_vision",
390
+ "num_classes": 2,
391
+ "initializer_range": 0.02,
392
+ "do_pooling": true,
393
+ "architecture": "mobilenetv5_300m_enc",
394
+ "hidden_size": 2048,
395
+ "vocab_size": 128,
396
+ "vocab_offset": 262144,
397
+ "rms_norm_eps": 1e-06,
398
+ "output_attentions": false
399
+ },
400
+ "vision_soft_tokens_per_image": 256
401
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": 1,
6
+ "pad_token_id": 0,
7
+ "top_k": 64,
8
+ "top_p": 0.95,
9
+ "transformers_version": "4.53.0.dev0"
10
+ }
model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:789e776c86493ff2a45c406899b13a9be0df0fedc948e4a6804b278b62cf17d4
3
+ size 4804083035
model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bf0bc27c85dcf8507828850208c346c28030b4d99cdabca87d93eb4a2cefb9e
3
+ size 5362676072
model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc1a27c49eb42f9205f3f9b88479d30d6a8629fa520b68777cb55d1e9342ecaf
3
+ size 1787111449
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,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_size": 128,
13
+ "fft_length": 1024,
14
+ "fft_overdrive": true,
15
+ "frame_length": 512,
16
+ "hop_length": 160,
17
+ "image_mean": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "image_processor_type": "SiglipImageProcessorFast",
23
+ "image_seq_length": 256,
24
+ "image_std": [
25
+ 0.5,
26
+ 0.5,
27
+ 0.5
28
+ ],
29
+ "input_data_format": null,
30
+ "input_scale_factor": 1.0,
31
+ "max_frequency": 7600.0,
32
+ "mel_floor": 1e-05,
33
+ "min_frequency": 125.0,
34
+ "padding_side": "right",
35
+ "padding_value": 0.0,
36
+ "per_bin_mean": null,
37
+ "per_bin_stddev": null,
38
+ "preemphasis": 0.97,
39
+ "preemphasis_htk_flavor": true,
40
+ "processor_class": "Gemma3nProcessor",
41
+ "resample": 2,
42
+ "rescale_factor": 0.00392156862745098,
43
+ "return_attention_mask": false,
44
+ "return_tensors": null,
45
+ "sampling_rate": 16000,
46
+ "size": {
47
+ "height": 768,
48
+ "width": 768
49
+ }
50
+ }
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