prince-canuma commited on
Commit
19f0f1a
·
verified ·
1 Parent(s): 97b0791

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-bf16
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-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
25
+ ```
config.json ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "text_config": {
18
+ "attention_bias": false,
19
+ "attention_dropout": 0.0,
20
+ "attention_k_eq_v": true,
21
+ "bos_token_id": 2,
22
+ "dtype": "bfloat16",
23
+ "enable_moe_block": false,
24
+ "eos_token_id": 1,
25
+ "expert_intermediate_size": null,
26
+ "final_logit_softcapping": 30.0,
27
+ "global_head_dim": 512,
28
+ "head_dim": 256,
29
+ "hidden_activation": "gelu_pytorch_tanh",
30
+ "hidden_size": 5376,
31
+ "hidden_size_per_layer_input": 0,
32
+ "initializer_range": 0.02,
33
+ "intermediate_size": 21504,
34
+ "layer_types": [
35
+ "sliding_attention",
36
+ "sliding_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "full_attention",
41
+ "sliding_attention",
42
+ "sliding_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "sliding_attention",
46
+ "full_attention",
47
+ "sliding_attention",
48
+ "sliding_attention",
49
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "sliding_attention",
52
+ "full_attention",
53
+ "sliding_attention",
54
+ "sliding_attention",
55
+ "sliding_attention",
56
+ "sliding_attention",
57
+ "sliding_attention",
58
+ "full_attention",
59
+ "sliding_attention",
60
+ "sliding_attention",
61
+ "sliding_attention",
62
+ "sliding_attention",
63
+ "sliding_attention",
64
+ "full_attention",
65
+ "sliding_attention",
66
+ "sliding_attention",
67
+ "sliding_attention",
68
+ "sliding_attention",
69
+ "sliding_attention",
70
+ "full_attention",
71
+ "sliding_attention",
72
+ "sliding_attention",
73
+ "sliding_attention",
74
+ "sliding_attention",
75
+ "sliding_attention",
76
+ "full_attention",
77
+ "sliding_attention",
78
+ "sliding_attention",
79
+ "sliding_attention",
80
+ "sliding_attention",
81
+ "sliding_attention",
82
+ "full_attention",
83
+ "sliding_attention",
84
+ "sliding_attention",
85
+ "sliding_attention",
86
+ "sliding_attention",
87
+ "sliding_attention",
88
+ "full_attention",
89
+ "sliding_attention",
90
+ "sliding_attention",
91
+ "sliding_attention",
92
+ "sliding_attention",
93
+ "sliding_attention",
94
+ "full_attention"
95
+ ],
96
+ "max_position_embeddings": 262144,
97
+ "model_type": "gemma4_text",
98
+ "num_attention_heads": 32,
99
+ "num_experts": null,
100
+ "num_global_key_value_heads": 4,
101
+ "num_hidden_layers": 60,
102
+ "num_key_value_heads": 16,
103
+ "num_kv_shared_layers": 0,
104
+ "pad_token_id": 0,
105
+ "rms_norm_eps": 1e-06,
106
+ "rope_parameters": {
107
+ "full_attention": {
108
+ "partial_rotary_factor": 0.25,
109
+ "rope_theta": 1000000.0,
110
+ "rope_type": "proportional"
111
+ },
112
+ "sliding_attention": {
113
+ "rope_theta": 10000.0,
114
+ "rope_type": "default"
115
+ }
116
+ },
117
+ "sliding_window": 1024,
118
+ "tie_word_embeddings": true,
119
+ "top_k_experts": null,
120
+ "use_bidirectional_attention": "vision",
121
+ "use_cache": true,
122
+ "use_double_wide_mlp": false,
123
+ "vocab_size": 262144,
124
+ "vocab_size_per_layer_input": 262144
125
+ },
126
+ "tie_word_embeddings": true,
127
+ "transformers_version": "5.5.0.dev0",
128
+ "video_token_id": 258884,
129
+ "vision_config": {
130
+ "attention_bias": false,
131
+ "attention_dropout": 0.0,
132
+ "default_output_length": 280,
133
+ "dtype": "bfloat16",
134
+ "global_head_dim": 72,
135
+ "head_dim": 72,
136
+ "hidden_activation": "gelu_pytorch_tanh",
137
+ "hidden_size": 1152,
138
+ "intermediate_size": 4304,
139
+ "max_position_embeddings": 131072,
140
+ "model_type": "gemma4_vision",
141
+ "num_attention_heads": 16,
142
+ "num_hidden_layers": 27,
143
+ "num_key_value_heads": 16,
144
+ "patch_size": 16,
145
+ "pooling_kernel_size": 3,
146
+ "position_embedding_size": 10240,
147
+ "rms_norm_eps": 1e-06,
148
+ "rope_parameters": {
149
+ "rope_theta": 100.0,
150
+ "rope_type": "default"
151
+ },
152
+ "standardize": true,
153
+ "use_clipped_linears": false
154
+ },
155
+ "vision_soft_tokens_per_image": 280
156
+ }
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-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df5375ae0208c5f42ef0b3d865613e2a7404185fe1c296e607e095488afa0479
3
+ size 5229866571
model-00002-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4eb8ed18b2ca777955744992d734b6cf21f329c3ba505f1d6323ea90494f80be
3
+ size 5362167392
model-00003-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:565ec5981cd5b931a7a120e85a2243523152ad657caf7d254b7b86aaaeae600a
3
+ size 5163944482
model-00004-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e36bf88818c5d13d570b4003fefd2db7278057f557cfdeec3ba49c7e5601e6d6
3
+ size 5362123846
model-00005-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32ddd8e8b17650306dbc904c140036cdb71146f458de58e847b9ca926b93052c
3
+ size 5307117530
model-00006-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:404f24355319fb3f67e6117a31dbf40e9dc2695ed753bc27561c26ee8865e0c1
3
+ size 5218994486
model-00007-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ee50718338597926769b8adc5baba4142613cf75d69ccfeee1926b29a15eae0
3
+ size 5252066121
model-00008-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b64f5feb58ec6c0b7198eb64c9e3ffeb63f124907518da053b96aae473b0f0f
3
+ size 5163944518
model-00009-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e963512c8fa97461709d4535d50e302e4ba6515f9fa81484664d4f2165db7d1e
3
+ size 5362123846
model-00010-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e85c2f2b72812e81f4da89aa5342c912e9159fbbb0de3082ea27ec6a43379ae2
3
+ size 5307117530
model-00011-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25fe70aed279fbe7d18e1256afdff199acc000fbb8794124c38d0421989c41c9
3
+ size 5218994506
model-00012-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b7cfbbe53902b57499943d6cdc78191dd1dbdc300683ca8a3056cd695a6cf1c
3
+ size 4597872932
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
+ }