zecanard commited on
Commit
4d0f4b5
·
verified ·
1 Parent(s): 98da854

Add files using upload-large-folder tool

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,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Jackrong/Qwopus3.6-35B-A3B-v1
3
+ library_name: mlx
4
+ tags:
5
+ - mlx
6
+ - 3-bit
7
+ - text-generation-inference
8
+ - transformers
9
+ - unsloth
10
+ - qwen3_6
11
+ - moe
12
+ - reasoning
13
+ - chain-of-thought
14
+ - lora
15
+ - sft
16
+ - multimodal
17
+ - vision
18
+ - tool-use
19
+ - function-calling
20
+ - long-context
21
+ license: apache-2.0
22
+ language:
23
+ - en
24
+ - zh
25
+ - es
26
+ - ru
27
+ - ja
28
+ pipeline_tag: image-text-to-text
29
+ ---
30
+ # 🦆 zecanard/Qwopus3.6-35B-A3B-v1-MLX-3bit-mixed_3_6
31
+
32
+ [This model](https://huggingface.co/zecanard/Qwopus3.6-35B-A3B-v1-MLX-3bit-mixed_3_6) was converted to MLX from [`Jackrong/Qwopus3.6-35B-A3B-v1`](https://huggingface.co/Jackrong/Qwopus3.6-35B-A3B-v1) using `mlx-vlm` version **0.5.0**.
33
+ Please refer to the [original model card](https://huggingface.co/Jackrong/Qwopus3.6-35B-A3B-v1) for more details.
34
+
35
+ ## 🌟 Quality
36
+
37
+ Mixed-precision quantized vision language model with an effective **4.207 bits per weight**. Combines the size and speed benefits of a 3-bit quant with higher precision where it matters most.
38
+
39
+ `mlx_vlm.convert --quantize --q-group-size 32 --quant-predicate mixed_3_6`
40
+
41
+ ## 🛠️ Customizations
42
+
43
+ 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`:
44
+
45
+ `{%- set enable_thinking = true %}`
46
+
47
+ A fix is also included for a thinking-related performance issue in Qwen 3.6.
48
+
49
+ ## 🖥️ Use with `mlx`
50
+
51
+ ```bash
52
+ pip install -U mlx-vlm
53
+ ```
54
+
55
+ ```bash
56
+ mlx_vlm.generate --model zecanard/Qwopus3.6-35B-A3B-v1-MLX-3bit-mixed_3_6 --max-tokens 100 --temperature 0 --prompt "Describe this image." --image <path_to_image>
57
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Template customizations by @zecanard. #}
2
+ {%- set enable_thinking = true %}
3
+ {%- set preserve_thinking = true %}
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-04-20' %}
8
+ {%- endif %}
9
+ {{- 'The current date is: ' + currentDate + ".\n\n" }}
10
+ {#- Template customizations by @zecanard. #}
11
+ {%- set image_count = namespace(value=0) %}
12
+ {%- set video_count = namespace(value=0) %}
13
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
14
+ {%- if content is string %}
15
+ {{- content }}
16
+ {%- elif content is iterable and content is not mapping %}
17
+ {%- for item in content %}
18
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
19
+ {%- if is_system_content %}
20
+ {{- raise_exception('System message cannot contain images.') }}
21
+ {%- endif %}
22
+ {%- if do_vision_count %}
23
+ {%- set image_count.value = image_count.value + 1 %}
24
+ {%- endif %}
25
+ {%- if add_vision_id %}
26
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
27
+ {%- endif %}
28
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
29
+ {%- elif 'video' in item or item.type == 'video' %}
30
+ {%- if is_system_content %}
31
+ {{- raise_exception('System message cannot contain videos.') }}
32
+ {%- endif %}
33
+ {%- if do_vision_count %}
34
+ {%- set video_count.value = video_count.value + 1 %}
35
+ {%- endif %}
36
+ {%- if add_vision_id %}
37
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
38
+ {%- endif %}
39
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
40
+ {%- elif 'text' in item %}
41
+ {{- item.text }}
42
+ {%- else %}
43
+ {{- raise_exception('Unexpected item type in content.') }}
44
+ {%- endif %}
45
+ {%- endfor %}
46
+ {%- elif content is none or content is undefined %}
47
+ {{- '' }}
48
+ {%- else %}
49
+ {{- raise_exception('Unexpected content type.') }}
50
+ {%- endif %}
51
+ {%- endmacro %}
52
+ {%- if not messages %}
53
+ {{- raise_exception('No messages provided.') }}
54
+ {%- endif %}
55
+ {%- if tools and tools is iterable and tools is not mapping %}
56
+ {{- '<|im_start|>system\n' }}
57
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
58
+ {%- for tool in tools %}
59
+ {{- "\n" }}
60
+ {{- tool | tojson }}
61
+ {%- endfor %}
62
+ {{- "\n</tools>" }}
63
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
64
+ {%- if messages[0].role == 'system' %}
65
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
66
+ {%- if content %}
67
+ {{- '\n\n' + content }}
68
+ {%- endif %}
69
+ {%- endif %}
70
+ {{- '<|im_end|>\n' }}
71
+ {%- else %}
72
+ {%- if messages[0].role == 'system' %}
73
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
74
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
78
+ {%- for message in messages[::-1] %}
79
+ {%- set index = (messages|length - 1) - loop.index0 %}
80
+ {%- if ns.multi_step_tool and message.role == "user" %}
81
+ {%- set content = render_content(message.content, false)|trim %}
82
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
83
+ {%- set ns.multi_step_tool = false %}
84
+ {%- set ns.last_query_index = index %}
85
+ {%- endif %}
86
+ {%- endif %}
87
+ {%- endfor %}
88
+ {%- if ns.multi_step_tool %}
89
+ {{- raise_exception('No user query found in messages.') }}
90
+ {%- endif %}
91
+ {%- for message in messages %}
92
+ {%- set content = render_content(message.content, true)|trim %}
93
+ {%- if message.role == "system" %}
94
+ {%- if not loop.first %}
95
+ {{- raise_exception('System message must be at the beginning.') }}
96
+ {%- endif %}
97
+ {%- elif message.role == "user" %}
98
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
99
+ {%- elif message.role == "assistant" %}
100
+ {%- set reasoning_content = '' %}
101
+ {%- if message.reasoning_content is string %}
102
+ {%- set reasoning_content = message.reasoning_content %}
103
+ {%- else %}
104
+ {%- if '</think>' in content %}
105
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
106
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
107
+ {%- endif %}
108
+ {%- endif %}
109
+ {%- set reasoning_content = reasoning_content|trim %}
110
+ {%- if (preserve_thinking is defined and preserve_thinking is true) or (loop.index0 > ns.last_query_index) %}
111
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
112
+ {%- else %}
113
+ {{- '<|im_start|>' + message.role + '\n' + content }}
114
+ {%- endif %}
115
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
116
+ {%- for tool_call in message.tool_calls %}
117
+ {%- if tool_call.function is defined %}
118
+ {%- set tool_call = tool_call.function %}
119
+ {%- endif %}
120
+ {%- if loop.first %}
121
+ {%- if content|trim %}
122
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
123
+ {%- else %}
124
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
125
+ {%- endif %}
126
+ {%- else %}
127
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
128
+ {%- endif %}
129
+ {%- if tool_call.arguments is defined %}
130
+ {%- for args_name, args_value in tool_call.arguments|items %}
131
+ {{- '<parameter=' + args_name + '>\n' }}
132
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
133
+ {{- args_value }}
134
+ {{- '\n</parameter>\n' }}
135
+ {%- endfor %}
136
+ {%- endif %}
137
+ {{- '</function>\n</tool_call>' }}
138
+ {%- endfor %}
139
+ {%- endif %}
140
+ {{- '<|im_end|>\n' }}
141
+ {%- elif message.role == "tool" %}
142
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
143
+ {{- '<|im_start|>user' }}
144
+ {%- endif %}
145
+ {{- '\n<tool_response>\n' }}
146
+ {{- content }}
147
+ {{- '\n</tool_response>' }}
148
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
149
+ {{- '<|im_end|>\n' }}
150
+ {%- elif loop.last %}
151
+ {{- '<|im_end|>\n' }}
152
+ {%- endif %}
153
+ {%- else %}
154
+ {{- raise_exception('Unexpected message role.') }}
155
+ {%- endif %}
156
+ {%- endfor %}
157
+ {%- if add_generation_prompt %}
158
+ {{- '<|im_start|>assistant\n' }}
159
+ {%- if enable_thinking is defined and enable_thinking is false %}
160
+ {{- '<think>\n\n</think>\n\n' }}
161
+ {%- else %}
162
+ {{- '<think>\n' }}
163
+ {%- endif %}
164
+ {%- endif %}
config.json ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0592b784cde909272ac92047303ad5ac45680dac06ad0afaa4e1d0c625ff6b3
3
+ size 5358955198
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:910a39b0583c89af8948e88de5b265bc68dacf36be43fe0fe664cdeeab2cfed1
3
+ size 5307127408
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:923efadbcb0f44e5c67c65b33eb105799c62b8e1a3adb5c9f420c656a2229804
3
+ size 5288260840
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06ba5e9fa737eb8348117cdf78a96f71080b74f743d4cda260cfc2e9e2d46617
3
+ size 2509811661
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,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "Qwen3VLImageProcessor",
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "max_pixels": 16777216,
18
+ "merge_size": 2,
19
+ "min_pixels": 65536,
20
+ "patch_size": 16,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "temporal_patch_size": 2
23
+ },
24
+ "processor_class": "Qwen3VLProcessor",
25
+ "video_processor": {
26
+ "do_convert_rgb": true,
27
+ "do_normalize": true,
28
+ "do_rescale": true,
29
+ "fps": 2.0,
30
+ "image_mean": [
31
+ 0.5,
32
+ 0.5,
33
+ 0.5
34
+ ],
35
+ "image_std": [
36
+ 0.5,
37
+ 0.5,
38
+ 0.5
39
+ ],
40
+ "max_frames": 768,
41
+ "max_pixels": 786432,
42
+ "merge_size": 2,
43
+ "min_frames": 4,
44
+ "min_pixels": 131072,
45
+ "patch_size": 16,
46
+ "rescale_factor": 0.00392156862745098,
47
+ "temporal_patch_size": 2,
48
+ "video_processor_type": "Qwen3VLVideoProcessor"
49
+ }
50
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
tokenizer_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "local_files_only": false,
14
+ "model_max_length": 262144,
15
+ "model_specific_special_tokens": {
16
+ "audio_bos_token": "<|audio_start|>",
17
+ "audio_eos_token": "<|audio_end|>",
18
+ "audio_token": "<|audio_pad|>",
19
+ "image_token": "<|image_pad|>",
20
+ "video_token": "<|video_pad|>",
21
+ "vision_bos_token": "<|vision_start|>",
22
+ "vision_eos_token": "<|vision_end|>"
23
+ },
24
+ "pad_token": "<|endoftext|>",
25
+ "padding_side": "left",
26
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
27
+ "processor_class": "Qwen3VLProcessor",
28
+ "split_special_tokens": false,
29
+ "tokenizer_class": "TokenizersBackend",
30
+ "unk_token": null,
31
+ "video_token": "<|video_pad|>",
32
+ "vision_bos_token": "<|vision_start|>",
33
+ "vision_eos_token": "<|vision_end|>"
34
+ }