maniac-11111 commited on
Commit
b0234bb
·
0 Parent(s):

Mach-2 Additive Medium

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +37 -0
  2. LICENSE +202 -0
  3. MANIFEST.json +21 -0
  4. README.md +64 -0
  5. assets/size_vs_performance.png +3 -0
  6. chat_template.jinja +170 -0
  7. config.json +154 -0
  8. decode.py +404 -0
  9. draft/mtp_q4g64.safetensors +3 -0
  10. extras.safetensors +3 -0
  11. generation_config.json +12 -0
  12. merges.txt +0 -0
  13. packed/experts/L00.safetensors +3 -0
  14. packed/experts/L01.safetensors +3 -0
  15. packed/experts/L02.safetensors +3 -0
  16. packed/experts/L03.safetensors +3 -0
  17. packed/experts/L04.safetensors +3 -0
  18. packed/experts/L05.safetensors +3 -0
  19. packed/experts/L06.safetensors +3 -0
  20. packed/experts/L07.safetensors +3 -0
  21. packed/experts/L08.safetensors +3 -0
  22. packed/experts/L09.safetensors +3 -0
  23. packed/experts/L10.safetensors +3 -0
  24. packed/experts/L11.safetensors +3 -0
  25. packed/experts/L12.safetensors +3 -0
  26. packed/experts/L13.safetensors +3 -0
  27. packed/experts/L14.safetensors +3 -0
  28. packed/experts/L15.safetensors +3 -0
  29. packed/experts/L16.safetensors +3 -0
  30. packed/experts/L17.safetensors +3 -0
  31. packed/experts/L18.safetensors +3 -0
  32. packed/experts/L19.safetensors +3 -0
  33. packed/experts/L20.safetensors +3 -0
  34. packed/experts/L21.safetensors +3 -0
  35. packed/experts/L22.safetensors +3 -0
  36. packed/experts/L23.safetensors +3 -0
  37. packed/experts/L24.safetensors +3 -0
  38. packed/experts/L25.safetensors +3 -0
  39. packed/experts/L26.safetensors +3 -0
  40. packed/experts/L27.safetensors +3 -0
  41. packed/experts/L28.safetensors +3 -0
  42. packed/experts/L29.safetensors +3 -0
  43. packed/experts/L30.safetensors +3 -0
  44. packed/experts/L31.safetensors +3 -0
  45. packed/experts/L32.safetensors +3 -0
  46. packed/experts/L33.safetensors +3 -0
  47. packed/experts/L34.safetensors +3 -0
  48. packed/experts/L35.safetensors +3 -0
  49. packed/experts/L36.safetensors +3 -0
  50. packed/experts/L37.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ assets/size_vs_performance.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Alibaba Cloud
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
MANIFEST.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "Mach-2 Additive Medium",
3
+ "format": "fn_packed_v2",
4
+ "base_model": "Qwen/Qwen3.8-Flash-Next@de4b8e4d43b917e7706784d8bb445c9af86a3540",
5
+ "text_params": 125743653760,
6
+ "text_bpw": 1.69982,
7
+ "bytes": {
8
+ "experts": 23638716680,
9
+ "non_expert": 2504915216,
10
+ "head": 417180688,
11
+ "extras": 156822168,
12
+ "text_total": 26717634752,
13
+ "ngram_table_bf16": 102400513984
14
+ },
15
+ "not_shipped": "Vision weights and the bf16 MTP layer, outside the text budget; decode.py materialize copies them from the base repo",
16
+ "mtp": {
17
+ "path": "draft/mtp_q4g64.safetensors",
18
+ "format": "fn_mtp_q_v1",
19
+ "sha256": "c5d20938036e4e53e3de0ba8a805f9d544d5aabac6665e0a4dc5833418cff3be"
20
+ }
21
+ }
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.8-Flash-Next
4
+ tags:
5
+ - qwen
6
+ - mach-2
7
+ - additive
8
+ - mixture-of-experts
9
+ ---
10
+
11
+ ![Syzygy Research](https://cdn-uploads.huggingface.co/production/uploads/680868b984cac4b136ea7900/0YxMKj31WMJT1NwbVAGjj.png)
12
+
13
+ # Mach-2 Additive Medium
14
+
15
+ Mach-2 Additive Medium is Qwen3.8-Flash-Next at **1.70 bits per weight**: 26.7 GB for the 125.7B text parameters, plus
16
+ the model's n-gram embedding table at bf16 (102.4 GB).
17
+
18
+ ## Benchmarks
19
+
20
+ ![Average score vs GPU memory](https://huggingface.co/SyzygyResearch/Mach-2-Additive-Medium/resolve/main/assets/size_vs_performance.png)
21
+
22
+ Retention is Mach-2 Additive Medium's score divided by that of Qwen3.8-Flash-Next BF16, with both run on the same
23
+ harness, settings and tasks.
24
+
25
+ | Benchmark | Tasks | Mach-2 Additive Medium | BF16 | Retention |
26
+ | --- | ---: | ---: | ---: | ---: |
27
+ | Humanity's Last Exam (text) | 2,158 | 33.87 | 39.85 | 85.0% |
28
+ | GPQA Diamond | 198 x 5 | 90.51 | 92.22 | 98.1% |
29
+ | AIME 2026 | 30 x 8 | 96.25 | 95.83 | 100.4% |
30
+ | Terminal-Bench 2.1 | 89 | 78.65 | 82.02 | 95.9% |
31
+ | AutomationBench 1.0.6 | 600 | 71.67 | 70.29 | 102.0% |
32
+ | NL2Repo | 98 | 56.12 | 60.06 | 93.4% |
33
+ | DeepSWE v1.1 | 113 | 48.67 | 49.56 | 98.2% |
34
+ | τ³-Banking | 97 x 5 | 45.10 | 46.41 | 97.2% |
35
+
36
+ - **Humanity's Last Exam**: up to 163,840 output tokens, graded by Artificial Analysis's judge.
37
+ - **GPQA Diamond**: mean accuracy over 5 samples per question. Answers that reached 81,920 tokens were re-asked at
38
+ 163,840.
39
+ - **AIME 2026**: mean accuracy over 8 samples per problem, up to 81,920 output tokens.
40
+ - **Terminal-Bench 2.1**: Terminus 2, one attempt per task, 4 hours per task.
41
+ - **AutomationBench**: up to 50 steps per task, scored by Artificial Analysis's rule.
42
+ - **NL2Repo**: OpenHands without internet access; the 102 tasks BF16 finished, less 4 whose BF16 test run hit the
43
+ 1-hour scoring limit. Test runs cut at that limit are left out rather than scored 0. Mach-2 Additive Medium's score
44
+ averages two runs.
45
+ - **DeepSWE**: Claude Code as the agent, all 113 tasks, up to 10.5 hours per task. A task counts as solved only if the
46
+ agent solved it within 700 steps.
47
+ - **τ³-Banking**: tau2-bench 1.0.1, 5 trials per task, GPT-5.4 mini as the simulated user and judge, as Artificial
48
+ Analysis runs it. Pass rate over the 459 conversations both models completed; 26 that outgrew the context window or
49
+ lost the simulated user to an API error are left out.
50
+
51
+ Empty answers and answers still unfinished at the token limit score 0. Agents and limits differ from those behind
52
+ Qwen's model card, so compare these columns with each other rather than with scores published elsewhere.
53
+
54
+ ## Use
55
+
56
+ Run Mach-2 Additive Medium from its compressed weights with
57
+ [Mach-2 Additive Medium GGUF](https://huggingface.co/SyzygyResearch/Mach-2-Additive-Medium-GGUF) and the
58
+ [Mach-1 fork of llama.cpp](https://github.com/SyzygyResearch/llama.cpp-mach1). The 26.7 GB of weights fit on one GPU
59
+ with 32 GB or more.
60
+
61
+ Sample at temperature 1.0, top_p 0.95, top_k 20 (`generation_config.json`). Without these settings the model can loop.
62
+
63
+ This repository holds the packed weights; `decode.py` documents the packed format. `draft/mtp_q4g64.safetensors` is the
64
+ base model's MTP layer at 4 bits (group size 64) for speculative decoding with MLX.
assets/size_vs_performance.png ADDED

Git LFS Details

  • SHA256: 839b6cd6f069f0742411cad0ee42e5c32c4d961ec170c7f6791eee57729bbc4f
  • Pointer size: 131 Bytes
  • Size of remote file: 199 kB
chat_template.jinja ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {%- set reasoning_instructions = '' %}
46
+ {%- if enable_thinking is undefined or enable_thinking is true %}
47
+ {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
48
+ {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
49
+ {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
50
+ {%- endif %}
51
+ {%- if resolved_reasoning_effort == 'xhigh' %}
52
+ {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
53
+ {%- elif resolved_reasoning_effort == 'low' %}
54
+ {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
55
+ {%- endif %}
56
+ {%- endif %}
57
+ {%- if tools and tools is iterable and tools is not mapping %}
58
+ {{- '<|im_start|>system\n' }}
59
+ {%- if reasoning_instructions %}
60
+ {{- reasoning_instructions + '\n\n' }}
61
+ {%- endif %}
62
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
63
+ {%- for tool in tools %}
64
+ {{- "\n" }}
65
+ {{- tool | tojson }}
66
+ {%- endfor %}
67
+ {{- "\n</tools>" }}
68
+ {{- '\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>' }}
69
+ {%- if messages[0].role == 'system' %}
70
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
71
+ {%- if content %}
72
+ {{- '\n\n' + content }}
73
+ {%- endif %}
74
+ {%- endif %}
75
+ {{- '<|im_end|>\n' }}
76
+ {%- else %}
77
+ {%- if messages[0].role == 'system' %}
78
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
79
+ {%- if content %}
80
+ {{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
81
+ {%- elif reasoning_instructions %}
82
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
83
+ {%- endif %}
84
+ {%- elif reasoning_instructions %}
85
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
86
+ {%- endif %}
87
+ {%- endif %}
88
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
89
+ {%- for message in messages[::-1] %}
90
+ {%- set index = (messages|length - 1) - loop.index0 %}
91
+ {%- if ns.multi_step_tool and message.role == "user" %}
92
+ {%- set content = render_content(message.content, false)|trim %}
93
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
94
+ {%- set ns.multi_step_tool = false %}
95
+ {%- set ns.last_query_index = index %}
96
+ {%- endif %}
97
+ {%- endif %}
98
+ {%- endfor %}
99
+ {%- if ns.multi_step_tool %}
100
+ {{- raise_exception('No user query found in messages.') }}
101
+ {%- endif %}
102
+ {%- for message in messages %}
103
+ {%- set content = render_content(message.content, true)|trim %}
104
+ {%- if message.role == "system" %}
105
+ {%- if not loop.first %}
106
+ {{- raise_exception('System message must be at the beginning.') }}
107
+ {%- endif %}
108
+ {%- elif message.role == "user" %}
109
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
110
+ {%- elif message.role == "assistant" %}
111
+ {%- set reasoning_content = '' %}
112
+ {%- if message.reasoning_content is string %}
113
+ {%- set reasoning_content = message.reasoning_content %}
114
+ {%- endif %}
115
+ {%- set reasoning_content = reasoning_content|trim %}
116
+ {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
117
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
118
+ {%- else %}
119
+ {{- '<|im_start|>' + message.role + '\n' + content }}
120
+ {%- endif %}
121
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
122
+ {%- for tool_call in message.tool_calls %}
123
+ {%- if tool_call.function is defined %}
124
+ {%- set tool_call = tool_call.function %}
125
+ {%- endif %}
126
+ {%- if loop.first %}
127
+ {%- if content|trim %}
128
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
129
+ {%- else %}
130
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
131
+ {%- endif %}
132
+ {%- else %}
133
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
134
+ {%- endif %}
135
+ {%- if tool_call.arguments is defined and tool_call.arguments != '' %}
136
+ {%- for args_name, args_value in tool_call.arguments|items %}
137
+ {{- '<parameter=' + args_name + '>\n' }}
138
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
139
+ {{- args_value }}
140
+ {{- '\n</parameter>\n' }}
141
+ {%- endfor %}
142
+ {%- endif %}
143
+ {{- '</function>\n</tool_call>' }}
144
+ {%- endfor %}
145
+ {%- endif %}
146
+ {{- '<|im_end|>\n' }}
147
+ {%- elif message.role == "tool" %}
148
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
149
+ {{- '<|im_start|>user' }}
150
+ {%- endif %}
151
+ {{- '\n<tool_response>\n' }}
152
+ {{- content }}
153
+ {{- '\n</tool_response>' }}
154
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
155
+ {{- '<|im_end|>\n' }}
156
+ {%- elif loop.last %}
157
+ {{- '<|im_end|>\n' }}
158
+ {%- endif %}
159
+ {%- else %}
160
+ {{- raise_exception('Unexpected message role.') }}
161
+ {%- endif %}
162
+ {%- endfor %}
163
+ {%- if add_generation_prompt %}
164
+ {{- '<|im_start|>assistant\n' }}
165
+ {%- if enable_thinking is defined and enable_thinking is false %}
166
+ {{- '<think>\n\n</think>\n\n' }}
167
+ {%- else %}
168
+ {{- '<think>\n' }}
169
+ {%- endif %}
170
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen4ExpForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "language_model_only": false,
7
+ "model_type": "qwen4_exp",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "bos_token_id": 248044,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 248044,
14
+ "full_attention_interval": 4,
15
+ "hc_count": 4,
16
+ "hc_lowrank": 320,
17
+ "head_dim": 256,
18
+ "heads_per_ngram": 8,
19
+ "hidden_act": "silu",
20
+ "hidden_size": 2560,
21
+ "indexer_budget": 2048,
22
+ "indexer_compress_ratio": 4,
23
+ "indexer_head_dim": 128,
24
+ "indexer_kv_heads": 1,
25
+ "indexer_n_heads": 4,
26
+ "initializer_range": 0.02,
27
+ "layer_types": [
28
+ "linear_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "full_attention",
32
+ "linear_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "full_attention",
36
+ "linear_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "full_attention",
40
+ "linear_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "full_attention",
44
+ "linear_attention",
45
+ "linear_attention",
46
+ "linear_attention",
47
+ "full_attention",
48
+ "linear_attention",
49
+ "linear_attention",
50
+ "linear_attention",
51
+ "full_attention",
52
+ "linear_attention",
53
+ "linear_attention",
54
+ "linear_attention",
55
+ "full_attention",
56
+ "linear_attention",
57
+ "linear_attention",
58
+ "linear_attention",
59
+ "full_attention",
60
+ "linear_attention",
61
+ "linear_attention",
62
+ "linear_attention",
63
+ "full_attention",
64
+ "linear_attention",
65
+ "linear_attention",
66
+ "linear_attention",
67
+ "full_attention",
68
+ "linear_attention",
69
+ "linear_attention",
70
+ "linear_attention",
71
+ "full_attention",
72
+ "linear_attention",
73
+ "linear_attention",
74
+ "linear_attention",
75
+ "full_attention"
76
+ ],
77
+ "linear_conv_kernel_dim": 4,
78
+ "linear_key_head_dim": 128,
79
+ "linear_num_key_heads": 16,
80
+ "linear_num_value_heads": 48,
81
+ "linear_value_head_dim": 128,
82
+ "make_ngram_vocab_size_divisible_by": 128,
83
+ "mamba_ssm_dtype": "float32",
84
+ "max_position_embeddings": 262144,
85
+ "model_type": "qwen4_exp_text",
86
+ "moe_intermediate_size": 640,
87
+ "mtp": {
88
+ "hybrid": true,
89
+ "layer_types": [
90
+ "full_attention"
91
+ ],
92
+ "mtp_use_hidden_state_from_layer": null,
93
+ "num_hidden_layers": 1,
94
+ "rope_theta": 10000000
95
+ },
96
+ "mtp_num_hidden_layers": 1,
97
+ "mtp_use_dedicated_embeddings": false,
98
+ "ngram_size": 3,
99
+ "ngram_vocab_size_base": 20000000,
100
+ "num_attention_heads": 24,
101
+ "num_experts": 512,
102
+ "num_experts_per_tok": 10,
103
+ "num_hidden_layers": 48,
104
+ "num_key_value_heads": 2,
105
+ "output_gate_type": "sigmoid",
106
+ "output_router_logits": false,
107
+ "pad_token_id": null,
108
+ "partial_rotary_factor": 0.25,
109
+ "ple_conv_kernel_size": 4,
110
+ "ple_embed_dim": 2560,
111
+ "ple_layer_ids": [
112
+ 2
113
+ ],
114
+ "rms_norm_eps": 1e-06,
115
+ "rope_parameters": {
116
+ "mrope_interleaved": true,
117
+ "mrope_section": [
118
+ 11,
119
+ 11,
120
+ 10
121
+ ],
122
+ "partial_rotary_factor": 0.25,
123
+ "rope_theta": 10000000,
124
+ "rope_type": "default"
125
+ },
126
+ "router_aux_loss_coef": 0.001,
127
+ "shared_expert_intermediate_size": 640,
128
+ "split_ngram_parts": 128,
129
+ "tie_word_embeddings": false,
130
+ "use_cache": true,
131
+ "vocab_size": 248320
132
+ },
133
+ "tie_word_embeddings": false,
134
+ "transformers_version": "5.8.0.dev0",
135
+ "video_token_id": 248057,
136
+ "vision_config": {
137
+ "deepstack_visual_indexes": [],
138
+ "depth": 27,
139
+ "hidden_act": "gelu_pytorch_tanh",
140
+ "hidden_size": 1152,
141
+ "in_channels": 3,
142
+ "initializer_range": 0.02,
143
+ "intermediate_size": 4304,
144
+ "model_type": "qwen4_exp",
145
+ "num_heads": 16,
146
+ "num_position_embeddings": 2304,
147
+ "out_hidden_size": 2560,
148
+ "patch_size": 16,
149
+ "spatial_merge_size": 2,
150
+ "temporal_patch_size": 2
151
+ },
152
+ "vision_end_token_id": 248054,
153
+ "vision_start_token_id": 248053
154
+ }
decode.py ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Decode the packed Mach-2 Additive Medium checkpoint into a bf16 Hugging Face checkpoint.
3
+
4
+ python decode.py materialize --packed-dir . --out /path/ckpt [--workers 8] [--no-base]
5
+ """
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import math
10
+ import os
11
+
12
+ import numpy as np
13
+
14
+ HIDDEN, INTER, NEXP, NLAYERS = 2560, 640, 512, 48
15
+ BASE_REPO, BASE_REVISION = "Qwen/Qwen3.8-Flash-Next", "de4b8e4d43b917e7706784d8bb445c9af86a3540"
16
+ FORMAT = "fn_packed_v2"
17
+
18
+
19
+ def _hmat(q_elems, chi, sub):
20
+ n = len(q_elems)
21
+ Q = np.array([[chi(sub(q_elems[i], q_elems[j])) for j in range(n)] for i in range(n)], np.float64)
22
+ C = np.zeros((n + 1, n + 1))
23
+ C[0, 1:] = 1.0
24
+ C[1:, 0] = 1.0
25
+ C[1:, 1:] = Q
26
+ A = np.array([[1.0, 1.0], [1.0, -1.0]])
27
+ B = np.array([[1.0, -1.0], [-1.0, -1.0]])
28
+ H = np.kron(C, A) + np.kron(np.eye(n + 1), B)
29
+ r = 2 * (n + 1)
30
+ assert np.array_equal(H, H.T) and np.array_equal(H @ H, r * np.eye(r))
31
+ return H.astype(np.float32)
32
+
33
+
34
+ def hadamard_12():
35
+ chi5 = {0: 0, 1: 1, 2: -1, 3: -1, 4: 1}
36
+ return _hmat(list(range(5)), lambda e: chi5[e], lambda u, v: (u - v) % 5)
37
+
38
+
39
+ def hadamard_20():
40
+ els = [(a, b) for a in range(3) for b in range(3)]
41
+
42
+ def mul(u, v):
43
+ (a, b), (c, d) = u, v
44
+ return ((a * c - b * d) % 3, (a * d + b * c) % 3)
45
+ squares = {mul(e, e) for e in els if e != (0, 0)}
46
+ return _hmat(els, lambda e: 0 if e == (0, 0) else (1 if e in squares else -1),
47
+ lambda u, v: ((u[0] - v[0]) % 3, (u[1] - v[1]) % 3))
48
+
49
+
50
+ _HS = {
51
+ 12: ["+-----------", "++-+---+++-+", "+++-+---+++-", "+-++-+---+++", "++-++-+---++", "+++-++-+---+",
52
+ "++++-++-+---", "+-+++-++-+--", "+--+++-++-+-", "+---+++-++-+", "++---+++-++-", "+-+---+++-++"],
53
+ 20: ["+-------------------", "++-++----+-+-++++--+", "+++-++----+-+-++++--", "+-++-++----+-+-++++-",
54
+ "+--++-++----+-+-++++", "++--++-++----+-+-+++", "+++--++-++----+-+-++", "++++--++-++----+-+-+",
55
+ "+++++--++-++----+-+-", "+-++++--++-++----+-+", "++-++++--++-++----+-", "+-+-++++--++-++----+",
56
+ "++-+-++++--++-++----", "+-+-+-++++--++-++---", "+--+-+-++++--++-++--", "+---+-+-++++--++-++-",
57
+ "+----+-+-++++--++-++", "++----+-+-++++--++-+", "+++----+-+-++++--++-", "+-++----+-+-++++--++"],
58
+ }
59
+ _HR = {}
60
+
61
+
62
+ def _hr(kind, radix):
63
+ if (kind, radix) not in _HR:
64
+ if kind == "spine":
65
+ H = np.array([[1.0 if c == "+" else -1.0 for c in r] for r in _HS[radix]], np.float32)
66
+ assert np.array_equal(H @ H.T, radix * np.eye(radix, dtype=np.float32))
67
+ else:
68
+ H = hadamard_12() if radix == 12 else hadamard_20()
69
+ _HR[(kind, radix)] = H
70
+ return _HR[(kind, radix)]
71
+
72
+
73
+ def hadamard(x, kind="expert"):
74
+ x = np.asarray(x, np.float32)
75
+ shape, N = x.shape, x.shape[-1]
76
+ if N & (N - 1):
77
+ radix = 12 if (N % 12 == 0 and (N // 12) & (N // 12 - 1) == 0) else 20
78
+ M = N // radix
79
+ assert N % radix == 0 and M & (M - 1) == 0, f"Hadamard needs 2^k, 12*2^k or 20*2^k, got {N}"
80
+ if kind == "spine":
81
+ xb = _butterflies(x.reshape(-1, radix, M)) if M > 1 else x.reshape(-1, radix, 1)
82
+ return (np.matmul(_hr(kind, radix), xb) / np.float32(math.sqrt(N))).reshape(shape)
83
+ xb = hadamard(x.reshape(-1, radix, M)) if M > 1 else x.reshape(-1, radix, 1)
84
+ return (np.matmul(_hr(kind, radix), xb) / np.float32(math.sqrt(radix))).reshape(shape)
85
+ return (_butterflies(x) / np.float32(math.sqrt(N))).reshape(shape)
86
+
87
+
88
+ def _butterflies(x):
89
+ N = x.shape[-1]
90
+ cur = np.ascontiguousarray(x, np.float32).reshape(-1, N)
91
+ span = 1
92
+ while span < N:
93
+ blk = cur.reshape(-1, N // (2 * span), 2, span)
94
+ cur = np.stack([blk[:, :, 0] + blk[:, :, 1], blk[:, :, 0] - blk[:, :, 1]], 2).reshape(-1, N)
95
+ span *= 2
96
+ return cur.reshape(x.shape)
97
+
98
+
99
+ def bf16_round(x):
100
+ u = np.ascontiguousarray(x, np.float32).view(np.uint32)
101
+ return ((u + np.uint32(0x7FFF) + ((u >> np.uint32(16)) & np.uint32(1))) & np.uint32(0xFFFF0000)).view(np.float32)
102
+
103
+
104
+ def _read(path):
105
+ from safetensors import safe_open
106
+ with safe_open(path, framework="np") as fh:
107
+ return {k: fh.get_tensor(k) for k in fh.keys()}, dict(fh.metadata() or {})
108
+
109
+
110
+ EX_V, EX_L, EX_TD = 4, 16, 16
111
+ EX_SHAPES = {"gate": (INTER, HIDDEN), "up": (INTER, HIDDEN), "down": (HIDDEN, INTER)}
112
+
113
+
114
+ def _ex_states(words, K4):
115
+ words = np.asarray(words).view(np.uint16).astype(np.int64)
116
+ rows, nstep, step = words.shape[0], EX_TD * EX_TD // EX_V, int(K4)
117
+ bits = ((words[:, :, None] >> np.arange(15, -1, -1)) & 1).reshape(rows, -1)[:, :step * nstep]
118
+ bits = np.concatenate([bits, bits[:, :EX_L - step]], axis=1)
119
+ w = 1 << np.arange(EX_L - 1, -1, -1, dtype=np.int64)
120
+ idx = np.arange(nstep)[:, None] * step + np.arange(EX_L)[None, :]
121
+ return bits[:, idx] @ w
122
+
123
+
124
+ def wave_map(Mb, Nb):
125
+ starts = [(Mb - i - 1, Nb - 1) for i in range(Mb)] + [(0, Nb - i - 1) for i in range(Nb)]
126
+ idx = np.zeros((Mb, Nb), dtype=np.int64)
127
+ for w, (jm, jn) in enumerate(starts):
128
+ while 0 <= jm < Mb and 0 <= jn < Nb:
129
+ idx[jm, jn] = w
130
+ jm, jn = jm + 1, jn - 1
131
+ return idx
132
+
133
+
134
+ def sign_seed(layer, expert, proj, side, ns="canon"):
135
+ return int.from_bytes(hashlib.sha256(f"{ns}|L{layer}|e{expert}|{proj}|{side}".encode()).digest()[:7], "big")
136
+
137
+
138
+ _PM0, _PM1 = np.uint64(0xD2511F53), np.uint64(0xCD9E8D57)
139
+ _PW0, _PW1, _PMASK = np.uint64(0x9E3779B9), np.uint64(0xBB67AE85), np.uint64(0xFFFFFFFF)
140
+
141
+
142
+ def expert_signs(seeds, dim):
143
+ E = len(seeds)
144
+ c2 = np.tile(np.arange(dim, dtype=np.uint64), E)
145
+ k0 = np.repeat(np.array([s & 0xFFFFFFFF for s in seeds], np.uint64), dim)
146
+ k1 = np.repeat(np.array([s >> 32 for s in seeds], np.uint64), dim)
147
+ c0 = c1 = c3 = np.zeros(E * dim, np.uint64)
148
+ for r in range(10):
149
+ if r:
150
+ k0, k1 = (k0 + _PW0) & _PMASK, (k1 + _PW1) & _PMASK
151
+ p0, p1 = _PM0 * c0, _PM1 * c2
152
+ c0, c1, c2, c3 = (p1 >> np.uint64(32)) ^ c1 ^ k0, p1 & _PMASK, (p0 >> np.uint64(32)) ^ c3 ^ k1, p0 & _PMASK
153
+ inv2pi = np.float32(2 * np.pi / 2 ** 32)
154
+ v = (c1.astype(np.float32) * inv2pi + inv2pi / np.float32(2)).astype(np.float32)
155
+ u = (c0.astype(np.float32) * np.float32(2.0 ** -32) + np.float32(2.0 ** -33)).astype(np.float32)
156
+ return np.where((v <= np.float32(np.pi)) | (u == np.float32(1.0)), 1.0, -1.0).astype(np.float32).reshape(E, dim)
157
+
158
+
159
+ def _lut(cb, K4):
160
+ return np.asarray(cb.get(f"lut.k{K4}", cb["lut"]), np.float32)
161
+
162
+
163
+ def decode_expert(t, cb, proj, e):
164
+ m, n = EX_SHAPES[proj]
165
+ K4 = int(t[f"{proj}.rate_k4"][e])
166
+ ex = np.asarray(t[f"k{K4}.{proj}.experts"])
167
+ row = int(np.searchsorted(ex, e))
168
+ assert row < ex.size and ex[row] == e, (proj, e, K4)
169
+ states = _ex_states(t[f"k{K4}.{proj}.trellis"][row], K4)
170
+ Mb, Nb = m // EX_TD, n // EX_TD
171
+ unit = _lut(cb, K4)[states].reshape(Mb, Nb, EX_TD, EX_TD).transpose(0, 2, 1, 3).reshape(m, n)
172
+ g = np.asarray(t[f"{proj}.wave_gamma"][e], np.float32)[wave_map(Mb, Nb)]
173
+ unit = (unit.reshape(Mb, EX_TD, Nb, EX_TD) * g[:, None, :, None]).reshape(m, n)
174
+ unit = unit * np.float32(t[f"{proj}.wscale"][e])
175
+ rows = hadamard(unit) * t[f"{proj}.SU"][e]
176
+ cols = hadamard(np.ascontiguousarray(rows.T)) * t[f"{proj}.SV"][e]
177
+ return np.ascontiguousarray(cols.T)
178
+
179
+
180
+ def load_expert_layer(packed_dir, layer):
181
+ t, meta = _read(os.path.join(packed_dir, "experts", f"L{layer:02d}.safetensors"))
182
+ assert meta.get("format") == FORMAT, f"L{layer}: not an {FORMAT} expert shard ({meta.get('format')})"
183
+ cb = _read(os.path.join(packed_dir, "experts", "codebook.safetensors"))[0]
184
+ return with_signs(t, layer), cb
185
+
186
+
187
+ def with_signs(t, layer):
188
+ for p, (m, n) in EX_SHAPES.items():
189
+ if f"{p}.SU" not in t:
190
+ t[f"{p}.SU"] = expert_signs([sign_seed(layer, e, p, "SU") for e in range(NEXP)], n)
191
+ t[f"{p}.SV"] = expert_signs([sign_seed(layer, e, p, "SV") for e in range(NEXP)], m)
192
+ return t
193
+
194
+
195
+ def decode_expert_layer(packed_dir, layer, experts=None):
196
+ t, cb = load_expert_layer(packed_dir, layer)
197
+ experts = list(range(NEXP)) if experts is None else list(experts)
198
+ gu = np.empty((len(experts), 2 * INTER, HIDDEN), np.float32)
199
+ dn = np.empty((len(experts), HIDDEN, INTER), np.float32)
200
+ for i, e in enumerate(experts):
201
+ gu[i, :INTER] = decode_expert(t, cb, "gate", e)
202
+ gu[i, INTER:] = decode_expert(t, cb, "up", e)
203
+ dn[i] = decode_expert(t, cb, "down", e)
204
+ return {"gate_up_proj": gu, "down_proj": dn}
205
+
206
+
207
+ NE_K, NE_L, NE_V, NE_TLUT_BITS, NE_TD = 4, 16, 2, 9, 16
208
+ _FULL_LUT = {}
209
+
210
+
211
+ def _ne_full_lut(tlut):
212
+ key = np.asarray(tlut).tobytes()
213
+ if key not in _FULL_LUT:
214
+ small = np.asarray(tlut, np.float32)
215
+ s = np.arange(1 << NE_L, dtype=np.int64)
216
+ p = s * (s + 1)
217
+ row = (p >> (16 - NE_TLUT_BITS - 1)) & ((1 << NE_TLUT_BITS) - 1)
218
+ table = small[row].copy()
219
+ table[:, 0] *= (1 - ((p >> 15) & 1) * 2).astype(np.float32)
220
+ _FULL_LUT[key] = table
221
+ return _FULL_LUT[key]
222
+
223
+
224
+ def _ne_states(words):
225
+ words = np.asarray(words).view(np.uint16).astype(np.int64)
226
+ rows, T = words.shape[0], NE_TD * NE_TD
227
+ step, nstep = NE_K * NE_V, T // NE_V
228
+ bits = ((words[:, :, None] >> np.arange(15, -1, -1)) & 1).reshape(rows, -1)[:, :T * NE_K]
229
+ bits = np.concatenate([bits, bits[:, :NE_L - step]], axis=1)
230
+ w = 1 << np.arange(NE_L - 1, -1, -1, dtype=np.int64)
231
+ idx = np.arange(nstep)[:, None] * step + np.arange(NE_L)[None, :]
232
+ return bits[:, idx] @ w
233
+
234
+
235
+ def decode_ne_tensor(t, name, m, n, tlut):
236
+ states = _ne_states(t[f"{name}|trellis"])
237
+ vals = _ne_full_lut(tlut)[states]
238
+ unit = np.ascontiguousarray(vals.reshape(m // NE_TD, n // NE_TD, NE_TD, NE_TD).transpose(0, 2, 1, 3)).reshape(m, n)
239
+ unit = unit * np.float32(np.asarray(t[f"{name}|Wscale"]).reshape(-1)[0])
240
+ su, sv = np.asarray(t[f"{name}|SU"]), np.asarray(t[f"{name}|SV"])
241
+ rows = hadamard(unit, "spine") * np.sign(su).astype(np.float32)
242
+ cols = hadamard(np.ascontiguousarray(rows.T), "spine") * np.sign(sv).astype(np.float32)
243
+ w = np.ascontiguousarray(cols.T)
244
+ mx = np.asarray(t[f"{name}|rc_max"], np.float32)
245
+ r, c = rc_grid(mx[0], np.abs(sv.astype(np.int32))), rc_grid(mx[1], np.abs(su.astype(np.int32)))
246
+ return (r[:, None] * bf16_round(w)) * c[None, :]
247
+
248
+
249
+ def rc_grid(mx, k):
250
+ return (np.float32(mx) * k.astype(np.float32)).astype(np.float32) * np.float32(1.0 / 127.0)
251
+
252
+
253
+ def decode_ne_shard(packed_dir, layer):
254
+ t, meta = _read(os.path.join(packed_dir, "ne", f"L{layer:02d}.safetensors"))
255
+ tlut = _read(os.path.join(packed_dir, "ne", "tlut.safetensors"))[0]["tlut"]
256
+ dims = json.loads(meta["dims"])
257
+ return {name: decode_ne_tensor(t, name, d[2], d[3], tlut)[:d[0], :d[1]] for name, d in dims.items()}
258
+
259
+
260
+ def unpack_int5(qp, n):
261
+ m = qp.shape[0]
262
+ by = np.asarray(qp).reshape(m, n // 8, 5)
263
+ full = np.zeros((m, n // 8, 8), dtype=np.uint8)
264
+ full[:, :, :5] = by
265
+ word = full.reshape(m, n).view("<u8").reshape(m, n // 8)
266
+ out = np.zeros((m, n // 8, 8), dtype=np.int8)
267
+ for i in range(8):
268
+ out[:, :, i] = ((word >> np.uint64(5 * i)) & np.uint64(31)).astype(np.int8) - 16
269
+ return out.reshape(m, n)
270
+
271
+
272
+ def decode_head(packed_dir):
273
+ d = os.path.join(packed_dir, "head")
274
+ parts = []
275
+ for f in sorted(x for x in os.listdir(d) if x.startswith("head_c") and x.endswith(".safetensors")):
276
+ t, meta = _read(os.path.join(d, f))
277
+ parts += [(int(name.split(":")[1]), m0, n0, int(meta.get("group", 64)), t, name)
278
+ for name, (m0, n0) in json.loads(meta["dims"]).items()]
279
+ parts.sort(key=lambda x: x[0])
280
+ out = np.empty((sum(p[1] for p in parts), parts[0][2]), np.float32)
281
+ for r0, m0, n0, g, t, name in parts:
282
+ q = unpack_int5(t[f"{name}|qp"], n0).astype(np.float32)
283
+ out[r0:r0 + m0] = q * np.repeat(np.asarray(t[f"{name}|gscale"], np.float32), g, axis=1)[:, :n0]
284
+ return out
285
+
286
+
287
+ def decode_embed(packed_dir, bits=4, rows_per=16384):
288
+ t, _ = _read(os.path.join(packed_dir, "ne", f"embed_int{bits}.safetensors"))
289
+ rows, ng = t["mn"].shape
290
+ hid = t["q_packed"].shape[1] * 8 // bits
291
+ out = np.empty((rows, hid), np.float32)
292
+ for r0 in range(0, rows, rows_per):
293
+ sl = slice(r0, min(r0 + rows_per, rows))
294
+ b = np.unpackbits(t["q_packed"][sl], axis=1, count=hid * bits).reshape(-1, hid, bits)
295
+ q = np.zeros(b.shape[:2], np.uint8)
296
+ for j in range(bits):
297
+ q = (q << 1) | b[..., j]
298
+ mn = t["mn"][sl].astype(np.float32)[..., None]
299
+ mx = t["mx"][sl].astype(np.float32)[..., None]
300
+ step = np.maximum(mx - mn, np.float32(1e-8)) * np.float32(1.0 / (2 ** bits - 1))
301
+ out[sl] = (mn + q.reshape(-1, ng, hid // ng).astype(np.float32) * step).reshape(-1, hid)
302
+ return out
303
+
304
+
305
+ def decode_int8_rows(packed_dir):
306
+ from safetensors import safe_open
307
+ out = {}
308
+ with safe_open(os.path.join(packed_dir, "ne", "int8_rows.safetensors"), framework="pt") as fh:
309
+ names = sorted({k.split("|")[0] for k in fh.keys()})
310
+ for name in names:
311
+ q = fh.get_tensor(f"{name}|q").numpy().astype(np.float32)
312
+ s = fh.get_tensor(f"{name}|scale").float().numpy()
313
+ out[name] = q * s
314
+ return out
315
+
316
+
317
+ def _bf16(a):
318
+ import torch
319
+ return torch.from_numpy(np.ascontiguousarray(a, np.float32)).to(torch.bfloat16)
320
+
321
+
322
+ def _expert_layer_job(args):
323
+ packed_dir, out, L = args
324
+ import torch
325
+ from safetensors.torch import save_file
326
+ t, cb = load_expert_layer(packed_dir, L)
327
+ gu = torch.empty((NEXP, 2 * INTER, HIDDEN), dtype=torch.bfloat16)
328
+ dn = torch.empty((NEXP, HIDDEN, INTER), dtype=torch.bfloat16)
329
+ for e in range(NEXP):
330
+ gu[e, :INTER] = _bf16(decode_expert(t, cb, "gate", e))
331
+ gu[e, INTER:] = _bf16(decode_expert(t, cb, "up", e))
332
+ dn[e] = _bf16(decode_expert(t, cb, "down", e))
333
+ p = f"model.language_model.layers.{L}.mlp.experts."
334
+ fn = f"experts-L{L:02d}.safetensors"
335
+ save_file({p + "gate_up_proj": gu, p + "down_proj": dn}, os.path.join(out, fn), metadata={"format": "pt"})
336
+ return {p + "gate_up_proj": fn, p + "down_proj": fn}
337
+
338
+
339
+ def _ne_layer_job(args):
340
+ packed_dir, out, L = args
341
+ from safetensors.torch import save_file
342
+ dec = decode_ne_shard(packed_dir, L)
343
+ fn = f"spine-L{L:02d}.safetensors"
344
+ save_file({k: _bf16(v) for k, v in dec.items()}, os.path.join(out, fn), metadata={"format": "pt"})
345
+ return {k: fn for k in dec}
346
+
347
+
348
+ def materialize(packed_dir, out, workers=4, base=True):
349
+ import shutil
350
+ from concurrent.futures import ProcessPoolExecutor
351
+ from safetensors import safe_open
352
+ from safetensors.torch import save_file
353
+ os.makedirs(out, exist_ok=True)
354
+ root = os.path.dirname(os.path.abspath(packed_dir.rstrip("/"))) if os.path.basename(packed_dir.rstrip("/")) == "packed" \
355
+ else packed_dir
356
+ pk = os.path.join(root, "packed")
357
+ wm = {}
358
+ with ProcessPoolExecutor(workers) as ex:
359
+ for r in ex.map(_ne_layer_job, [(pk, out, L) for L in range(NLAYERS)]):
360
+ wm.update(r)
361
+ for r in ex.map(_expert_layer_job, [(pk, out, L) for L in range(NLAYERS)]):
362
+ wm.update(r)
363
+ save_file({"lm_head.weight": _bf16(decode_head(pk))}, os.path.join(out, "head.safetensors"), metadata={"format": "pt"})
364
+ wm["lm_head.weight"] = "head.safetensors"
365
+ emb = "model.language_model.embed_tokens.weight"
366
+ save_file({emb: _bf16(decode_embed(pk))}, os.path.join(out, "embed.safetensors"), metadata={"format": "pt"})
367
+ wm[emb] = "embed.safetensors"
368
+ i8 = decode_int8_rows(pk)
369
+ save_file({k: _bf16(v) for k, v in i8.items()}, os.path.join(out, "int8rows.safetensors"), metadata={"format": "pt"})
370
+ wm.update({k: "int8rows.safetensors" for k in i8})
371
+ for f in ["extras.safetensors"] + sorted(os.path.join("packed", "table", x) for x in os.listdir(os.path.join(pk, "table"))
372
+ if x.endswith(".safetensors")):
373
+ dst = os.path.basename(f)
374
+ shutil.copyfile(os.path.join(root, f), os.path.join(out, dst))
375
+ with safe_open(os.path.join(out, dst), framework="pt") as fh:
376
+ wm.update({k: dst for k in fh.keys()})
377
+ if base:
378
+ from huggingface_hub import hf_hub_download
379
+ idx = json.load(open(hf_hub_download(BASE_REPO, "model.safetensors.index.json", revision=BASE_REVISION)))["weight_map"]
380
+ want = {k: f for k, f in idx.items() if k.startswith("mtp.") or k.startswith("model.visual.")}
381
+ for f in sorted(set(want.values())):
382
+ src = hf_hub_download(BASE_REPO, f, revision=BASE_REVISION)
383
+ with safe_open(src, framework="pt") as fh:
384
+ ks = [k for k in fh.keys() if k in want]
385
+ save_file({k: fh.get_tensor(k) for k in ks}, os.path.join(out, f"base-{f}"), metadata={"format": "pt"})
386
+ wm.update({k: f"base-{f}" for k in ks})
387
+ for f in os.listdir(root):
388
+ if f.endswith((".json", ".jinja", ".txt")) and f not in ("MANIFEST.json", "model.safetensors.index.json"):
389
+ shutil.copyfile(os.path.join(root, f), os.path.join(out, f))
390
+ json.dump({"metadata": {}, "weight_map": dict(sorted(wm.items()))}, open(os.path.join(out, "model.safetensors.index.json"), "w"),
391
+ indent=1)
392
+ print(f"MATERIALIZED {len(wm)} tensors -> {out}", flush=True)
393
+
394
+
395
+ if __name__ == "__main__":
396
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
397
+ sub = ap.add_subparsers(dest="cmd", required=True)
398
+ m = sub.add_parser("materialize")
399
+ m.add_argument("--packed-dir", default=".")
400
+ m.add_argument("--out", required=True)
401
+ m.add_argument("--workers", type=int, default=4)
402
+ m.add_argument("--no-base", action="store_true", help="text-only: skip MTP and vision weights")
403
+ a = ap.parse_args()
404
+ materialize(a.packed_dir, a.out, a.workers, not a.no_base)
draft/mtp_q4g64.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5d20938036e4e53e3de0ba8a805f9d544d5aabac6665e0a4dc5833418cff3be
3
+ size 1512635845
extras.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbbced7ad87bc663044eb8f35349e56bccf4d57f456b18600c3b36481f26152b
3
+ size 156822168
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 248044,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 248046,
6
+ 248044
7
+ ],
8
+ "pad_token_id": 248044,
9
+ "temperature": 1.0,
10
+ "top_k": 20,
11
+ "top_p": 0.95
12
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
packed/experts/L00.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e99dcc1d6ca7ed32d02f66d613143991385832e189e36237400b447cad1bdbbe
3
+ size 533316488
packed/experts/L01.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbb17185e876c23a58dedd6c75a1b769a8d8b9039a792860b9ea5e4ff9b54b87
3
+ size 513502088
packed/experts/L02.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fcab802a471051c975ee917a500c09be2da5dd398a3c49b2cdee3bc270eb6e5
3
+ size 518110096
packed/experts/L03.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f2d64d35b2db6863099c84187722a8d688fc8d979a0f0605ef253fcd25c7a41
3
+ size 480170904
packed/experts/L04.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c1f02b7c0b8f098b271d30f2c4151da4a68acb0e2e5456a49474461893a90d3
3
+ size 493841296
packed/experts/L05.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1a61848a549988b47032ba0520f256959b5b1a941de88ef8e26f7198171a89d
3
+ size 511198096
packed/experts/L06.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdbb4b76fdac70682ff2dd476efc80377cf6a905cadb4177583ba1e896867114
3
+ size 511812496
packed/experts/L07.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0472e314cb41e7900697fdd82d02ed074b3ecd18cd3cdf8e8d7185abeaf3a81
3
+ size 510276496
packed/experts/L08.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eab2698738aae45f74b19e68075f992f94937cf8452d49934f325c886fef6087
3
+ size 498602896
packed/experts/L09.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9c345470b1a58e5f49e9bf2844503d421c39e0c88be77324b612222f627028c
3
+ size 495070096
packed/experts/L10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4667ea834cb3b694a5ef1995dee2ebe4da8033b1c2eb5f754d1fe7cd7ebbffb
3
+ size 510430096
packed/experts/L11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9759b241a85f7b1b9487e532e3e014caa61de6e8eb8aab0ca7198c739b891aaa
3
+ size 499831704
packed/experts/L12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81a10406eebefed32a85b08f922da69c7b9d2794df3283ca2b3fb4fb5ca8f704
3
+ size 508740496
packed/experts/L13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:089f9c0dbbccd9fe981efdf1d34bbac560e70484b34caaacbddc823da90934d0
3
+ size 511966096
packed/experts/L14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7186adb703c5d69a933f38e654cc0499a739fb2e99c2243c27b8acb0a381e323
3
+ size 491537304
packed/experts/L15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3660f1ba16085cbf18a8977d8d9098d86931a8f1cc3b6aa9e89e0c566af6712e
3
+ size 467575704
packed/experts/L16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15afe7a13d8e35937176aed12bcf15c93f0a81edd89e7e632deeccc7ef358ed5
3
+ size 471569304
packed/experts/L17.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9902a7bd509c4e02f95caa388f79c4c6a1724b476e936494d7da4369cadd0710
3
+ size 493534096
packed/experts/L18.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:670662b2c7e660b82352bfaa7480facef8c26509a01bea13d7e9217137d14fbd
3
+ size 509201296
packed/experts/L19.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c6f384536ecf77026fd0a3e4823055e2325e3e440c2960902cbebf4341197da
3
+ size 492151704
packed/experts/L20.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d190c34e37d3ae9202db3d58326b6048332911393ccb4b39713a31ea28af7c5a
3
+ size 494916504
packed/experts/L21.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98bed192933800e2cfaf36052e6643f05fb2bbe7b63c7eb0103360e0097e4e16
3
+ size 503210896
packed/experts/L22.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e8d86faa4307e402c8a1dedf2df370d57fb4b9c602a1036871ae9f2debcdd51
3
+ size 510583688
packed/experts/L23.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cda7c6e0fc373985df1c0b53e1fcb88245551c292f5ddb48e8e4848babdc3b19
3
+ size 494455704
packed/experts/L24.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11b39f74aee653679c74ba6c824f9868c89b010dbc4b711a4785717c30f56e86
3
+ size 497527704
packed/experts/L25.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a5f2d25dcbc819bdfbf1db1fd15a2cb7f6058ce2702c66e072d22659769a3f9
3
+ size 491690904
packed/experts/L26.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc59344425975938112126db05d2572c3d5539c0f51c4c9eacd883f2d275c94a
3
+ size 499985304
packed/experts/L27.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:081423166140fc179c73a64445ad733c5a06c9e57a05eabb721c45b4c378f210
3
+ size 492766104
packed/experts/L28.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:adf9f23a5bbd60fef93d10875534ec638ab9ca8fb4d5e6b096765761264b2560
3
+ size 504132496
packed/experts/L29.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:039e92c2768c5a353341d2dd8ae13df19e94fc63cbd7750032017429a76d9d42
3
+ size 503671696
packed/experts/L30.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8539bd2bf9682952b62a789710ec6296501c464aa7aeea0754a5e407b8ec41f9
3
+ size 488004504
packed/experts/L31.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0284540abfffba22d3a9d1e654434774dc59b27df1e3f11c333b5d9670f0387
3
+ size 468804504
packed/experts/L32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02a03fcafb1d91c3daa862e3c7e440d4b7b2c32be6da7d92cb7ee31cf9e243bf
3
+ size 475102104
packed/experts/L33.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90871dab9870681589fe197759eda5908164fd6cbe5fdcc1ec24b17a76ec9861
3
+ size 496452496
packed/experts/L34.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18b960da6f0317caad88269c61e6888ddc88052c07ba1d446317f060c8a52abd
3
+ size 509815688
packed/experts/L35.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e98d1433782fe23a466ada0dfb44a0005225250218cd71b1724c98734b685e0
3
+ size 490922904
packed/experts/L36.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f1239de13966f34ff41e8a2bccee59e4d368dfa655899396a43b39117bb323a
3
+ size 479556512
packed/experts/L37.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb43c4af85822c59ce1fce98db7622e06ae3a4d0958f793c98243822637c9cba
3
+ size 491076504