prince-canuma commited on
Commit
fae89b2
·
verified ·
1 Parent(s): c410fd6

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: image-text-to-text
6
+ base_model: google/gemma-4-31b
7
+ tags:
8
+ - mlx
9
+ ---
10
+
11
+ # mlx-community/gemma-4-31b-5bit
12
+
13
+ This model was converted to MLX format from [`google/gemma-4-31b`](https://huggingface.co/google/gemma-4-31b)
14
+ using mlx-vlm version **0.4.3**.
15
+ Refer to the [original model card](https://huggingface.co/google/gemma-4-31b) 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-31b-5bit --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
25
+ ```
config.json ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma4ForConditionalGeneration"
4
+ ],
5
+ "audio_config": null,
6
+ "audio_token_id": 258881,
7
+ "boa_token_id": 256000,
8
+ "boi_token_id": 255999,
9
+ "dtype": "bfloat16",
10
+ "eoa_token_id": 258883,
11
+ "eoa_token_index": 258883,
12
+ "eoi_token_id": 258882,
13
+ "eos_token_id": 1,
14
+ "image_token_id": 258880,
15
+ "initializer_range": 0.02,
16
+ "model_type": "gemma4",
17
+ "quantization": {
18
+ "group_size": 64,
19
+ "bits": 5,
20
+ "mode": "affine"
21
+ },
22
+ "quantization_config": {
23
+ "group_size": 64,
24
+ "bits": 5,
25
+ "mode": "affine"
26
+ },
27
+ "text_config": {
28
+ "attention_bias": false,
29
+ "attention_dropout": 0.0,
30
+ "attention_k_eq_v": true,
31
+ "bos_token_id": 2,
32
+ "dtype": "bfloat16",
33
+ "enable_moe_block": false,
34
+ "eos_token_id": 1,
35
+ "expert_intermediate_size": null,
36
+ "final_logit_softcapping": 30.0,
37
+ "global_head_dim": 512,
38
+ "head_dim": 256,
39
+ "hidden_activation": "gelu_pytorch_tanh",
40
+ "hidden_size": 5376,
41
+ "hidden_size_per_layer_input": 0,
42
+ "initializer_range": 0.02,
43
+ "intermediate_size": 21504,
44
+ "layer_types": [
45
+ "sliding_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "sliding_attention",
49
+ "sliding_attention",
50
+ "full_attention",
51
+ "sliding_attention",
52
+ "sliding_attention",
53
+ "sliding_attention",
54
+ "sliding_attention",
55
+ "sliding_attention",
56
+ "full_attention",
57
+ "sliding_attention",
58
+ "sliding_attention",
59
+ "sliding_attention",
60
+ "sliding_attention",
61
+ "sliding_attention",
62
+ "full_attention",
63
+ "sliding_attention",
64
+ "sliding_attention",
65
+ "sliding_attention",
66
+ "sliding_attention",
67
+ "sliding_attention",
68
+ "full_attention",
69
+ "sliding_attention",
70
+ "sliding_attention",
71
+ "sliding_attention",
72
+ "sliding_attention",
73
+ "sliding_attention",
74
+ "full_attention",
75
+ "sliding_attention",
76
+ "sliding_attention",
77
+ "sliding_attention",
78
+ "sliding_attention",
79
+ "sliding_attention",
80
+ "full_attention",
81
+ "sliding_attention",
82
+ "sliding_attention",
83
+ "sliding_attention",
84
+ "sliding_attention",
85
+ "sliding_attention",
86
+ "full_attention",
87
+ "sliding_attention",
88
+ "sliding_attention",
89
+ "sliding_attention",
90
+ "sliding_attention",
91
+ "sliding_attention",
92
+ "full_attention",
93
+ "sliding_attention",
94
+ "sliding_attention",
95
+ "sliding_attention",
96
+ "sliding_attention",
97
+ "sliding_attention",
98
+ "full_attention",
99
+ "sliding_attention",
100
+ "sliding_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "sliding_attention",
104
+ "full_attention"
105
+ ],
106
+ "max_position_embeddings": 262144,
107
+ "model_type": "gemma4_text",
108
+ "num_attention_heads": 32,
109
+ "num_experts": null,
110
+ "num_global_key_value_heads": 4,
111
+ "num_hidden_layers": 60,
112
+ "num_key_value_heads": 16,
113
+ "num_kv_shared_layers": 0,
114
+ "pad_token_id": 0,
115
+ "rms_norm_eps": 1e-06,
116
+ "rope_parameters": {
117
+ "full_attention": {
118
+ "partial_rotary_factor": 0.25,
119
+ "rope_theta": 1000000.0,
120
+ "rope_type": "proportional"
121
+ },
122
+ "sliding_attention": {
123
+ "rope_theta": 10000.0,
124
+ "rope_type": "default"
125
+ }
126
+ },
127
+ "sliding_window": 1024,
128
+ "tie_word_embeddings": true,
129
+ "top_k_experts": null,
130
+ "use_bidirectional_attention": "vision",
131
+ "use_cache": true,
132
+ "use_double_wide_mlp": false,
133
+ "vocab_size": 262144,
134
+ "vocab_size_per_layer_input": 262144
135
+ },
136
+ "tie_word_embeddings": true,
137
+ "transformers_version": "5.5.0.dev0",
138
+ "video_token_id": 258884,
139
+ "vision_config": {
140
+ "attention_bias": false,
141
+ "attention_dropout": 0.0,
142
+ "default_output_length": 280,
143
+ "dtype": "bfloat16",
144
+ "global_head_dim": 72,
145
+ "head_dim": 72,
146
+ "hidden_activation": "gelu_pytorch_tanh",
147
+ "hidden_size": 1152,
148
+ "intermediate_size": 4304,
149
+ "max_position_embeddings": 131072,
150
+ "model_type": "gemma4_vision",
151
+ "num_attention_heads": 16,
152
+ "num_hidden_layers": 27,
153
+ "num_key_value_heads": 16,
154
+ "patch_size": 16,
155
+ "pooling_kernel_size": 3,
156
+ "position_embedding_size": 10240,
157
+ "rms_norm_eps": 1e-06,
158
+ "rope_parameters": {
159
+ "rope_theta": 100.0,
160
+ "rope_type": "default"
161
+ },
162
+ "standardize": true,
163
+ "use_clipped_linears": false
164
+ },
165
+ "vision_soft_tokens_per_image": 280
166
+ }
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-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29a601ad62e1d4a20d36305cc79c43bb63915dbdd87c5776df2741f376fba93b
3
+ size 5355977471
model-00002-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd8576d2f7c22107aa405b676b2683f05b20de112d65d8841704c19643ba8b70
3
+ size 5314487857
model-00003-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d8fa02548f0557516144eb758157c8285c3bc40d42ea438dd12c079e391200a
3
+ size 5303090773
model-00004-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fffa74350417bb15bddd95c8770524cb69f3d39c925d6b576f70b46ab234bf3d
3
+ size 5363829722
model-00005-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29ce5a6955e8aaefca709a6aaf803e8c9604635e52d4272820297fde070ac3d5
3
+ size 912406622
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
+ }