prince-canuma commited on
Commit
705f113
·
verified ·
1 Parent(s): 4648c06

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,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mlx
3
+ license: apache-2.0
4
+ license_link: https://ai.google.dev/gemma/docs/gemma_4_license
5
+ pipeline_tag: any-to-any
6
+ tags:
7
+ - mlx
8
+ base_model: google/gemma-4-e4b
9
+ ---
10
+
11
+ # mlx-community/gemma-4-e4b-bf16
12
+
13
+ This model was converted to MLX format from [`google/gemma-4-e4b`](https://huggingface.co/google/gemma-4-e4b)
14
+ using mlx-vlm version **0.4.3**.
15
+ Refer to the [original model card](https://huggingface.co/google/gemma-4-e4b) for more details on the model.
16
+
17
+ ## Use with mlx
18
+
19
+ ```bash
20
+ pip install -U mlx-vlm
21
+ ```
22
+
23
+ ```bash
24
+ python -m mlx_vlm.generate --model mlx-community/gemma-4-e4b-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
25
+ ```
config.json ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma4ForConditionalGeneration"
4
+ ],
5
+ "audio_config": {
6
+ "_name_or_path": "",
7
+ "architectures": null,
8
+ "attention_chunk_size": 12,
9
+ "attention_context_left": 13,
10
+ "attention_context_right": 0,
11
+ "attention_invalid_logits_value": -1000000000.0,
12
+ "attention_logit_cap": 50.0,
13
+ "chunk_size_feed_forward": 0,
14
+ "conv_kernel_size": 5,
15
+ "dtype": "bfloat16",
16
+ "gradient_clipping": 10000000000.0,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 1024,
19
+ "id2label": {
20
+ "0": "LABEL_0",
21
+ "1": "LABEL_1"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "is_encoder_decoder": false,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1
28
+ },
29
+ "model_type": "gemma4_audio",
30
+ "num_attention_heads": 8,
31
+ "num_hidden_layers": 12,
32
+ "output_attentions": false,
33
+ "output_hidden_states": false,
34
+ "output_proj_dims": 1536,
35
+ "problem_type": null,
36
+ "residual_weight": 0.5,
37
+ "return_dict": true,
38
+ "rms_norm_eps": 1e-06,
39
+ "subsampling_conv_channels": [
40
+ 128,
41
+ 32
42
+ ],
43
+ "use_clipped_linears": true
44
+ },
45
+ "audio_token_id": 258881,
46
+ "boa_token_id": 256000,
47
+ "boi_token_id": 255999,
48
+ "dtype": "bfloat16",
49
+ "eoa_token_id": 258883,
50
+ "eoa_token_index": 258883,
51
+ "eoi_token_id": 258882,
52
+ "eos_token_id": 1,
53
+ "image_token_id": 258880,
54
+ "initializer_range": 0.02,
55
+ "model_type": "gemma4",
56
+ "text_config": {
57
+ "attention_bias": false,
58
+ "attention_dropout": 0.0,
59
+ "attention_k_eq_v": false,
60
+ "bos_token_id": 2,
61
+ "dtype": "bfloat16",
62
+ "enable_moe_block": false,
63
+ "eos_token_id": 1,
64
+ "expert_intermediate_size": null,
65
+ "final_logit_softcapping": 30.0,
66
+ "global_head_dim": 512,
67
+ "head_dim": 256,
68
+ "hidden_activation": "gelu_pytorch_tanh",
69
+ "hidden_size": 2560,
70
+ "hidden_size_per_layer_input": 256,
71
+ "initializer_range": 0.02,
72
+ "intermediate_size": 10240,
73
+ "layer_types": [
74
+ "sliding_attention",
75
+ "sliding_attention",
76
+ "sliding_attention",
77
+ "sliding_attention",
78
+ "sliding_attention",
79
+ "full_attention",
80
+ "sliding_attention",
81
+ "sliding_attention",
82
+ "sliding_attention",
83
+ "sliding_attention",
84
+ "sliding_attention",
85
+ "full_attention",
86
+ "sliding_attention",
87
+ "sliding_attention",
88
+ "sliding_attention",
89
+ "sliding_attention",
90
+ "sliding_attention",
91
+ "full_attention",
92
+ "sliding_attention",
93
+ "sliding_attention",
94
+ "sliding_attention",
95
+ "sliding_attention",
96
+ "sliding_attention",
97
+ "full_attention",
98
+ "sliding_attention",
99
+ "sliding_attention",
100
+ "sliding_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "full_attention",
104
+ "sliding_attention",
105
+ "sliding_attention",
106
+ "sliding_attention",
107
+ "sliding_attention",
108
+ "sliding_attention",
109
+ "full_attention",
110
+ "sliding_attention",
111
+ "sliding_attention",
112
+ "sliding_attention",
113
+ "sliding_attention",
114
+ "sliding_attention",
115
+ "full_attention"
116
+ ],
117
+ "max_position_embeddings": 131072,
118
+ "model_type": "gemma4_text",
119
+ "num_attention_heads": 8,
120
+ "num_experts": null,
121
+ "num_global_key_value_heads": null,
122
+ "num_hidden_layers": 42,
123
+ "num_key_value_heads": 2,
124
+ "num_kv_shared_layers": 18,
125
+ "pad_token_id": 0,
126
+ "rms_norm_eps": 1e-06,
127
+ "rope_parameters": {
128
+ "full_attention": {
129
+ "partial_rotary_factor": 0.25,
130
+ "rope_theta": 1000000.0,
131
+ "rope_type": "proportional"
132
+ },
133
+ "sliding_attention": {
134
+ "rope_theta": 10000.0,
135
+ "rope_type": "default"
136
+ }
137
+ },
138
+ "sliding_window": 512,
139
+ "tie_word_embeddings": true,
140
+ "top_k_experts": null,
141
+ "use_bidirectional_attention": null,
142
+ "use_cache": true,
143
+ "use_double_wide_mlp": false,
144
+ "vocab_size": 262144,
145
+ "vocab_size_per_layer_input": 262144
146
+ },
147
+ "tie_word_embeddings": true,
148
+ "transformers_version": "5.5.0.dev0",
149
+ "video_token_id": 258884,
150
+ "vision_config": {
151
+ "_name_or_path": "",
152
+ "architectures": null,
153
+ "attention_bias": false,
154
+ "attention_dropout": 0.0,
155
+ "chunk_size_feed_forward": 0,
156
+ "default_output_length": 280,
157
+ "dtype": "bfloat16",
158
+ "global_head_dim": 64,
159
+ "head_dim": 64,
160
+ "hidden_activation": "gelu_pytorch_tanh",
161
+ "hidden_size": 768,
162
+ "id2label": {
163
+ "0": "LABEL_0",
164
+ "1": "LABEL_1"
165
+ },
166
+ "initializer_range": 0.02,
167
+ "intermediate_size": 3072,
168
+ "is_encoder_decoder": false,
169
+ "label2id": {
170
+ "LABEL_0": 0,
171
+ "LABEL_1": 1
172
+ },
173
+ "max_position_embeddings": 131072,
174
+ "model_type": "gemma4_vision",
175
+ "num_attention_heads": 12,
176
+ "num_hidden_layers": 16,
177
+ "num_key_value_heads": 12,
178
+ "output_attentions": false,
179
+ "output_hidden_states": false,
180
+ "patch_size": 16,
181
+ "pooling_kernel_size": 3,
182
+ "position_embedding_size": 10240,
183
+ "problem_type": null,
184
+ "return_dict": true,
185
+ "rms_norm_eps": 1e-06,
186
+ "rope_parameters": {
187
+ "rope_theta": 100.0,
188
+ "rope_type": "default"
189
+ },
190
+ "standardize": false,
191
+ "use_clipped_linears": true
192
+ },
193
+ "vision_soft_tokens_per_image": 280
194
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "do_sample": true,
4
+ "eos_token_id": 1,
5
+ "pad_token_id": 0,
6
+ "temperature": 1.0,
7
+ "top_k": 64,
8
+ "top_p": 0.95,
9
+ "transformers_version": "5.5.0.dev0"
10
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7c7302cb6f9ad68a29e8bacade5babb450321e730952f037a18360133ecedf9
3
+ size 5356212649
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b948977551db1a0067bc8da35c1a67136d3dbcba234a3d580bb847086cc2307c
3
+ size 3987823668
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84706eb44169e1891c38046e4c9e5613f9f350e1b815067bb864e3fd2df7376a
3
+ size 5637144740
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ae36499d5e599e94a73ffbb2bc85fecd21511e188e0165a947ed5deb0b211ab
3
+ size 1011402419
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
processor_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_seq_length": 750,
3
+ "image_processor": {
4
+ "do_convert_rgb": true,
5
+ "do_normalize": false,
6
+ "do_rescale": true,
7
+ "do_resize": true,
8
+ "image_mean": [
9
+ 0.0,
10
+ 0.0,
11
+ 0.0
12
+ ],
13
+ "image_processor_type": "Gemma4ImageProcessor",
14
+ "image_seq_length": 280,
15
+ "image_std": [
16
+ 1.0,
17
+ 1.0,
18
+ 1.0
19
+ ],
20
+ "max_soft_tokens": 280,
21
+ "patch_size": 16,
22
+ "pooling_kernel_size": 3,
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "height": 224,
27
+ "width": 224
28
+ }
29
+ },
30
+ "image_seq_length": 280,
31
+ "processor_class": "Gemma4Processor"
32
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12bac982b793c44b03d52a250a9f0d0b666813da566b910c24a6da0695fd11e6
3
+ size 32170070
tokenizer_config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_token": "<|audio|>",
3
+ "backend": "tokenizers",
4
+ "boa_token": "<|audio>",
5
+ "boi_token": "<|image>",
6
+ "bos_token": "<bos>",
7
+ "eoa_token": "<audio|>",
8
+ "eoc_token": "<channel|>",
9
+ "eoi_token": "<image|>",
10
+ "eos_token": "<eos>",
11
+ "eot_token": "<turn|>",
12
+ "escape_token": "<|\"|>",
13
+ "etc_token": "<tool_call|>",
14
+ "etd_token": "<tool|>",
15
+ "etr_token": "<tool_response|>",
16
+ "extra_special_tokens": [
17
+ "<|video|>"
18
+ ],
19
+ "image_token": "<|image|>",
20
+ "is_local": true,
21
+ "mask_token": "<mask>",
22
+ "model_max_length": 1000000000000000019884624838656,
23
+ "model_specific_special_tokens": {
24
+ "audio_token": "<|audio|>",
25
+ "boa_token": "<|audio>",
26
+ "boi_token": "<|image>",
27
+ "eoa_token": "<audio|>",
28
+ "eoc_token": "<channel|>",
29
+ "eoi_token": "<image|>",
30
+ "eot_token": "<turn|>",
31
+ "escape_token": "<|\"|>",
32
+ "etc_token": "<tool_call|>",
33
+ "etd_token": "<tool|>",
34
+ "etr_token": "<tool_response|>",
35
+ "image_token": "<|image|>",
36
+ "soc_token": "<|channel>",
37
+ "sot_token": "<|turn>",
38
+ "stc_token": "<|tool_call>",
39
+ "std_token": "<|tool>",
40
+ "str_token": "<|tool_response>",
41
+ "think_token": "<|think|>"
42
+ },
43
+ "pad_token": "<pad>",
44
+ "padding_side": "left",
45
+ "processor_class": "Gemma4Processor",
46
+ "soc_token": "<|channel>",
47
+ "sot_token": "<|turn>",
48
+ "stc_token": "<|tool_call>",
49
+ "std_token": "<|tool>",
50
+ "str_token": "<|tool_response>",
51
+ "think_token": "<|think|>",
52
+ "tokenizer_class": "GemmaTokenizer",
53
+ "unk_token": "<unk>"
54
+ }