zecanard commited on
Commit
5f3abba
·
verified ·
1 Parent(s): 9ed0dd7

Add files using upload-large-folder tool

Browse files
Files changed (3) hide show
  1. README.md +3 -3
  2. chat_template.jinja +10 -26
  3. config.json +18 -0
README.md CHANGED
@@ -16,7 +16,7 @@ tags:
16
  ---
17
  # 🦆 zecanard/gemma-4-26B-A4B-it-uncensored-heretic-ara-MLX-3bit-mixed_3_6
18
 
19
- [This model](https://huggingface.co/zecanard/gemma-4-26B-A4B-it-uncensored-heretic-ara-MLX-3bit-mixed_3_6) was converted to MLX from [`trohrbaugh/gemma-4-26B-A4B-it-heretic-ara`](https://huggingface.co/trohrbaugh/gemma-4-26B-A4B-it-heretic-ara) using `mlx-vlm` version **0.5.0**.
20
  Please refer to the [original model card](https://huggingface.co/trohrbaugh/gemma-4-26B-A4B-it-heretic-ara) for more details.
21
 
22
  ## 🌟 Quality
@@ -27,11 +27,11 @@ Mixed-precision quantized vision language model with an effective **4.295 bits p
27
 
28
  ## 🛠️ Customizations
29
 
30
- This quant is aware of the current date, and also enables thinking (if available). You may disable this behavior by deleting the following line from the chat template, or changing `true` to `false`:
31
 
32
  `{%- set enable_thinking = true %}`
33
 
34
- You may also need to adjust your environment’s **Reasoning Section Parsing** to recognize `<|channel>thought` as the **Start String**, and `<channel|>` as the **End String**.
35
 
36
  ## 🖥️ Use with `mlx`
37
 
 
16
  ---
17
  # 🦆 zecanard/gemma-4-26B-A4B-it-uncensored-heretic-ara-MLX-3bit-mixed_3_6
18
 
19
+ [This model](https://huggingface.co/zecanard/gemma-4-26B-A4B-it-uncensored-heretic-ara-MLX-3bit-mixed_3_6) was converted to MLX from [`trohrbaugh/gemma-4-26B-A4B-it-heretic-ara`](https://huggingface.co/trohrbaugh/gemma-4-26B-A4B-it-heretic-ara) using `mlx-vlm` version **0.6.3**.
20
  Please refer to the [original model card](https://huggingface.co/trohrbaugh/gemma-4-26B-A4B-it-heretic-ara) for more details.
21
 
22
  ## 🌟 Quality
 
27
 
28
  ## 🛠️ Customizations
29
 
30
+ This quant includes a bugfix for tools calling. It is aware of the current date, and also enables thinking (if available). You may disable this behavior by deleting the following line from the chat template, or changing `true` to `false`:
31
 
32
  `{%- set enable_thinking = true %}`
33
 
34
+ You may need to adjust your environment’s **Reasoning Section Parsing** to recognize `<|channel>thought` as the **Start String**, and `<channel|>` as the **End String**.
35
 
36
  ## 🖥️ Use with `mlx`
37
 
chat_template.jinja CHANGED
@@ -4,16 +4,16 @@
4
  {%- if strftime_now is defined %}
5
  {%- set currentDate = strftime_now('%Y-%m-%d %G:%i:%s') %}
6
  {%- elif not currentDate is defined %}
7
- {%- set currentDate = '2026-05-22' %}
8
  {%- endif %}
9
  {{- 'The current date is: ' + currentDate + ".\n\n" }}
10
  {#- Template customizations by @zecanard. #}
11
- {%- macro format_parameters(properties, required, filter_keys=false) -%}
12
  {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
13
  {%- set ns = namespace(found_first=false) -%}
14
  {%- for key, value in properties | dictsort -%}
15
  {%- set add_comma = false -%}
16
- {%- if not filter_keys or key not in standard_keys -%}
17
  {%- if ns.found_first %},{% endif -%}
18
  {%- set ns.found_first = true -%}
19
  {{ key }}:{
@@ -75,7 +75,7 @@
75
  {%- elif value is mapping -%}
76
  {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
77
  properties:{
78
- {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
79
  }
80
  {%- endif -%}
81
  {%- if value['required'] -%}
@@ -202,21 +202,18 @@
202
  {#- Handle System/Tool Definitions Block -#}
203
  {%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
204
  {{- '<|turn>system\n' -}}
 
205
  {#- Inject Thinking token at the very top of the FIRST system turn -#}
206
  {%- if enable_thinking is defined and enable_thinking -%}
207
  {{- '<|think|>\n' -}}
208
  {%- set ns.prev_message_type = 'think' -%}
209
  {%- endif -%}
 
210
  {%- if messages[0]['role'] in ['system', 'developer'] -%}
211
- {%- if messages[0]['content'] is string -%}
212
- {{- messages[0]['content'] | trim -}}
213
- {%- elif messages[0]['content'] is sequence -%}
214
- {%- for item in messages[0]['content'] -%}
215
- {{- item['text'] | trim + ' '-}}
216
- {%- endfor -%}
217
- {%- endif -%}
218
  {%- set loop_messages = messages[1:] -%}
219
  {%- endif -%}
 
220
  {%- if tools -%}
221
  {%- for tool in tools %}
222
  {{- '<|tool>' -}}
@@ -225,6 +222,7 @@
225
  {%- endfor %}
226
  {%- set ns.prev_message_type = 'tool' -%}
227
  {%- endif -%}
 
228
  {{- '<turn|>\n' -}}
229
  {%- endif %}
230
 
@@ -319,15 +317,6 @@
319
  {%- endif -%}
320
  {%- endfor -%}
321
  {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
322
- {%- for part in tool_body -%}
323
- {%- if part.get('type') == 'image' -%}
324
- {{- '<|image|>' -}}
325
- {%- elif part.get('type') == 'audio' -%}
326
- {{- '<|audio|>' -}}
327
- {%- elif part.get('type') == 'video' -%}
328
- {{- '<|video|>' -}}
329
- {%- endif -%}
330
- {%- endfor -%}
331
  {%- else -%}
332
  {{- format_tool_response_block(ns_tname.name, tool_body) -}}
333
  {%- endif -%}
@@ -337,7 +326,6 @@
337
  {%- endfor -%}
338
  {%- endif -%}
339
 
340
- {%- set captured_content -%}
341
  {%- if message['content'] is string -%}
342
  {%- if role == 'model' -%}
343
  {{- strip_thinking(message['content']) -}}
@@ -364,14 +352,10 @@
364
  {%- endif -%}
365
  {%- endfor -%}
366
  {%- endif -%}
367
- {%- endset -%}
368
-
369
- {{- captured_content -}}
370
- {%- set has_content = captured_content | trim | length > 0 -%}
371
 
372
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
373
  {{- '<|tool_response>' -}}
374
- {%- elif not (ns_tr_out.flag and not has_content) -%}
375
  {{- '<turn|>\n' -}}
376
  {%- endif -%}
377
  {%- endif -%}
 
4
  {%- if strftime_now is defined %}
5
  {%- set currentDate = strftime_now('%Y-%m-%d %G:%i:%s') %}
6
  {%- elif not currentDate is defined %}
7
+ {%- set currentDate = '2026-06-12' %}
8
  {%- endif %}
9
  {{- 'The current date is: ' + currentDate + ".\n\n" }}
10
  {#- Template customizations by @zecanard. #}
11
+ {%- macro format_parameters(properties, required) -%}
12
  {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
13
  {%- set ns = namespace(found_first=false) -%}
14
  {%- for key, value in properties | dictsort -%}
15
  {%- set add_comma = false -%}
16
+ {%- if key not in standard_keys -%}
17
  {%- if ns.found_first %},{% endif -%}
18
  {%- set ns.found_first = true -%}
19
  {{ key }}:{
 
75
  {%- elif value is mapping -%}
76
  {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
77
  properties:{
78
+ {{- format_parameters(value, value['required'] | default([])) -}}
79
  }
80
  {%- endif -%}
81
  {%- if value['required'] -%}
 
202
  {#- Handle System/Tool Definitions Block -#}
203
  {%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
204
  {{- '<|turn>system\n' -}}
205
+
206
  {#- Inject Thinking token at the very top of the FIRST system turn -#}
207
  {%- if enable_thinking is defined and enable_thinking -%}
208
  {{- '<|think|>\n' -}}
209
  {%- set ns.prev_message_type = 'think' -%}
210
  {%- endif -%}
211
+
212
  {%- if messages[0]['role'] in ['system', 'developer'] -%}
213
+ {{- messages[0]['content'] | trim -}}
 
 
 
 
 
 
214
  {%- set loop_messages = messages[1:] -%}
215
  {%- endif -%}
216
+
217
  {%- if tools -%}
218
  {%- for tool in tools %}
219
  {{- '<|tool>' -}}
 
222
  {%- endfor %}
223
  {%- set ns.prev_message_type = 'tool' -%}
224
  {%- endif -%}
225
+
226
  {{- '<turn|>\n' -}}
227
  {%- endif %}
228
 
 
317
  {%- endif -%}
318
  {%- endfor -%}
319
  {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
 
 
 
 
 
 
 
 
 
320
  {%- else -%}
321
  {{- format_tool_response_block(ns_tname.name, tool_body) -}}
322
  {%- endif -%}
 
326
  {%- endfor -%}
327
  {%- endif -%}
328
 
 
329
  {%- if message['content'] is string -%}
330
  {%- if role == 'model' -%}
331
  {{- strip_thinking(message['content']) -}}
 
352
  {%- endif -%}
353
  {%- endfor -%}
354
  {%- endif -%}
 
 
 
 
355
 
356
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
357
  {{- '<|tool_response>' -}}
358
+ {%- elif not (ns_tr_out.flag and not message.get('content')) -%}
359
  {{- '<turn|>\n' -}}
360
  {%- endif -%}
361
  {%- endif -%}
config.json CHANGED
@@ -8,6 +8,7 @@
8
  "audio_token_id": 258881,
9
  "boa_token_id": 256000,
10
  "boi_token_id": 255999,
 
11
  "dtype": "bfloat16",
12
  "eoa_token_id": 258883,
13
  "eoa_token_index": 258883,
@@ -17,6 +18,20 @@
17
  106,
18
  50
19
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  "image_token_id": 258880,
21
  "initializer_range": 0.02,
22
  "model_type": "gemma4",
@@ -2647,6 +2662,7 @@
2647
  "bits": 3
2648
  }
2649
  },
 
2650
  "text_config": {
2651
  "attention_bias": false,
2652
  "attention_dropout": 0.0,
@@ -2727,6 +2743,8 @@
2727
  "vocab_size_per_layer_input": 262144
2728
  },
2729
  "tie_word_embeddings": true,
 
 
2730
  "transformers_version": "5.5.0.dev0",
2731
  "video_token_id": 258884,
2732
  "vision_config": {
 
8
  "audio_token_id": 258881,
9
  "boa_token_id": 256000,
10
  "boi_token_id": 255999,
11
+ "do_sample": true,
12
  "dtype": "bfloat16",
13
  "eoa_token_id": 258883,
14
  "eoa_token_index": 258883,
 
18
  106,
19
  50
20
  ],
21
+ "generation_config": {
22
+ "bos_token_id": 2,
23
+ "do_sample": true,
24
+ "eos_token_id": [
25
+ 1,
26
+ 106,
27
+ 50
28
+ ],
29
+ "pad_token_id": 0,
30
+ "temperature": 1.0,
31
+ "top_k": 64,
32
+ "top_p": 0.95,
33
+ "transformers_version": "5.5.0"
34
+ },
35
  "image_token_id": 258880,
36
  "initializer_range": 0.02,
37
  "model_type": "gemma4",
 
2662
  "bits": 3
2663
  }
2664
  },
2665
+ "temperature": 1.0,
2666
  "text_config": {
2667
  "attention_bias": false,
2668
  "attention_dropout": 0.0,
 
2743
  "vocab_size_per_layer_input": 262144
2744
  },
2745
  "tie_word_embeddings": true,
2746
+ "top_k": 64,
2747
+ "top_p": 0.95,
2748
  "transformers_version": "5.5.0.dev0",
2749
  "video_token_id": 258884,
2750
  "vision_config": {