aoiandroid MassivDash commited on
Commit
4aa8d5f
·
0 Parent(s):

Duplicate from MassivDash/Gemma-4-Rust-Coder

Browse files

Co-authored-by: LCelitan <MassivDash@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
+ gemma-4-e2b-it.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gemma-4-e2b-it.BF16-mmproj.gguf filter=lfs diff=lfs merge=lfs -text
38
+ gemma-4-e2b-it.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ gemma-4-e2b-it.Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
40
+ gemma-4-e2b-it.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ gemma-4-e2b-it.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
42
+ gemma-4-e2b-it.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM .
3
+ TEMPLATE """{{- range $i, $_ := .Messages }}
4
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
5
+ <|turn>{{ .Role }}
6
+ {{ .Content }}{{ if not $last }}<turn|>
7
+ {{ end }}
8
+ {{- end }}<turn|>
9
+ <|turn>model
10
+ """
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - gguf
4
+ - llama.cpp
5
+ - unsloth
6
+ - vision-language-model
7
+ - rust
8
+ - coding
9
+ license: mit
10
+ datasets:
11
+ - Fortytwo-Network/Strandset-Rust-v1
12
+ base_model:
13
+ - google/gemma-4-E4B-it
14
+ ---
15
+
16
+ # Gemma-4-Rust-Coder : GGUF
17
+
18
+ This model is a specialized fine-tune of **Gemma 4**, specifically optimized for **Rust systems programming**, memory safety patterns, and high-performance development. It was trained using **Unsloth Studio** to ensure maximum efficiency and performance.
19
+
20
+ ## 🦀 Fine-Tuning Focus
21
+ The model has been adjusted to excel in:
22
+ * **Idiomatic Rust:** Writing clean, "Rusty" code using modern patterns.
23
+ * **Concurrency:** Deep understanding of `Send`, `Sync`, and async runtimes like `Tokio`.
24
+ * **Vision-to-Code:** Using its multimodal capabilities to translate architecture diagrams or UI mockups into functional Rust code.
25
+
26
+ ## 🤝 Credits & Acknowledgments
27
+ Special thanks to **Fortytwo-Network** for providing the **[Strandset-Rust-v1](https://huggingface.co/datasets/Fortytwo-Network/Strandset-Rust-v1)** dataset. This model's specialized knowledge of the Rust ecosystem is a direct result of this high-quality data.
28
+
29
+ ## 🚀 Usage
30
+ This model is converted to GGUF format for seamless use with `llama.cpp` and other compatible executors.
31
+
32
+ **Example usage**:
33
+ * **Text-only LLM:** `llama-cli -hf MassivDash/Gemma-4-Rust-Coder --jinja`
34
+ * **Multimodal / Vision:** `llama-mtmd-cli -hf MassivDash/Gemma-4-Rust-Coder --jinja`
35
+
36
+ ## 📂 Available Model files:
37
+ * `gemma-4-e2b-it.Q3_K_M.gguf`
38
+ * `gemma-4-e2b-it.BF16-mmproj.gguf`
39
+
40
+ ## ⚠️ Ollama Note for Vision Models
41
+ **Important:** Ollama currently does not support separate `mmproj` files for vision models.
42
+
43
+ To create an Ollama model from this vision model:
44
+ 1. Place the `Modelfile` in the same directory as the finetuned bf16 merged model.
45
+ 2. Run: `ollama create model_name -f ./Modelfile`
46
+ *(Replace `model_name` with your desired name)*
47
+
48
+ ## 🔗 Stay Connected
49
+ For more insights on AI development and fine-tuning, visit my blog:
50
+ 👉 **[spaceout.pl](https://spaceout.pl)**
51
+
52
+ ---
53
+
54
+ *This model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth)*
55
+
56
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
config.json ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "torch_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
+ "torch_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_name": "unsloth/gemma-4-e2b-it-unsloth-bnb-4bit",
56
+ "model_type": "gemma4",
57
+ "pad_token_id": 0,
58
+ "text_config": {
59
+ "attention_bias": false,
60
+ "attention_dropout": 0.0,
61
+ "attention_k_eq_v": false,
62
+ "bos_token_id": 2,
63
+ "torch_dtype": "bfloat16",
64
+ "enable_moe_block": false,
65
+ "eos_token_id": 1,
66
+ "expert_intermediate_size": null,
67
+ "final_logit_softcapping": 30.0,
68
+ "global_head_dim": 512,
69
+ "head_dim": 256,
70
+ "hidden_activation": "gelu_pytorch_tanh",
71
+ "hidden_size": 1536,
72
+ "hidden_size_per_layer_input": 256,
73
+ "initializer_range": 0.02,
74
+ "intermediate_size": 6144,
75
+ "layer_types": [
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
+ "full_attention",
86
+ "sliding_attention",
87
+ "sliding_attention",
88
+ "sliding_attention",
89
+ "sliding_attention",
90
+ "full_attention",
91
+ "sliding_attention",
92
+ "sliding_attention",
93
+ "sliding_attention",
94
+ "sliding_attention",
95
+ "full_attention",
96
+ "sliding_attention",
97
+ "sliding_attention",
98
+ "sliding_attention",
99
+ "sliding_attention",
100
+ "full_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "sliding_attention",
104
+ "sliding_attention",
105
+ "full_attention",
106
+ "sliding_attention",
107
+ "sliding_attention",
108
+ "sliding_attention",
109
+ "sliding_attention",
110
+ "full_attention"
111
+ ],
112
+ "max_position_embeddings": 131072,
113
+ "model_type": "gemma4_text",
114
+ "moe_intermediate_size": null,
115
+ "num_attention_heads": 8,
116
+ "num_experts": null,
117
+ "num_global_key_value_heads": null,
118
+ "num_hidden_layers": 35,
119
+ "num_key_value_heads": 1,
120
+ "num_kv_shared_layers": 20,
121
+ "pad_token_id": 0,
122
+ "rms_norm_eps": 1e-06,
123
+ "rope_parameters": {
124
+ "full_attention": {
125
+ "partial_rotary_factor": 0.25,
126
+ "rope_theta": 1000000.0,
127
+ "rope_type": "proportional"
128
+ },
129
+ "sliding_attention": {
130
+ "rope_theta": 10000.0,
131
+ "rope_type": "default"
132
+ }
133
+ },
134
+ "sliding_window": 512,
135
+ "tie_word_embeddings": true,
136
+ "top_k_experts": null,
137
+ "use_bidirectional_attention": null,
138
+ "use_cache": true,
139
+ "use_double_wide_mlp": true,
140
+ "vocab_size": 262144,
141
+ "vocab_size_per_layer_input": 262144
142
+ },
143
+ "tie_word_embeddings": true,
144
+ "unsloth_fixed": true,
145
+ "unsloth_version": "2026.4.5",
146
+ "video_token_id": 258884,
147
+ "vision_config": {
148
+ "_name_or_path": "",
149
+ "architectures": null,
150
+ "attention_bias": false,
151
+ "attention_dropout": 0.0,
152
+ "chunk_size_feed_forward": 0,
153
+ "default_output_length": 280,
154
+ "torch_dtype": "bfloat16",
155
+ "global_head_dim": 64,
156
+ "head_dim": 64,
157
+ "hidden_activation": "gelu_pytorch_tanh",
158
+ "hidden_size": 768,
159
+ "id2label": {
160
+ "0": "LABEL_0",
161
+ "1": "LABEL_1"
162
+ },
163
+ "initializer_range": 0.02,
164
+ "intermediate_size": 3072,
165
+ "is_encoder_decoder": false,
166
+ "label2id": {
167
+ "LABEL_0": 0,
168
+ "LABEL_1": 1
169
+ },
170
+ "max_position_embeddings": 131072,
171
+ "model_type": "gemma4_vision",
172
+ "num_attention_heads": 12,
173
+ "num_hidden_layers": 16,
174
+ "num_key_value_heads": 12,
175
+ "output_attentions": false,
176
+ "output_hidden_states": false,
177
+ "patch_size": 16,
178
+ "pooling_kernel_size": 3,
179
+ "position_embedding_size": 10240,
180
+ "problem_type": null,
181
+ "return_dict": true,
182
+ "rms_norm_eps": 1e-06,
183
+ "rope_parameters": {
184
+ "rope_theta": 100.0,
185
+ "rope_type": "default"
186
+ },
187
+ "standardize": false,
188
+ "use_clipped_linears": true
189
+ },
190
+ "vision_soft_tokens_per_image": 280
191
+ }
gemma-4-e2b-it.BF16-mmproj.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91f212bd6929e52c593ea89e3ed0057e6adfd5ca58964e05a911776d72e65b58
3
+ size 986833312
gemma-4-e2b-it.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3f4d48b3ddda3f34da8169d7daabcfe7f6693d0833b95738a99a58262925afb
3
+ size 3201344096
gemma-4-e2b-it.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f8f202b9282df19fd997de1941df221782e3e7db1d3fd25ede306381788cb65
3
+ size 3360154208
gemma-4-e2b-it.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:559e43668ae5331cb8e6767e702eb71ba20834a5b88698ae71f216cc507bae21
3
+ size 3427873376
gemma-4-e2b-it.Q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2eb4091145c884552079eab404fa98aea99cf633ce1507b2097114c2ac30048c
3
+ size 3595395680
gemma-4-e2b-it.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5b47d4edec2688256848621ec8320718055ac3543f6732add505b24eadf1921
3
+ size 3630281312
gemma-4-e2b-it.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:849e7336a84b776ca78b5538eda78e4c6fc881b1623618ca4bf902a7dbfeddc2
3
+ size 4967490144