FastFlowLM commited on
Commit
cc2c905
·
verified ·
1 Parent(s): 963de0c

D3-Flash-NPU2: vllm-sr/d3-flash 13dc1cc8, Q4NX (Q4_K GPTQ) for FastFlowLM 1.0.12

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ 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
+ model.q4nx filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
+ vision_weight.q4nx filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
MANIFEST.sha256 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja
2
+ 5a44500009a38d29f7698a2107e075eb0f242cf0ce77d28e7afe45a31e802a85 config.json
3
+ 0269c72ac055d8149a7a778c477780af361f4c1cde3fd0e5ba9af791453ece18 decision_config.json
4
+ c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
5
+ 36025387084e3e444d989e9653a52e665dc465bdad3dd1a733f262916e11dd01 model.q4nx
6
+ 214e02479311b5222315ac756b229789dbae4902ba8636698f4f5b9214396689 NOTICE
7
+ 14d69b7c84bd13ac46d4470a670ca82fc989178d6eb112140761218ee693c60d README.md
8
+ 8bbc9a9df4e1b7df85a80a1091977092b938d8d2d2869dfaeb8fd36063cf322f readout.safetensors
9
+ 316230d6a809701f4db5ea8f8fc862bc3a6f3229c937c174e674ff3ca0a64ac8 tokenizer_config.json
10
+ 5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42 tokenizer.json
11
+ 07979ede48dd92aea3f1bb1cc8f6245151cb446c0edef1516f5edb41c6f1d646 vision_weight.q4nx
NOTICE ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ d3-flash (Decision 3.0)
2
+ Copyright 2026 vLLM Semantic Router Team
3
+
4
+ Built on Qwen/Qwen3.5-9B (Apache-2.0).
5
+
6
+ Modified by the FastFlowLM team: weights quantized to the Q4NX format (Q4_K projections, Q8_0 token embedding) for AMD NPUs and repackaged for FastFlowLM. The readout, decision config, tokenizer and chat template are unmodified.
README.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: vllm-sr/d3-flash
4
+ pipeline_tag: zero-shot-classification
5
+ tags:
6
+ - decision-model
7
+ - system-one
8
+ - fastflowlm
9
+ - amd-npu
10
+ - q4nx
11
+ ---
12
+
13
+ # D3-Flash-NPU2
14
+
15
+ [vllm-sr/d3-flash](https://huggingface.co/vllm-sr/d3-flash) (Decision 3.0, the decision model of vLLM Semantic
16
+ Router; Qwen3.5-9B text tower, revision `13dc1cc8`) for AMD Ryzen AI NPUs, served by
17
+ [FastFlowLM](https://github.com/ROCm/FastFlowLM) 1.0.12 or later. It answers *System One* requests -- choice, yes / no
18
+ and score questions about a state, optionally with images, with a probability for every option -- over the same
19
+ `POST /v1/systemone` API as the upstream package. Up to 32,768 input tokens per question. Video is not supported (a
20
+ request with `videos` is refused with HTTP 422).
21
+
22
+ ```shell
23
+ flm serve --decision d3:flash # optionally next to a chat model: flm serve qwen3.5:4b --decision d3:flash
24
+ curl -s http://127.0.0.1:52625/v1/systemone -H "Content-Type: application/json" \
25
+ -d '{"state": "The order arrived damaged.", "questions": {"route": {"type": "choice",
26
+ "criteria": {"returns": "Refunds and replacements", "billing": "Payments", "general": null}}}}'
27
+ ```
28
+
29
+ Images go in an `images` list of base64 data URLs (PNG, JPEG or WebP; each at most 8 MB and 16 MP, resized to at most
30
+ 1.6 MP), shared by every question of the request. `d3:lite` (0.8B), `d3:nano` (2B) and `d3:mini` (4B) are the smaller
31
+ siblings.
32
+
33
+ ## What was changed
34
+
35
+ - **Weights:** the Qwen3.5-9B text tower quantized to FastFlowLM's Q4NX format: every projection Q4_K with
36
+ GPTQ-calibrated rounding (calibration: 192 synthetic System One prompts of 100 to 2,048 tokens, none from the Decision
37
+ Index), token embedding Q8_0, norms and the Gated DeltaNet parameters unquantized. `vision_weight.q4nx` holds the
38
+ vision tower (identical to Qwen3.5-9B's, merger included), used for requests with images.
39
+ - **Unchanged:** `readout.safetensors`, `decision_config.json`, `tokenizer.json`, `tokenizer_config.json`,
40
+ `chat_template.jinja` and `LICENSE` are the upstream files byte for byte (`MANIFEST.sha256`).
41
+ - **Same contract:** prompts, token ids and answer objects follow the upstream runtime.
42
+
43
+ ## Accuracy (against the upstream BF16 model)
44
+
45
+ | | this package on the NPU | upstream BF16 |
46
+ |---|---|---|
47
+ | Decision Index public-suite sample, mean benchmark score (1,600 requests, 37 benchmarks) | 67.4% | 67.8% |
48
+ | Top-1 agreement with BF16 on the same requests (4,452 choice answers) | 97.0% | -- |
49
+ | Long prompts, 835 to 31,545 tokens (8 requests), same top answer as BF16 | 8 of 8 | -- |
50
+ | Decision Index public vision suite subset, accuracy (300 questions, 10 benchmarks) | 72.7% | 75.0% |
51
+ | Top-1 agreement with BF16 on the same image questions | 90.0% | -- |
52
+
53
+ Mean benchmark score, this package minus BF16: -0.36 pt (standard error 0.66 pt; about 41 requests per benchmark, so
54
+ single benchmarks are noisy). The sample is a seeded round-robin over the public suite's requests whose prompts are at
55
+ most 8,000 tokens (37 of its 40 benchmarks have such requests); RouterBench and SGD requests are left out because their
56
+ locally rebuilt payloads differ from the lab's. The BF16 scores are the upstream BF16 run's own answers on the same
57
+ requests. The vision subset is 30 seeded questions from each of 10 benchmarks (the suite without the gated Winoground);
58
+ paired accuracy, BF16 minus this package: +2.3 pt (95% CI -0.9 to +5.6 pt), so images may cost a little accuracy
59
+ while the answers agree with BF16 on 90.0% of the questions.
60
+
61
+ ## Speed (AMD Ryzen AI MAX+ PRO 395 (Strix Halo, XDNA 2 NPU), 128 GB, Ubuntu 24.04, XRT, FastFlowLM 1.0.12)
62
+
63
+ | request | median latency |
64
+ |---|---|
65
+ | 1 question, 128 tokens | 0.85 s |
66
+ | 1 question, 330 tokens | 1.0 s |
67
+ | 1 question, 1,024 tokens | 2.3 s |
68
+ | 1 question, 4,096 tokens | 9.0 s |
69
+ | 1 question, 16,383 tokens | 41 s |
70
+ | 1 question, 31,545 tokens | 92 s |
71
+ | 1 question, 32,768 tokens | 96 s |
72
+ | 4 questions, 330 tokens each | 3.1 s |
73
+ | 16 questions, 330 tokens each | 11.7 s |
74
+ | 1 question + a 1024 x 768 image (880 tokens, HTTP) | 3.3 s |
75
+ | 1 question + two images (HTTP) | 5.2 s |
76
+ | 1 question + a 2000 x 1500 image (downscaled to 1.6 MP, HTTP) | 7.0 s |
77
+ | 8 questions + one image (one image encoding, HTTP) | 18.3 s |
78
+
79
+ From 1,536 tokens attention runs on the NPU's attention kernel. Prompts over 32,768 tokens are answered with
80
+ `max_length_exceeded` (nothing is truncated). Resident memory of the server: 6.8 GB after loading, up to 14.1 GB at
81
+ 32,768 tokens with images in the mix. Median of 3 (16,383 tokens and longer: 1 to 2 runs) over HTTP on an otherwise idle
82
+ machine.
83
+
84
+ ## License
85
+
86
+ Apache-2.0, as the upstream model; see `LICENSE` and `NOTICE`. Built on Qwen/Qwen3.5-9B.
chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\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>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5ForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "model_type": "qwen3_5_text",
7
+ "attention_bias": false,
8
+ "attention_dropout": 0.0,
9
+ "attn_output_gate": true,
10
+ "dtype": "bfloat16",
11
+ "eos_token_id": 248044,
12
+ "full_attention_interval": 4,
13
+ "head_dim": 256,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 4096,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 12288,
18
+ "layer_types": [
19
+ "linear_attention",
20
+ "linear_attention",
21
+ "linear_attention",
22
+ "full_attention",
23
+ "linear_attention",
24
+ "linear_attention",
25
+ "linear_attention",
26
+ "full_attention",
27
+ "linear_attention",
28
+ "linear_attention",
29
+ "linear_attention",
30
+ "full_attention",
31
+ "linear_attention",
32
+ "linear_attention",
33
+ "linear_attention",
34
+ "full_attention",
35
+ "linear_attention",
36
+ "linear_attention",
37
+ "linear_attention",
38
+ "full_attention",
39
+ "linear_attention",
40
+ "linear_attention",
41
+ "linear_attention",
42
+ "full_attention",
43
+ "linear_attention",
44
+ "linear_attention",
45
+ "linear_attention",
46
+ "full_attention",
47
+ "linear_attention",
48
+ "linear_attention",
49
+ "linear_attention",
50
+ "full_attention"
51
+ ],
52
+ "linear_conv_kernel_dim": 4,
53
+ "linear_key_head_dim": 128,
54
+ "linear_num_key_heads": 16,
55
+ "linear_num_value_heads": 32,
56
+ "linear_value_head_dim": 128,
57
+ "max_position_embeddings": 262144,
58
+ "mlp_only_layers": [],
59
+ "mtp_num_hidden_layers": 1,
60
+ "mtp_use_dedicated_embeddings": false,
61
+ "num_attention_heads": 16,
62
+ "num_hidden_layers": 32,
63
+ "num_key_value_heads": 4,
64
+ "rms_norm_eps": 1e-06,
65
+ "use_cache": true,
66
+ "vocab_size": 248320,
67
+ "mamba_ssm_dtype": "float32",
68
+ "rope_parameters": {
69
+ "mrope_interleaved": true,
70
+ "mrope_section": [
71
+ 11,
72
+ 11,
73
+ 10
74
+ ],
75
+ "partial_rotary_factor": 0.25,
76
+ "rope_theta": 10000000,
77
+ "rope_type": "default"
78
+ },
79
+ "flm_version": "1.0.12",
80
+ "vision_model_weight": "vision_weight.q4nx",
81
+ "vision_end_token_id": 248054,
82
+ "vision_start_token_id": 248053,
83
+ "vision_config": {
84
+ "vision_mm_engine_xclbin_name": "vision_mm.xclbin",
85
+ "vision_mha_engine_xclbin_name": "vision_attn.xclbin",
86
+ "QWEN3_5_PATCH_SIZE": 16,
87
+ "QWEN3_5_IMAGE_MERGE_SIZE": 2,
88
+ "QWEN3_5_SPATIAL_MERGE_SIZE": 2,
89
+ "QWEN3_5_SHORTEST_EDGE": 65536,
90
+ "QWEN3_5_LONGEST_EDGE": 1638400,
91
+ "QWEN3_5_VISION_RESCALE_FACTOR": 0.00392156862745098,
92
+ "QWEN3_5_VISION_RESCALE_IMAGE_MEAN": 0.5,
93
+ "QWEN3_5_VISION_RESCALE_IMAGE_STD": 0.5,
94
+ "QWEN3_5_TEMPORAL_PATCH_SIZE": 2,
95
+ "QWEN3_5_VISION_EMBED_DIM": 1152,
96
+ "QWEN3_5_VISION_NUM_HEADS": 16,
97
+ "QWEN3_5_VISION_HEAD_DIM": 72,
98
+ "QWEN3_5_VISION_MLP_INTERMEDIATE_SIZE": 4304,
99
+ "QWEN3_5_VISION_NUM_POSITION_EMBEDDINGS": 2304,
100
+ "QWEN3_5_VISION_NUM_LAYERS": 27,
101
+ "QWEN3_5_VISION_LAYER_NORM_EPSILON": 1e-06,
102
+ "QWEN3_5_VISION_OUT_HIDDEN_SIZE": 4096,
103
+ "VISION_MM_TILE_M": 128,
104
+ "VISION_MM_TILE_K": 256,
105
+ "VISION_MM_TILE_N": 64
106
+ },
107
+ "tie_word_embeddings": true,
108
+ "decision": {
109
+ "config": "decision_config.json",
110
+ "readout": "readout.safetensors",
111
+ "base_model": "vllm-sr/d3-flash",
112
+ "revision": "13dc1cc8",
113
+ "model_name": "d3-flash"
114
+ }
115
+ }
decision_config.json ADDED
@@ -0,0 +1,526 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "format_id": "d3-code-readout-v1",
4
+ "prompt": "d3",
5
+ "base_model": "Qwen/Qwen3.5-9B",
6
+ "revision": "c202236235762e1c871ad0ccb60c8ee5ba337b9a",
7
+ "codes": [
8
+ "A",
9
+ "B",
10
+ "C",
11
+ "D",
12
+ "E",
13
+ "F",
14
+ "G",
15
+ "H",
16
+ "I",
17
+ "J",
18
+ "K",
19
+ "L",
20
+ "M",
21
+ "N",
22
+ "O",
23
+ "P",
24
+ "Q",
25
+ "R",
26
+ "S",
27
+ "T",
28
+ "U",
29
+ "V",
30
+ "W",
31
+ "X",
32
+ "Y",
33
+ "Z",
34
+ "AA",
35
+ "AB",
36
+ "AC",
37
+ "AD",
38
+ "AE",
39
+ "AF",
40
+ "AG",
41
+ "AH",
42
+ "AI",
43
+ "AJ",
44
+ "AK",
45
+ "AL",
46
+ "AM",
47
+ "AN",
48
+ "AO",
49
+ "AP",
50
+ "AQ",
51
+ "AR",
52
+ "AS",
53
+ "AT",
54
+ "AU",
55
+ "AV",
56
+ "AW",
57
+ "AX",
58
+ "AY",
59
+ "AZ",
60
+ "BA",
61
+ "BB",
62
+ "BC",
63
+ "BD",
64
+ "BE",
65
+ "BF",
66
+ "BG",
67
+ "BH",
68
+ "BI",
69
+ "BJ",
70
+ "BK",
71
+ "BL",
72
+ "BM",
73
+ "BN",
74
+ "BO",
75
+ "BP",
76
+ "BR",
77
+ "BS",
78
+ "BT",
79
+ "BU",
80
+ "BV",
81
+ "BW",
82
+ "BX",
83
+ "BY",
84
+ "CA",
85
+ "CB",
86
+ "CC",
87
+ "CD",
88
+ "CE",
89
+ "CF",
90
+ "CG",
91
+ "CH",
92
+ "CI",
93
+ "CK",
94
+ "CL",
95
+ "CM",
96
+ "CN",
97
+ "CO",
98
+ "CP",
99
+ "CR",
100
+ "CS",
101
+ "CT",
102
+ "CU",
103
+ "CV",
104
+ "CW",
105
+ "CX",
106
+ "CY",
107
+ "DA",
108
+ "DB",
109
+ "DC",
110
+ "DD",
111
+ "DE",
112
+ "DF",
113
+ "DG",
114
+ "DH",
115
+ "DI",
116
+ "DJ",
117
+ "DK",
118
+ "DL",
119
+ "DM",
120
+ "DN",
121
+ "DO",
122
+ "DP",
123
+ "DR",
124
+ "DS",
125
+ "DT",
126
+ "DU",
127
+ "DV",
128
+ "DW",
129
+ "DX",
130
+ "DY",
131
+ "EA",
132
+ "EB",
133
+ "EC",
134
+ "ED",
135
+ "EE",
136
+ "EF",
137
+ "EG",
138
+ "EH",
139
+ "EI",
140
+ "EK",
141
+ "EL",
142
+ "EM",
143
+ "EN",
144
+ "EO",
145
+ "EP",
146
+ "EQ",
147
+ "ER",
148
+ "ES",
149
+ "ET",
150
+ "EU",
151
+ "EV",
152
+ "EW",
153
+ "EX",
154
+ "EZ",
155
+ "FA",
156
+ "FB",
157
+ "FC",
158
+ "FD",
159
+ "FE",
160
+ "FF",
161
+ "FG",
162
+ "FH",
163
+ "FI",
164
+ "FK",
165
+ "FL",
166
+ "FM",
167
+ "FN",
168
+ "FO",
169
+ "FP",
170
+ "FR",
171
+ "FS",
172
+ "FT",
173
+ "FU",
174
+ "FW",
175
+ "FX",
176
+ "FY",
177
+ "GA",
178
+ "GB",
179
+ "GC",
180
+ "GD",
181
+ "GE",
182
+ "GF",
183
+ "GG",
184
+ "GH",
185
+ "GI",
186
+ "GL",
187
+ "GM",
188
+ "GN",
189
+ "GO",
190
+ "GP",
191
+ "GR",
192
+ "GS",
193
+ "GT",
194
+ "GU",
195
+ "GV",
196
+ "GW",
197
+ "GX",
198
+ "GY",
199
+ "HA",
200
+ "HB",
201
+ "HC",
202
+ "HD",
203
+ "HE",
204
+ "HF",
205
+ "HG",
206
+ "HH",
207
+ "HI",
208
+ "HK",
209
+ "HL",
210
+ "HM",
211
+ "HN",
212
+ "HO",
213
+ "HP",
214
+ "HQ",
215
+ "HR",
216
+ "HS",
217
+ "HT",
218
+ "HU",
219
+ "HV",
220
+ "HW",
221
+ "HX",
222
+ "HY",
223
+ "HZ",
224
+ "IA",
225
+ "IB",
226
+ "IC",
227
+ "ID",
228
+ "IE",
229
+ "IF",
230
+ "IG",
231
+ "IH",
232
+ "II",
233
+ "IJ",
234
+ "IK",
235
+ "IL",
236
+ "IM",
237
+ "IN",
238
+ "IO",
239
+ "IP",
240
+ "IQ",
241
+ "IR",
242
+ "IS",
243
+ "IT",
244
+ "IU",
245
+ "IV",
246
+ "IW",
247
+ "IX",
248
+ "IZ",
249
+ "JA",
250
+ "JB",
251
+ "JC",
252
+ "JD",
253
+ "JE",
254
+ "JI",
255
+ "JJ",
256
+ "JK",
257
+ "JM",
258
+ "JO",
259
+ "JP",
260
+ "JR",
261
+ "JS",
262
+ "JT"
263
+ ],
264
+ "token_ids": [
265
+ 32,
266
+ 33,
267
+ 34,
268
+ 35,
269
+ 36,
270
+ 37,
271
+ 38,
272
+ 39,
273
+ 40,
274
+ 41,
275
+ 42,
276
+ 43,
277
+ 44,
278
+ 45,
279
+ 46,
280
+ 47,
281
+ 48,
282
+ 49,
283
+ 50,
284
+ 51,
285
+ 52,
286
+ 53,
287
+ 54,
288
+ 55,
289
+ 56,
290
+ 57,
291
+ 5840,
292
+ 1803,
293
+ 1646,
294
+ 1745,
295
+ 13276,
296
+ 8018,
297
+ 1825,
298
+ 28946,
299
+ 15015,
300
+ 29595,
301
+ 11568,
302
+ 939,
303
+ 1354,
304
+ 1058,
305
+ 18183,
306
+ 2456,
307
+ 88898,
308
+ 905,
309
+ 1846,
310
+ 802,
311
+ 33869,
312
+ 7839,
313
+ 14006,
314
+ 2860,
315
+ 2926,
316
+ 22828,
317
+ 6844,
318
+ 9798,
319
+ 4738,
320
+ 9265,
321
+ 11261,
322
+ 19278,
323
+ 36513,
324
+ 93801,
325
+ 8335,
326
+ 14544,
327
+ 85266,
328
+ 9110,
329
+ 28000,
330
+ 15137,
331
+ 4525,
332
+ 25261,
333
+ 12717,
334
+ 7116,
335
+ 17078,
336
+ 14497,
337
+ 57339,
338
+ 74909,
339
+ 52072,
340
+ 19305,
341
+ 4887,
342
+ 12607,
343
+ 3580,
344
+ 6281,
345
+ 2036,
346
+ 9362,
347
+ 8533,
348
+ 2080,
349
+ 10911,
350
+ 2925,
351
+ 3040,
352
+ 9690,
353
+ 27731,
354
+ 8023,
355
+ 6901,
356
+ 8702,
357
+ 6211,
358
+ 1123,
359
+ 16307,
360
+ 18990,
361
+ 64045,
362
+ 63037,
363
+ 33380,
364
+ 6151,
365
+ 3392,
366
+ 5449,
367
+ 3967,
368
+ 1113,
369
+ 5095,
370
+ 51923,
371
+ 49600,
372
+ 17099,
373
+ 51483,
374
+ 17756,
375
+ 16037,
376
+ 8135,
377
+ 30237,
378
+ 5683,
379
+ 9992,
380
+ 7444,
381
+ 5751,
382
+ 10284,
383
+ 20887,
384
+ 59884,
385
+ 52396,
386
+ 16103,
387
+ 67547,
388
+ 18535,
389
+ 8006,
390
+ 7263,
391
+ 1425,
392
+ 6878,
393
+ 14453,
394
+ 9097,
395
+ 44072,
396
+ 76089,
397
+ 68720,
398
+ 2662,
399
+ 2629,
400
+ 923,
401
+ 6548,
402
+ 8924,
403
+ 52194,
404
+ 622,
405
+ 1515,
406
+ 1300,
407
+ 37523,
408
+ 44473,
409
+ 36530,
410
+ 3152,
411
+ 93924,
412
+ 3505,
413
+ 15731,
414
+ 6542,
415
+ 14176,
416
+ 11091,
417
+ 1686,
418
+ 11660,
419
+ 80440,
420
+ 18836,
421
+ 26132,
422
+ 5934,
423
+ 24794,
424
+ 40229,
425
+ 3660,
426
+ 11361,
427
+ 10191,
428
+ 8225,
429
+ 3860,
430
+ 78413,
431
+ 17680,
432
+ 15900,
433
+ 78138,
434
+ 15653,
435
+ 5213,
436
+ 22150,
437
+ 39500,
438
+ 10460,
439
+ 35131,
440
+ 21563,
441
+ 43194,
442
+ 27127,
443
+ 3697,
444
+ 20011,
445
+ 24368,
446
+ 15058,
447
+ 23658,
448
+ 8362,
449
+ 16035,
450
+ 24583,
451
+ 52857,
452
+ 38403,
453
+ 60456,
454
+ 81519,
455
+ 40097,
456
+ 16522,
457
+ 29722,
458
+ 21756,
459
+ 18567,
460
+ 1736,
461
+ 48043,
462
+ 87013,
463
+ 22456,
464
+ 23165,
465
+ 55523,
466
+ 13097,
467
+ 50397,
468
+ 41741,
469
+ 23073,
470
+ 6401,
471
+ 86538,
472
+ 16585,
473
+ 11622,
474
+ 2464,
475
+ 84982,
476
+ 75516,
477
+ 36984,
478
+ 58795,
479
+ 47217,
480
+ 59675,
481
+ 5681,
482
+ 3151,
483
+ 1271,
484
+ 887,
485
+ 5203,
486
+ 2685,
487
+ 1849,
488
+ 72470,
489
+ 5370,
490
+ 74063,
491
+ 27629,
492
+ 1655,
493
+ 1728,
494
+ 669,
495
+ 3682,
496
+ 3191,
497
+ 59865,
498
+ 2712,
499
+ 1580,
500
+ 922,
501
+ 77243,
502
+ 2990,
503
+ 78493,
504
+ 5228,
505
+ 2750,
506
+ 42711,
507
+ 44568,
508
+ 56402,
509
+ 48236,
510
+ 38993,
511
+ 43559,
512
+ 61250,
513
+ 32942,
514
+ 86302,
515
+ 25310,
516
+ 26313,
517
+ 81770,
518
+ 12185,
519
+ 78382
520
+ ],
521
+ "temperature": 1.0,
522
+ "attention_mode": "noncausal_full_attention",
523
+ "pooling": "last",
524
+ "max_length": null,
525
+ "readout_dtype": "float32"
526
+ }
model.q4nx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36025387084e3e444d989e9653a52e665dc465bdad3dd1a733f262916e11dd01
3
+ size 5098259624
readout.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bbc9a9df4e1b7df85a80a1091977092b938d8d2d2869dfaeb8fd36063cf322f
3
+ size 4178000
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42
3
+ size 12807982
tokenizer_config.json ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "248044": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "248045": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "248046": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "248047": {
29
+ "content": "<|object_ref_start|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "248048": {
37
+ "content": "<|object_ref_end|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "248049": {
45
+ "content": "<|box_start|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "248050": {
53
+ "content": "<|box_end|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "248051": {
61
+ "content": "<|quad_start|>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "248052": {
69
+ "content": "<|quad_end|>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "248053": {
77
+ "content": "<|vision_start|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "248054": {
85
+ "content": "<|vision_end|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "248055": {
93
+ "content": "<|vision_pad|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "248056": {
101
+ "content": "<|image_pad|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "248057": {
109
+ "content": "<|video_pad|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "248058": {
117
+ "content": "<tool_call>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": false
123
+ },
124
+ "248059": {
125
+ "content": "</tool_call>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": false
131
+ },
132
+ "248060": {
133
+ "content": "<|fim_prefix|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": false
139
+ },
140
+ "248061": {
141
+ "content": "<|fim_middle|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": false
147
+ },
148
+ "248062": {
149
+ "content": "<|fim_suffix|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": false
155
+ },
156
+ "248063": {
157
+ "content": "<|fim_pad|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": false
163
+ },
164
+ "248064": {
165
+ "content": "<|repo_name|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": false
171
+ },
172
+ "248065": {
173
+ "content": "<|file_sep|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": false
179
+ },
180
+ "248066": {
181
+ "content": "<tool_response>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": false
187
+ },
188
+ "248067": {
189
+ "content": "</tool_response>",
190
+ "lstrip": false,
191
+ "normalized": false,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": false
195
+ },
196
+ "248068": {
197
+ "content": "<think>",
198
+ "lstrip": false,
199
+ "normalized": false,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": false
203
+ },
204
+ "248069": {
205
+ "content": "</think>",
206
+ "lstrip": false,
207
+ "normalized": false,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": false
211
+ },
212
+ "248070": {
213
+ "content": "<|audio_start|>",
214
+ "lstrip": false,
215
+ "normalized": false,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": true
219
+ },
220
+ "248071": {
221
+ "content": "<|audio_end|>",
222
+ "lstrip": false,
223
+ "normalized": false,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": true
227
+ },
228
+ "248072": {
229
+ "content": "<tts_pad>",
230
+ "lstrip": false,
231
+ "normalized": false,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": true
235
+ },
236
+ "248073": {
237
+ "content": "<tts_text_bos>",
238
+ "lstrip": false,
239
+ "normalized": false,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": true
243
+ },
244
+ "248074": {
245
+ "content": "<tts_text_eod>",
246
+ "lstrip": false,
247
+ "normalized": false,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": true
251
+ },
252
+ "248075": {
253
+ "content": "<tts_text_bos_single>",
254
+ "lstrip": false,
255
+ "normalized": false,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": true
259
+ },
260
+ "248076": {
261
+ "content": "<|audio_pad|>",
262
+ "lstrip": false,
263
+ "normalized": false,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": true
267
+ }
268
+ },
269
+ "additional_special_tokens": [
270
+ "<|im_start|>",
271
+ "<|im_end|>",
272
+ "<|object_ref_start|>",
273
+ "<|object_ref_end|>",
274
+ "<|box_start|>",
275
+ "<|box_end|>",
276
+ "<|quad_start|>",
277
+ "<|quad_end|>",
278
+ "<|vision_start|>",
279
+ "<|vision_end|>",
280
+ "<|vision_pad|>",
281
+ "<|image_pad|>",
282
+ "<|video_pad|>"
283
+ ],
284
+ "bos_token": null,
285
+ "chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\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>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {{- '<|im_start|>system\\n' + content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content, false)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {{- raise_exception('No user query found in messages.') }}\n{%- endif %}\n{%- for message in messages %}\n {%- set content = render_content(message.content, true)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if loop.index0 > ns.last_query_index %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- else %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is defined %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}",
286
+ "clean_up_tokenization_spaces": false,
287
+ "eos_token": "<|im_end|>",
288
+ "errors": "replace",
289
+ "model_max_length": 262144,
290
+ "pad_token": "<|endoftext|>",
291
+ "split_special_tokens": false,
292
+ "tokenizer_class": "Qwen2Tokenizer",
293
+ "unk_token": null,
294
+ "add_bos_token": false,
295
+ "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+",
296
+ "extra_special_tokens": {
297
+ "audio_bos_token": "<|audio_start|>",
298
+ "audio_eos_token": "<|audio_end|>",
299
+ "audio_token": "<|audio_pad|>",
300
+ "image_token": "<|image_pad|>",
301
+ "video_token": "<|video_pad|>",
302
+ "vision_bos_token": "<|vision_start|>",
303
+ "vision_eos_token": "<|vision_end|>"
304
+ }
305
+ }
vision_weight.q4nx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07979ede48dd92aea3f1bb1cc8f6245151cb446c0edef1516f5edb41c6f1d646
3
+ size 1027737360