cloudyu commited on
Commit
c11438d
·
verified ·
1 Parent(s): 969c403

Upload folder using huggingface_hub

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 +3 -0
  2. LICENSE +210 -0
  3. README.md +149 -0
  4. README_CN.md +227 -0
  5. chat_template.jinja +222 -0
  6. config.json +84 -0
  7. generation_config.json +10 -0
  8. model-00001-of-00099.safetensors +3 -0
  9. model-00002-of-00099.safetensors +3 -0
  10. model-00003-of-00099.safetensors +3 -0
  11. model-00004-of-00099.safetensors +3 -0
  12. model-00005-of-00099.safetensors +3 -0
  13. model-00006-of-00099.safetensors +3 -0
  14. model-00007-of-00099.safetensors +3 -0
  15. model-00008-of-00099.safetensors +3 -0
  16. model-00009-of-00099.safetensors +3 -0
  17. model-00010-of-00099.safetensors +3 -0
  18. model-00011-of-00099.safetensors +3 -0
  19. model-00012-of-00099.safetensors +3 -0
  20. model-00013-of-00099.safetensors +3 -0
  21. model-00014-of-00099.safetensors +3 -0
  22. model-00015-of-00099.safetensors +3 -0
  23. model-00016-of-00099.safetensors +3 -0
  24. model-00017-of-00099.safetensors +3 -0
  25. model-00018-of-00099.safetensors +3 -0
  26. model-00019-of-00099.safetensors +3 -0
  27. model-00020-of-00099.safetensors +3 -0
  28. model-00021-of-00099.safetensors +3 -0
  29. model-00022-of-00099.safetensors +3 -0
  30. model-00023-of-00099.safetensors +3 -0
  31. model-00024-of-00099.safetensors +3 -0
  32. model-00025-of-00099.safetensors +3 -0
  33. model-00026-of-00099.safetensors +3 -0
  34. model-00027-of-00099.safetensors +3 -0
  35. model-00028-of-00099.safetensors +3 -0
  36. model-00029-of-00099.safetensors +3 -0
  37. model-00030-of-00099.safetensors +3 -0
  38. model-00031-of-00099.safetensors +3 -0
  39. model-00032-of-00099.safetensors +3 -0
  40. model-00033-of-00099.safetensors +3 -0
  41. model-00034-of-00099.safetensors +3 -0
  42. model-00035-of-00099.safetensors +3 -0
  43. model-00036-of-00099.safetensors +3 -0
  44. model-00037-of-00099.safetensors +3 -0
  45. model-00038-of-00099.safetensors +3 -0
  46. model-00039-of-00099.safetensors +3 -0
  47. model-00040-of-00099.safetensors +3 -0
  48. model-00041-of-00099.safetensors +3 -0
  49. model-00042-of-00099.safetensors +3 -0
  50. model-00043-of-00099.safetensors +3 -0
.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
+ assets/benchmark-appendix.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/benchmark.png filter=lfs diff=lfs merge=lfs -text
38
+ model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Tencent is pleased to support the open source community by making Tencent Hy3 available.
2
+
3
+ Copyright (C) 2026 Tencent. All rights reserved.
4
+
5
+ Tencent Hy3 is licensed under the Apache-2.0.
6
+
7
+
8
+ Terms of the Apache-2.0:
9
+ --------------------------------------------------------------------
10
+ Apache License
11
+ Version 2.0, January 2004
12
+ http://www.apache.org/licenses/
13
+
14
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
15
+
16
+ 1. Definitions.
17
+
18
+ "License" shall mean the terms and conditions for use, reproduction,
19
+ and distribution as defined by Sections 1 through 9 of this document.
20
+
21
+ "Licensor" shall mean the copyright owner or entity authorized by
22
+ the copyright owner that is granting the License.
23
+
24
+ "Legal Entity" shall mean the union of the acting entity and all
25
+ other entities that control, are controlled by, or are under common
26
+ control with that entity. For the purposes of this definition,
27
+ "control" means (i) the power, direct or indirect, to cause the
28
+ direction or management of such entity, whether by contract or
29
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
30
+ outstanding shares, or (iii) beneficial ownership of such entity.
31
+
32
+ "You" (or "Your") shall mean an individual or Legal Entity
33
+ exercising permissions granted by this License.
34
+
35
+ "Source" form shall mean the preferred form for making modifications,
36
+ including but not limited to software source code, documentation
37
+ source, and configuration files.
38
+
39
+ "Object" form shall mean any form resulting from mechanical
40
+ transformation or translation of a Source form, including but
41
+ not limited to compiled object code, generated documentation,
42
+ and conversions to other media types.
43
+
44
+ "Work" shall mean the work of authorship, whether in Source or
45
+ Object form, made available under the License, as indicated by a
46
+ copyright notice that is included in or attached to the work
47
+ (an example is provided in the Appendix below).
48
+
49
+ "Derivative Works" shall mean any work, whether in Source or Object
50
+ form, that is based on (or derived from) the Work and for which the
51
+ editorial revisions, annotations, elaborations, or other modifications
52
+ represent, as a whole, an original work of authorship. For the purposes
53
+ of this License, Derivative Works shall not include works that remain
54
+ separable from, or merely link (or bind by name) to the interfaces of,
55
+ the Work and Derivative Works thereof.
56
+
57
+ "Contribution" shall mean any work of authorship, including
58
+ the original version of the Work and any modifications or additions
59
+ to that Work or Derivative Works thereof, that is intentionally
60
+ submitted to Licensor for inclusion in the Work by the copyright owner
61
+ or by an individual or Legal Entity authorized to submit on behalf of
62
+ the copyright owner. For the purposes of this definition, "submitted"
63
+ means any form of electronic, verbal, or written communication sent
64
+ to the Licensor or its representatives, including but not limited to
65
+ communication on electronic mailing lists, source code control systems,
66
+ and issue tracking systems that are managed by, or on behalf of, the
67
+ Licensor for the purpose of discussing and improving the Work, but
68
+ excluding communication that is conspicuously marked or otherwise
69
+ designated in writing by the copyright owner as "Not a Contribution."
70
+
71
+ "Contributor" shall mean Licensor and any individual or Legal Entity
72
+ on behalf of whom a Contribution has been received by Licensor and
73
+ subsequently incorporated within the Work.
74
+
75
+ 2. Grant of Copyright License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ copyright license to reproduce, prepare Derivative Works of,
79
+ publicly display, publicly perform, sublicense, and distribute the
80
+ Work and such Derivative Works in Source or Object form.
81
+
82
+ 3. Grant of Patent License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ (except as stated in this section) patent license to make, have made,
86
+ use, offer to sell, sell, import, and otherwise transfer the Work,
87
+ where such license applies only to those patent claims licensable
88
+ by such Contributor that are necessarily infringed by their
89
+ Contribution(s) alone or by combination of their Contribution(s)
90
+ with the Work to which such Contribution(s) was submitted. If You
91
+ institute patent litigation against any entity (including a
92
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
93
+ or a Contribution incorporated within the Work constitutes direct
94
+ or contributory patent infringement, then any patent licenses
95
+ granted to You under this License for that Work shall terminate
96
+ as of the date such litigation is filed.
97
+
98
+ 4. Redistribution. You may reproduce and distribute copies of the
99
+ Work or Derivative Works thereof in any medium, with or without
100
+ modifications, and in Source or Object form, provided that You
101
+ meet the following conditions:
102
+
103
+ (a) You must give any other recipients of the Work or
104
+ Derivative Works a copy of this License; and
105
+
106
+ (b) You must cause any modified files to carry prominent notices
107
+ stating that You changed the files; and
108
+
109
+ (c) You must retain, in the Source form of any Derivative Works
110
+ that You distribute, all copyright, patent, trademark, and
111
+ attribution notices from the Source form of the Work,
112
+ excluding those notices that do not pertain to any part of
113
+ the Derivative Works; and
114
+
115
+ (d) If the Work includes a "NOTICE" text file as part of its
116
+ distribution, then any Derivative Works that You distribute must
117
+ include a readable copy of the attribution notices contained
118
+ within such NOTICE file, excluding those notices that do not
119
+ pertain to any part of the Derivative Works, in at least one
120
+ of the following places: within a NOTICE text file distributed
121
+ as part of the Derivative Works; within the Source form or
122
+ documentation, if provided along with the Derivative Works; or,
123
+ within a display generated by the Derivative Works, if and
124
+ wherever such third-party notices normally appear. The contents
125
+ of the NOTICE file are for informational purposes only and
126
+ do not modify the License. You may add Your own attribution
127
+ notices within Derivative Works that You distribute, alongside
128
+ or as an addendum to the NOTICE text from the Work, provided
129
+ that such additional attribution notices cannot be construed
130
+ as modifying the License.
131
+
132
+ You may add Your own copyright statement to Your modifications and
133
+ may provide additional or different license terms and conditions
134
+ for use, reproduction, or distribution of Your modifications, or
135
+ for any such Derivative Works as a whole, provided Your use,
136
+ reproduction, and distribution of the Work otherwise complies with
137
+ the conditions stated in this License.
138
+
139
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
140
+ any Contribution intentionally submitted for inclusion in the Work
141
+ by You to the Licensor shall be under the terms and conditions of
142
+ this License, without any additional terms or conditions.
143
+ Notwithstanding the above, nothing herein shall supersede or modify
144
+ the terms of any separate license agreement you may have executed
145
+ with Licensor regarding such Contributions.
146
+
147
+ 6. Trademarks. This License does not grant permission to use the trade
148
+ names, trademarks, service marks, or product names of the Licensor,
149
+ except as required for reasonable and customary use in describing the
150
+ origin of the Work and reproducing the content of the NOTICE file.
151
+
152
+ 7. Disclaimer of Warranty. Unless required by applicable law or
153
+ agreed to in writing, Licensor provides the Work (and each
154
+ Contributor provides its Contributions) on an "AS IS" BASIS,
155
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156
+ implied, including, without limitation, any warranties or conditions
157
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
158
+ PARTICULAR PURPOSE. You are solely responsible for determining the
159
+ appropriateness of using or redistributing the Work and assume any
160
+ risks associated with Your exercise of permissions under this License.
161
+
162
+ 8. Limitation of Liability. In no event and under no legal theory,
163
+ whether in tort (including negligence), contract, or otherwise,
164
+ unless required by applicable law (such as deliberate and grossly
165
+ negligent acts) or agreed to in writing, shall any Contributor be
166
+ liable to You for damages, including any direct, indirect, special,
167
+ incidental, or consequential damages of any character arising as a
168
+ result of this License or out of the use or inability to use the
169
+ Work (including but not limited to damages for loss of goodwill,
170
+ work stoppage, computer failure or malfunction, or any and all
171
+ other commercial damages or losses), even if such Contributor
172
+ has been advised of the possibility of such damages.
173
+
174
+ 9. Accepting Warranty or Additional Liability. While redistributing
175
+ the Work or Derivative Works thereof, You may choose to offer,
176
+ and charge a fee for, acceptance of support, warranty, indemnity,
177
+ or other liability obligations and/or rights consistent with this
178
+ License. However, in accepting such obligations, You may act only
179
+ on Your own behalf and on Your sole responsibility, not on behalf
180
+ of any other Contributor, and only if You agree to indemnify,
181
+ defend, and hold each Contributor harmless for any liability
182
+ incurred by, or claims asserted against, such Contributor by reason
183
+ of your accepting any such warranty or additional liability.
184
+
185
+ END OF TERMS AND CONDITIONS
186
+
187
+ APPENDIX: How to apply the Apache License to your work.
188
+
189
+ To apply the Apache License to your work, attach the following
190
+ boilerplate notice, with the fields enclosed by brackets "[]"
191
+ replaced with your own identifying information. (Don't include
192
+ the brackets!) The text should be enclosed in the appropriate
193
+ comment syntax for the file format. We also recommend that a
194
+ file or class name and description of purpose be included on the
195
+ same "printed page" as the copyright notice for easier
196
+ identification within third-party archives.
197
+
198
+ Copyright [yyyy] [name of copyright owner]
199
+
200
+ Licensed under the Apache License, Version 2.0 (the "License");
201
+ you may not use this file except in compliance with the License.
202
+ You may obtain a copy of the License at
203
+
204
+ http://www.apache.org/licenses/LICENSE-2.0
205
+
206
+ Unless required by applicable law or agreed to in writing, software
207
+ distributed under the License is distributed on an "AS IS" BASIS,
208
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
+ See the License for the specific language governing permissions and
210
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: tencent/Hy3
4
+ base_model_relation: quantized
5
+ pipeline_tag: text-generation
6
+ library_name: vllm
7
+ tags:
8
+ - hunyuan
9
+ - hy_v3
10
+ - mixture-of-experts
11
+ - moe
12
+ - 4-bit
13
+ - int4
14
+ - w4a16
15
+ - compressed-tensors
16
+ - quantized
17
+ - vllm
18
+ - long-context
19
+ - yarn
20
+ ---
21
+
22
+ # Hy3-W4A16 — 4-bit (INT4) quantization of tencent/Hy3
23
+
24
+ A **4-bit weight-only (W4A16)** quantization of **[tencent/Hy3](https://huggingface.co/tencent/Hy3)**
25
+ (`HYV3ForCausalLM`, `hy_v3`) — a 295B-parameter / 21B-active Mixture-of-Experts model.
26
+ Packaged in the **`compressed-tensors`** `pack-quantized` format so it loads directly in **vLLM**.
27
+
28
+ ## Why this model
29
+
30
+ - **Small.** **~146 GB** vs **~557 GB** for the original BF16 (~3.8× smaller). The whole
31
+ 295B MoE now **fits on a single ≥180 GB GPU** (e.g. one B200 192 GB / B300 ~288 GB)
32
+ with KV-cache headroom — no tensor-parallel sharding required just to load it.
33
+ (Note: it does **not** fit a 141 GB H200 without offload/TP.)
34
+ - **vLLM-native.** Loads out of the box with vLLM (recent build with `hy_v3` support) using the
35
+ Marlin INT4 MoE + Linear kernels. Fast tensor-core prefill.
36
+ - **Long context via YaRN.** With YaRN RoPE scaling the context extends from the native
37
+ **262,144** up to **1,048,576 (1M)** tokens (configurable). Dense needle-in-a-haystack
38
+ retrieval is **verified past native (318K, PASS)** on a single GPU; see *Long context* below.
39
+
40
+ ## Quantization details
41
+
42
+ | | |
43
+ |---|---|
44
+ | Scheme | **W4A16** — 4-bit **int**, **symmetric**, **group_size=128**, RTN (round-to-nearest, data-free) |
45
+ | Format | `compressed-tensors` **`pack-quantized`** (`quant_method: compressed-tensors`) |
46
+ | Quantized | attention `q/k/v/o_proj`, dense-layer FFN, **all 192 routed experts** + shared expert (`gate/up/down_proj`) |
47
+ | Kept in original precision | `lm_head`, router gate (`mlp.router.gate`), `eh_proj` (MTP), all norms, `embed_tokens` |
48
+ | Base dtype | bf16 (scales stored bf16) |
49
+
50
+ Produced by a direct tensor-by-tensor RTN packer (no calibration dataset). RTN keeps the
51
+ pipeline simple and lossless-format-correct; for maximum quality at 4-bit, a calibrated
52
+ GPTQ/AWQ pass would be marginally better.
53
+
54
+ ## Running with vLLM
55
+
56
+ Requires a vLLM build new enough to include the `hy_v3` architecture (vLLM `main`/nightly at time of
57
+ writing). Example on a single GPU:
58
+
59
+ ```bash
60
+ vllm serve /path/to/Hy3-W4A16 \
61
+ --max-model-len 262144 \
62
+ --gpu-memory-utilization 0.9 \
63
+ --trust-remote-code
64
+ ```
65
+
66
+ **NVIDIA Blackwell (sm_100/sm_103, e.g. B200/B300) note:** at the time of testing, FlashInfer's
67
+ runtime JIT could not compile for `compute_103a` with the bundled CUDA toolkit, which crashed the
68
+ default sampler/attention. Work around it with the Triton attention backend + native sampler:
69
+
70
+ ```bash
71
+ VLLM_USE_FLASHINFER_SAMPLER=0 vllm serve /path/to/Hy3-W4A16 \
72
+ --attention-backend TRITON_ATTN \
73
+ --kv-cache-dtype fp8 \
74
+ --max-model-len 262144 \
75
+ --gpu-memory-utilization 0.9 \
76
+ --trust-remote-code --enforce-eager
77
+ ```
78
+
79
+ `--kv-cache-dtype fp8` halves KV memory (recommended for long context). On Hopper/Ada or with a
80
+ FlashInfer build that supports your GPU, you can drop the two workaround flags.
81
+
82
+ ## Long context (YaRN)
83
+
84
+ The base model is `rope_type: "default"` with `max_position_embeddings: 262144`. To go beyond,
85
+ enable YaRN in `config.json`:
86
+
87
+ ```json
88
+ "rope_parameters": {
89
+ "rope_theta": 11158840.0,
90
+ "rope_type": "yarn",
91
+ "factor": 4.0,
92
+ "original_max_position_embeddings": 262144
93
+ }
94
+ ```
95
+
96
+ and raise `--max-model-len` (up to `262144 * factor = 1048576`).
97
+
98
+ > **This shipped `config.json` already has YaRN factor 4 enabled** (context up to 1,048,576).
99
+ > Set `rope_type` back to `"default"` if you want the native-only 262,144 behavior.
100
+
101
+ Memory on a single ~275 GB GPU (146 GB weights):
102
+ - **fp8 KV** (`--kv-cache-dtype fp8`): comfortably fits **~500K** dense tokens; fast tensor-core prefill.
103
+ - **int4 KV** (`--kv-cache-dtype int4_per_token_head`): fits **~1M** dense tokens, but its kernel is
104
+ compute-bound and much slower for long prefill.
105
+ - Full **dense 1M** is best served with **multi-GPU** (tensor-parallel) for both memory and speed.
106
+
107
+ ## Verified results (single B300, this checkpoint)
108
+
109
+ | Test | Result |
110
+ |---|---|
111
+ | **HumanEval pass@1 (greedy)** | ✅ **150/164 = 91.5%** — coding ability well-preserved at 4-bit |
112
+ | Chat sanity (`11+22+33` → 66; capital of France → Paris; first 5 primes) | ✅ correct — quality preserved at 4-bit |
113
+ | Needle-in-a-haystack 4K / 16K / 64K / 137K (in-range) | ✅ all PASS |
114
+ | **Needle-in-a-haystack 318K dense (YaRN ×4, fp8 KV)** | ✅ **PASS** — retrieval works past the native 262,144 |
115
+ | 1M-*distance* retrieval (sparse position probe, YaRN ×4) | ✅ retrieves where raw RoPE fails |
116
+
117
+ <details>
118
+ <summary><b>How HumanEval was measured</b> (for reproducibility)</summary>
119
+
120
+ - **Engine/config:** this W4A16 checkpoint served by vLLM on a single B300, **as shipped**
121
+ (YaRN factor 4 enabled), `--attention-backend TRITON_ATTN --kv-cache-dtype fp8
122
+ --enforce-eager`, `VLLM_USE_FLASHINFER_SAMPLER=0`.
123
+ - **Data:** the 164 problems from `openai_humaneval` (`human-eval` package).
124
+ - **Decoding:** **greedy** (`temperature=0`), `max_tokens=768`, **pass@1** (single sample per problem).
125
+ - **Prompting:** chat template with the instruction *"Complete the following Python function.
126
+ Return the COMPLETE function in a single ```python code block. No tests, no explanations."*
127
+ The first ```python block is extracted; if it lacks the `entry_point` def, the original stub
128
+ is prepended.
129
+ - **Scoring:** each candidate is run as `candidate + test + check(entry_point)` in a subprocess
130
+ (15s timeout); exit-code 0 = pass.
131
+ - **Result:** **150/164 = 91.5%**. Note this uses a chat+extraction harness (not the canonical
132
+ raw-completion protocol), so a few of the 14 misses may be extraction artifacts — treat 91.5%
133
+ as a conservative figure.
134
+
135
+ </details>
136
+
137
+ ## Caveats & honesty
138
+
139
+ - **4-bit RTN is lossy.** Chat/reasoning quality is well-preserved in our checks, but expect small
140
+ degradation vs the BF16 original, especially on exact-match/coding tasks.
141
+ - **`>262144` is extrapolation.** The base model was trained to 262,144; YaRN is applied at inference.
142
+ Dense retrieval is verified to **318K**; full dense-1M quality across depths is **not** exhaustively
143
+ validated here — evaluate for your use case.
144
+ - This is a **community derivative**, not affiliated with or endorsed by Tencent.
145
+
146
+ ## License
147
+
148
+ Apache-2.0, inheriting the license of the base model
149
+ [`tencent/Hy3`](https://huggingface.co/tencent/Hy3) (see `LICENSE`).
README_CN.md ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="left">
2
+ <a href="https://huggingface.co/tencent/Hy3">English</a>&nbsp;|&nbsp;中文
3
+ </p>
4
+ <br>
5
+
6
+ <p align="center">
7
+ <img src="assets/logo-zh.png" width="400"/> <br>
8
+ </p>
9
+
10
+ <div align="center" style="line-height: 1;">
11
+
12
+
13
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue)](#许可证)
14
+ &nbsp;&nbsp;
15
+ [![HuggingFace](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Tencent%20Hy-ffc107?color=ffc107&logoColor=white)](https://huggingface.co/tencent/Hy3)
16
+ &nbsp;&nbsp;
17
+ [![ModelScope](https://img.shields.io/badge/ModelScope-Tencent%20Hy-624aff)](https://modelscope.cn/models/Tencent-Hunyuan/Hy3)
18
+ &nbsp;&nbsp;
19
+ [![cnb.cool](https://img.shields.io/badge/cnb.cool-Tencent%20Hy-blue?logoColor=white)](https://cnb.cool/ai-models/tencent/Hy3)
20
+ &nbsp;&nbsp;
21
+ [![GitCode](https://img.shields.io/badge/GitCode-Tencent%20Hy-red?logoColor=white)](https://ai.gitcode.com/tencent_hunyuan/Hy3)
22
+
23
+ </div>
24
+
25
+ <p align="center">
26
+ 🖥️&nbsp;<a href="https://aistudio.tencent.com/"><b>官方网站</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;
27
+ 💬&nbsp;<a href="https://github.com/Tencent-Hunyuan/Hy3"><b>GitHub</b></a></p>
28
+
29
+ ---
30
+
31
+ ## 目录
32
+
33
+ - [模型介绍](#模型介绍)
34
+ - [更强大的智能体能力](#更强大的智能体能力)
35
+ - [更可靠的产品体验](#更可靠的产品体验)
36
+ - [Benchmark 附录](#benchmark-附录)
37
+ - [新闻](#新闻)
38
+ - [模型链接](#模型链接)
39
+ - [快速开始](#快速开始)
40
+ - [推理和部署](#推理和部署)
41
+ - [vLLM](#使用-vllm-推理)
42
+ - [SGLang](#使用-sglang-推理)
43
+ - [模型微调](#模型微调)
44
+ - [量化工具](#量化工具)
45
+ - [许可证](#许可证)
46
+ - [联系我们](#联系我们)
47
+
48
+ ---
49
+
50
+ ## 模型介绍
51
+
52
+ **Hy3** 是由腾讯混元团队研发的快慢思考融合的混合专家模型,总参数量 295B,激活参数 21B,MTP 层参数 3.8B。4 月底发布 Hy3 Preview 后,我们在 50 多个业务中获得了广泛的反馈,修复了各种体验问题,进一步提升了后训练的质量和规模。今天,我们正式发布 Hy3。它展现出显著强于同尺寸模型的智能水平,并比肩更大尺寸旗舰模型的效果,大幅提升了在各类产品和生产力任务中的实用价值。
53
+
54
+
55
+ | 属性 | 值 |
56
+ |:---|:---|
57
+ | 架构 | 混合专家(MoE) |
58
+ | 总参数量 | 295B |
59
+ | 激活参数量 | 21B |
60
+ | MTP层参数量 | 3.8B |
61
+ | 层数(不含MTP层) | 80 |
62
+ | MTP层数 | 1 |
63
+ | 注意力头 | 64(GQA,8 个 KV 头,head dim 128) |
64
+ | 隐藏层维度 | 4096 |
65
+ | FFN 中间层维度 | 13312 |
66
+ | 上下文长度 | 256K |
67
+ | 词表大小 | 120832 |
68
+ | 专家数量 | 192 个专家,top-8 激活 |
69
+ | 支持精度 | BF16 |
70
+
71
+ ## 更强大的智能体能力
72
+
73
+ Hy3 基于 Preview 进一步提升了后训练数据的质量和多样性,扩大了 RL 算力规模,在推理、智能体、长上下文等任务上显著进步,取得了比肩国内外更大尺寸旗舰模型(参数规模往往是 Hy3 的 2~5 倍)的效果。
74
+
75
+ <p align="center">
76
+ <img src="assets/benchmark.png" width="100%"/>
77
+ </p>
78
+
79
+ Hy3 在软件开发、办公生产、金融建模、前端设计、游戏制作等生产力任务上的进步尤其显著,可以成为高性价比的可靠选择。在内部组织的 270 位专家基于真实工作的模型盲测中,Hy3(均分 2.67 / 4)展现出优于 GLM5.1(均分 2.51 / 4)的表现,尤其在前端、数据与存储、CI/CD 等类别优势显著。
80
+
81
+ ## 更可靠的产品体验
82
+
83
+ 模型的实用体验不完全与榜单成绩挂钩。基于广泛的用户反馈和分析,我们定位并优化了一系列体验向能力,获得了产品侧一致且积极的评价。
84
+
85
+ **输出格式和工具调用稳定性**:我们显著改善了一系列基础底线问题,确保模型在各种工具设置和输出要求下达到生产级标准,工具调用的错误恢复能力和效率大幅提升。另外,Hy3 还增强了跨脚手架泛化性,不同脚手架(如 CodeBuddy、Cline、KiloCode)在 SWE Bench Verified 上的分数标准差控制在 4 个百分点以内。
86
+
87
+ **知识常识和抗幻觉能力**:基于“有依据才回答、无依据明示缺失,多来源信息不乱拼,数据和状态不乱编”的理想态,我们进行了细粒度的数据清洗和训练约束。在基于真实产品的内部评测中,Hy3 的幻觉率从 12.5% 降至 5.4%,常识错误率从 25.4% 降至 12.7%,显著改善了“张冠李戴”、无中生有、逻辑矛盾等问题。
88
+
89
+ **复杂上下文承接与多轮意图保持能力**:Hy3 在 SFT 与 RL 阶段联合优化了指代消解、省略还原及多轮约束继承等业务痛点问题,内部评测的多轮问题率从 17.4% 降至 7.9%。同时 Hy3 在长对话理解基准中取得显著跨越(如 MRCR 从 42.9% 升至 75.1%),输出更精炼的同时确保复杂意图在长程交互中不衰减、不跑偏。
90
+
91
+ ## Benchmark 附录
92
+
93
+ <p align="center">
94
+ <img src="assets/benchmark-appendix.png" width="100%"/>
95
+ </p>
96
+
97
+ ## 新闻
98
+
99
+ * 🔥 我们在 [Hugging Face](https://huggingface.co/tencent/Hy3)、[ModelScope](https://modelscope.cn/models/Tencent-Hunyuan/Hy3)、[GitCode](https://ai.gitcode.com/tencent_hunyuan/Hy3) 和 [CNB](https://cnb.cool/ai-models/tencent/Hy3) 开源了 **Hy3** 和 **Hy3-FP8** 模型权重。
100
+
101
+ ## 模型链接
102
+
103
+
104
+ | 模型名 | 简介 | Hugging Face | ModelScope | GitCode | CNB |
105
+ |:---|:---|:---:|:---:|:---:|:---:|
106
+ | Hy3 | Instruct 模型 | 🤗 [Model](https://huggingface.co/tencent/Hy3) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3) | [Model](https://cnb.cool/ai-models/tencent/Hy3) |
107
+ | Hy3-FP8 | FP8 量化 Instruct 模型 | 🤗 [Model](https://huggingface.co/tencent/Hy3-FP8) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy3-FP8) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy3-FP8) | [Model](https://cnb.cool/ai-models/tencent/Hy3-FP8) |
108
+
109
+ ## 快速开始
110
+
111
+ 建议先通过 [vLLM](#使用-vllm-推理) 或 [SGLang](#使用-sglang-推理) 部署服务,然后通过 OpenAI 兼容 API 调用:
112
+
113
+ ```python
114
+ from openai import OpenAI
115
+
116
+ client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
117
+
118
+ response = client.chat.completions.create(
119
+ model="hy3",
120
+ messages=[
121
+ {"role": "user", "content": "你好!请简单介绍一下你自己。"},
122
+ ],
123
+ temperature=0.9,
124
+ top_p=1.0,
125
+ # reasoning_effort: "no_think"(默认,直接回复)、"low"、"high"(深度思维链)
126
+ extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
127
+ )
128
+ print(response.choices[0].message.content)
129
+ ```
130
+
131
+ > **推荐参数**:`temperature=0.9`,`top_p=1.0`。
132
+ >
133
+ > **推理模式**:复杂任务(数学、编程、推理)建议设置 `reasoning_effort="high"`,日常对话可使用默认的 `"no_think"` 直接回复。
134
+
135
+ 具体部署方式请参考下方[推理和部署](#推理和部署)章节。
136
+
137
+ ## 推理和部署
138
+
139
+ Hy3 总参数量为 295B,当使用 8 张 GPU 时,建议使用 H20-3e 或其他有更大显存的卡型。
140
+
141
+ 对于生产环境部署,我们建议使用 vLLM 或 SGLang,这两个框架都为 Hy3 提供了专门的配置方案:
142
+
143
+ - [vLLM](https://github.com/vllm-project/vllm) - 请查阅 [vLLM recipes](https://recipes.vllm.ai/tencent/Hy3)
144
+
145
+ - [SGLang](https://docs.sglang.io/) - 请查阅 [SGLang cookbook](https://lmsysorg.mintlify.app/cookbook/autoregressive/Tencent/Hy3)
146
+
147
+ ### vLLM
148
+
149
+ 从源码构建 vLLM:
150
+
151
+ ```bash
152
+ uv venv --python 3.12 --seed --managed-python
153
+ source .venv/bin/activate
154
+ git clone https://github.com/vllm-project/vllm.git
155
+ cd vllm
156
+ uv pip install --editable . --torch-backend=auto
157
+ ```
158
+
159
+ 启动 vLLM 服务,开启 MTP:
160
+
161
+ ```bash
162
+ # Switch to trtllm backend to work-around mnnvl workspace size issue.
163
+ export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
164
+
165
+ vllm serve tencent/Hy3 \
166
+ --tensor-parallel-size 8 \
167
+ --speculative-config.method mtp \
168
+ --speculative-config.num_speculative_tokens 2 \
169
+ --tool-call-parser hy_v3 \
170
+ --reasoning-parser hy_v3 \
171
+ --enable-auto-tool-choice \
172
+ --port 8000 \
173
+ --served-model-name hy3
174
+ ```
175
+
176
+ ### SGLang
177
+
178
+ 从源码构建 SGLang:
179
+
180
+ ```bash
181
+ git clone https://github.com/sgl-project/sglang
182
+ cd sglang
183
+ pip3 install pip --upgrade
184
+ pip3 install "transformers>=5.6.0"
185
+ pip3 install -e "python"
186
+ ```
187
+
188
+ 启动 SGLang 服务,开启 MTP:
189
+
190
+ ```bash
191
+ python3 -m sglang.launch_server \
192
+ --model tencent/Hy3 \
193
+ --tp-size 8 \
194
+ --tool-call-parser hunyuan \
195
+ --reasoning-parser hunyuan \
196
+ --speculative-num-steps 2 \
197
+ --speculative-eagle-topk 1 \
198
+ --speculative-num-draft-tokens 3 \
199
+ --speculative-algorithm EAGLE \
200
+ --port 8000 \
201
+ --served-model-name hy3
202
+ ```
203
+
204
+ ## 模型微调
205
+
206
+ Hy3 提供了完整的模型微调流程,详细的微调文档请参考:[模型微调指南](https://huggingface.co/tencent/Hy3/blob/main/finetune/README_CN.md)
207
+
208
+ ## 量化工具
209
+
210
+ 我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim)——一套易用、全面、高效的大模型压缩工具包,涵盖常用量化算法、低比特量化和投机采样等能力。
211
+
212
+ ## 许可证
213
+
214
+
215
+ Hy3 基于 **Apache 2.0 许可证** 发布。详情请参阅 [LICENSE](https://huggingface.co/tencent/Hy3/blob/main/LICENSE)。
216
+
217
+ ## 联系我们
218
+
219
+ 如有问题或建议,欢迎通过邮件联系我们:
220
+
221
+ 📧 **hunyuan_opensource@tencent.com**
222
+
223
+ ---
224
+
225
+ <p align="center">
226
+ <i>Hy3 由腾讯混元团队研发。</i>
227
+ </p>
chat_template.jinja ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- ----------‑‑‑ special token variables ‑‑‑---------- -#}
2
+ {%- set HYTK = ':opensource' %}
3
+ {%- set eos_token = '<|hy_eos{}|>'.format(HYTK) %}
4
+ {%- set bos_token = '<|hy_begin_of_sentence{}|>'.format(HYTK) %}
5
+ {%- set pad_token = '<|hy_pad{}|>'.format(HYTK) %}
6
+ {%- set user_token = '<|hy_User{}|>'.format(HYTK) %}
7
+ {%- set assistant_token = '<|hy_Assistant{}|>'.format(HYTK) %}
8
+ {%- set think_begin_token = '<think{}>'.format(HYTK) %}
9
+ {%- set think_end_token = '</think{}>'.format(HYTK) %}
10
+ {%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}
11
+ {%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}
12
+ {%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}
13
+ {%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}
14
+ {%- set toolsep_token = '<tool_sep{}>'.format(HYTK) %}
15
+ {%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}
16
+ {%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}
17
+ {%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}
18
+ {%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}
19
+ {%- set toolresponses_begin_token = '<tool_responses{}>'.format(HYTK) %}
20
+ {%- set toolresponses_end_token = '</tool_responses{}>'.format(HYTK) %}
21
+ {%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}
22
+ {%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}
23
+ {%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}
24
+
25
+ {#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}
26
+ {%- if not add_generation_prompt is defined %}
27
+ {%- set add_generation_prompt = false %}
28
+ {%- endif %}
29
+ {%- if not preserved_thinking is defined %}
30
+ {%- if not tools %}
31
+ {%- set preserved_thinking = false %}
32
+ {%- else %}
33
+ {%- set preserved_thinking = true %}
34
+ {%- endif %}
35
+ {%- endif %}
36
+ {%- if not is_training is defined %}
37
+ {%- set is_training = false %}
38
+ {%- endif %}
39
+
40
+ {%- if not reasoning_effort is defined %}
41
+ {%- set reasoning_effort = 'no_think' %}
42
+ {%- elif reasoning_effort not in ['high', 'low', 'no_think'] %}
43
+ {%- if reasoning_effort is none %}
44
+ {{- raise_exception('reasoning_effort error : None, should be no_think/low/high') }}
45
+ {%- else %}
46
+ {{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/low/high') }}
47
+ {%- endif %}
48
+ {%- endif %}
49
+
50
+ {%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}
51
+ {%- set reasoning_effort = 'high' %}
52
+ {%- set add_generation_prompt = false %}
53
+ {%- endif %}
54
+ {%- if not raw_last_assistant is defined %}
55
+ {%- set raw_last_assistant = false %}
56
+ {%- endif %}
57
+
58
+ {%- macro visible_text(content) -%}
59
+ {%- if content is string -%}
60
+ {{- content }}
61
+ {%- elif content is iterable and content is not mapping -%}
62
+ {%- for item in content -%}
63
+ {%- if item is mapping and item.type == 'text' -%}
64
+ {{- item.text }}
65
+ {%- elif item is string -%}
66
+ {{- item }}
67
+ {%- endif -%}
68
+ {%- endfor -%}
69
+ {%- elif content is none -%}
70
+ {{- '' }}
71
+ {%- else -%}
72
+ {{- content }}
73
+ {%- endif -%}
74
+ {%- endmacro -%}
75
+
76
+ {%- set ns = namespace(last_user_index=-1) %}
77
+ {%- set sp_ns = namespace(system_prompt='', is_first_sp=true) %}
78
+ {%- for message in messages %}
79
+ {%- if message['role'] == 'system' %}
80
+ {%- set sp_ns.system_prompt = sp_ns.system_prompt + visible_text(message['content']) %}
81
+ {%- endif %}
82
+ {%- if message['role'] == 'user' %}
83
+ {%- set ns.last_user_index = loop.index0 %}
84
+ {%- endif %}
85
+ {%- endfor %}
86
+ {%- if reasoning_effort is defined and reasoning_effort is string and reasoning_effort != '' and not tools %}
87
+ {%- set sp_ns.system_prompt = sp_ns.system_prompt + reasoning_mode_token + 'reasoning_effort:' + reasoning_effort %}
88
+ {%- endif %}
89
+ {{- bos_token }}
90
+ {{- sp_ns.system_prompt }}
91
+ {%- if tools %}
92
+ {%- if sp_ns.system_prompt != '' %}
93
+ {{- '\n\n# Tools\n\nYou may call one or more functions to assist with the user query.' }}
94
+ {%- else %}
95
+ {{- '# Tools\n\nYou may call one or more functions to assist with the user query.' }}
96
+ {%- endif %}
97
+ {{- '\n\nYou are provided with function signatures within <tools></tools> XML tags:' }}
98
+ {{- '\n<tools>\n' }}
99
+ {%- for tool in tools %}
100
+ {%- if loop.index0 > 0 %}
101
+ {{- '\n' }}
102
+ {%- endif %}
103
+ {{- tool | tojson }}
104
+ {%- endfor %}
105
+ {{- '\n</tools>\n\n' }}
106
+ {{- 'For function call returns, you should first print ' + toolcalls_begin_token + '\n' }}
107
+ {{- 'For each function call, you should return object like:\n' }}
108
+ {{- toolcall_begin_token + '{function-name}' + toolsep_token + '\n' }}
109
+ {{- argkey_begin_token + '{arg-key-1}' + argkey_end_token + '\n' }}
110
+ {{- argvalue_begin_token + '{arg-value-1}' + argvalue_end_token + '\n' }}
111
+ {{- argkey_begin_token + '{arg-key-2}' + argkey_end_token + '\n' }}
112
+ {{- argvalue_begin_token + '{arg-value-2}' + argvalue_end_token + '\n' }}
113
+ {{- '...\n' }}
114
+ {{- toolcall_end_token + '\n' }}
115
+ {%- if reasoning_effort is defined and reasoning_effort is string and reasoning_effort != '' %}
116
+ {{- 'At the end of function call returns, you should print ' + toolcalls_end_token + reasoning_mode_token + 'reasoning_effort:' + reasoning_effort }}
117
+ {%- else %}
118
+ {{- 'At the end of function call returns, you should print ' + toolcalls_end_token }}
119
+ {%- endif %}
120
+ {%- endif %}
121
+
122
+ {%- set prev_ns = namespace(is_tool=false, is_tool_first=true) %}
123
+ {%- set last_ns = namespace(last_is_assistant=false) %}
124
+ {%- for message in messages %}
125
+ {%- if message['role'] == 'user' %}
126
+ {%- if prev_ns.is_tool %}
127
+ {{- toolresponses_end_token }}
128
+ {%- endif %}
129
+ {{- user_token + visible_text(message['content']) }}
130
+ {%- set prev_ns.is_tool = false %}
131
+ {%- endif %}
132
+ {%- if message['role'] == 'assistant' %}
133
+ {%- if is_training %}
134
+ {%- if 'reasoning_content' in message and message['reasoning_content'] is string %}
135
+ {%- set rc = message['reasoning_content'] %}
136
+ {%- elif 'reasoning' in message and message['reasoning'] is string %}
137
+ {%- set rc = message['reasoning'] %}
138
+ {%- else %}
139
+ {%- set rc = none %}
140
+ {%- endif %}
141
+ {%- if rc is not none %}
142
+ {%- set content = think_begin_token + rc + think_end_token + visible_text(message['content']) %}
143
+ {%- else %}
144
+ {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
145
+ {%- endif %}
146
+ {%- else %}
147
+ {%- if ((preserved_thinking is defined and preserved_thinking) or loop.index0 > ns.last_user_index) %}
148
+ {%- if 'reasoning_content' in message and message['reasoning_content'] is string %}
149
+ {%- set rc = message['reasoning_content'] %}
150
+ {%- elif 'reasoning' in message and message['reasoning'] is string %}
151
+ {%- set rc = message['reasoning'] %}
152
+ {%- else %}
153
+ {%- set rc = none %}
154
+ {%- endif %}
155
+ {%- if rc is not none %}
156
+ {%- set content = think_begin_token + rc + think_end_token + visible_text(message['content']) %}
157
+ {%- else %}
158
+ {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
159
+ {%- endif %}
160
+ {%- else %}
161
+ {%- set content = think_begin_token + think_end_token + visible_text(message['content']) %}
162
+ {%- endif %}
163
+ {%- endif %}
164
+ {%- if prev_ns.is_tool %}
165
+ {{- toolresponses_end_token }}
166
+ {%- endif %}
167
+ {{- assistant_token }}
168
+ {%- if message['tool_calls'] is defined and message['tool_calls'] %}
169
+ {%- set prev_ns.is_tool_first = true %}
170
+ {{- content }}
171
+ {{- toolcalls_begin_token + '\n' }}
172
+ {%- for tool in message['tool_calls'] %}
173
+ {%- set arguments = tool['function']['arguments'] %}
174
+ {{- toolcall_begin_token + tool['function']['name'] + toolsep_token + '\n' }}
175
+ {%- for key, value in arguments.items() %}
176
+ {{- argkey_begin_token + key + argkey_end_token + '\n' }}
177
+ {%- if value is not string %}
178
+ {%- set value = value | tojson(ensure_ascii=False) %}
179
+ {%- endif %}
180
+ {{- argvalue_begin_token + value + argvalue_end_token + '\n' }}
181
+ {%- endfor %}
182
+ {{- toolcall_end_token + '\n' }}
183
+ {%- endfor %}
184
+ {{- toolcalls_end_token + eos_token }}
185
+ {%- else %}
186
+ {%- if loop.last and raw_last_assistant %}
187
+ {{- visible_text(message['content']) }}
188
+ {%- elif not loop.last or is_training %}
189
+ {{- content + eos_token }}
190
+ {%- else %}
191
+ {{- content }}
192
+ {%- endif %}
193
+ {%- endif %}
194
+ {%- set prev_ns.is_tool = false %}
195
+ {%- endif %}
196
+ {%- if message['role'] == 'tool' %}
197
+ {%- set prev_ns.is_tool = true %}
198
+ {%- if prev_ns.is_tool_first %}
199
+ {{- toolresponses_begin_token + '\n' }}
200
+ {%- set prev_ns.is_tool_first = false %}
201
+ {%- endif %}
202
+ {{- toolresponse_begin_token + '\n' + visible_text(message['content']) + '\n' + toolresponse_end_token + '\n' }}
203
+ {%- endif %}
204
+ {%- if loop.last and message['role'] == 'assistant' %}
205
+ {%- set last_ns.last_is_assistant = true %}
206
+ {%- endif %}
207
+
208
+ {%- endfor %}
209
+ {%- if prev_ns.is_tool %}
210
+ {{- toolresponses_end_token }}
211
+ {%- endif %}
212
+ {%- if add_generation_prompt %}
213
+ {%- if not last_ns.last_is_assistant %}
214
+ {%- if reasoning_effort is defined and reasoning_effort in ['low', 'high'] %}
215
+ {{- assistant_token + think_begin_token }}
216
+ {%- elif reasoning_effort is defined and reasoning_effort == 'no_think' %}
217
+ {{- assistant_token + think_begin_token + think_end_token }}
218
+ {%- else %}
219
+ {{- assistant_token }}
220
+ {%- endif %}
221
+ {%- endif %}
222
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HYV3ForCausalLM"
4
+ ],
5
+ "bos_token_id": 120000,
6
+ "enable_attention_fp32_softmax": false,
7
+ "enable_lm_head_fp32": true,
8
+ "enable_moe_fp32_combine": false,
9
+ "eod_token_id": 120026,
10
+ "eos_token_id": 120025,
11
+ "expert_hidden_dim": 1536,
12
+ "moe_intermediate_size": 1536,
13
+ "first_k_dense_replace": 1,
14
+ "head_dim": 128,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 4096,
17
+ "initializer_range": 0.006,
18
+ "intermediate_size": 13312,
19
+ "max_position_embeddings": 262144,
20
+ "model_type": "hy_v3",
21
+ "moe_router_enable_expert_bias": true,
22
+ "moe_router_use_sigmoid": true,
23
+ "num_attention_heads": 64,
24
+ "num_experts": 192,
25
+ "num_experts_per_tok": 8,
26
+ "num_hidden_layers": 80,
27
+ "num_key_value_heads": 8,
28
+ "num_shared_experts": 1,
29
+ "output_router_logits": true,
30
+ "pad_token_id": 120002,
31
+ "qk_norm": true,
32
+ "rms_norm_eps": 1e-05,
33
+ "rope_parameters": {
34
+ "rope_theta": 11158840.0,
35
+ "rope_type": "yarn",
36
+ "factor": 4.0,
37
+ "original_max_position_embeddings": 262144
38
+ },
39
+ "route_norm": true,
40
+ "router_scaling_factor": 2.826,
41
+ "sep_token_id": 120007,
42
+ "tie_word_embeddings": false,
43
+ "transformers_version": "5.6.0",
44
+ "use_cache": true,
45
+ "use_grouped_mm": false,
46
+ "vocab_size": 120832,
47
+ "num_nextn_predict_layers": 1,
48
+ "quantization_config": {
49
+ "config_groups": {
50
+ "group_0": {
51
+ "targets": [
52
+ "Linear"
53
+ ],
54
+ "weights": {
55
+ "num_bits": 4,
56
+ "type": "int",
57
+ "symmetric": true,
58
+ "group_size": 128,
59
+ "strategy": "group",
60
+ "block_structure": null,
61
+ "dynamic": false,
62
+ "actorder": null,
63
+ "scale_dtype": null,
64
+ "zp_dtype": null,
65
+ "observer": "memoryless_minmax",
66
+ "observer_kwargs": {}
67
+ },
68
+ "input_activations": null,
69
+ "output_activations": null,
70
+ "format": null
71
+ }
72
+ },
73
+ "quant_method": "compressed-tensors",
74
+ "kv_cache_scheme": null,
75
+ "format": "pack-quantized",
76
+ "quantization_status": "compressed",
77
+ "global_compression_ratio": null,
78
+ "ignore": [
79
+ "lm_head",
80
+ "re:.*mlp.router.gate$",
81
+ "re:.*eh_proj$"
82
+ ]
83
+ }
84
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 120000,
3
+ "do_sample": true,
4
+ "eos_token_id": 120025,
5
+ "pad_token_id": 120002,
6
+ "temperature": 0.9,
7
+ "top_k": -1,
8
+ "top_p": 1,
9
+ "transformers_version": "5.6.0"
10
+ }
model-00001-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25b953e014d2530d1c4c623a84ad95ec50e129050cadff5b1b48ce016719cc9d
3
+ size 1868782976
model-00002-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4437bdf61377b075072aa22a0899f2489af436dbd26e638daf269ff4cb15049
3
+ size 1868784704
model-00003-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d5657e1e14d5153879b5bc6e53af1acc3faf18d8f7596404338dafd21d85094
3
+ size 1868784704
model-00004-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17dee3531fe754a9d23d298405d33d121ec0c947fe0cbf5d2ced540bdd8f58b9
3
+ size 1868784704
model-00005-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23a4a8896ca447fbadb2a7f1c6610f0d789fc0b428188e2efa151a50567a69e0
3
+ size 1868784704
model-00006-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21d834d587457d069cb3366fe31fa8be72a357ba4b521b242471ce5189f3b491
3
+ size 276834824
model-00007-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61f85274caa00e5738b7edd0c1e5400971b11eb69e5e69b3b05ffa32a53a6e9c
3
+ size 1868782976
model-00008-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3ec0cf56a7648aaa4599c8db23244b8aa82e8f86c2344c3abe987bcc13882d3
3
+ size 1868784704
model-00009-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dce9e5d567fdb7ffd47e7ceac16c70b440b949054189dae3c9464c1de4d429ce
3
+ size 1868784704
model-00010-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71e848262ce5226c4fd64ab54b1f3c2438c6c45c00665b21571135566cd2a09d
3
+ size 1868784704
model-00011-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59d75195b81daebc51149be9d481a6847f3ec87f3513bf293884fa17a97f86dd
3
+ size 1868784704
model-00012-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd673152b92ea6d5aa1c585a11598c41c069fcae451249dc2f930783c4dc2fe9
3
+ size 1011483816
model-00013-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:204630e41a89e5d0b2e010677fc5409965f998519afa6bef146754db3b29f269
3
+ size 1868782976
model-00014-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9477fbfdf8ebc6964a4490fa3e3a314312e56242f69a2f766d9a0fd64b01ceb8
3
+ size 1868784704
model-00015-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4461ff9e6bb4875ffca606fb67691b16eb5dee52d5e6e201d3e14ca79e70b65e
3
+ size 1868784704
model-00016-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f797a2b6a4941077565369e8b0d0751c39d4e279dab47bf3494c21af94e82f08
3
+ size 1868784704
model-00017-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e1eb21ae97925cca321fdabf6027f56bf0f894067a6f9af01242c611af5b20b
3
+ size 1868784704
model-00018-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7adb8c7bf2ab42e09e7b7b713e7df10b45d3f6574b6d10950b512c5d36d124d1
3
+ size 326646880
model-00019-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:863a5f186028601b4ba99d95e04be358898e5d3d4461360951dfd56d200b3bfa
3
+ size 1868782976
model-00020-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33091c1339a87ab51b932bc99adb74c5005e04fb70e55920c67a3c97ad39d410
3
+ size 1868784704
model-00021-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82862d38753de4658485ef072bf9bec94ffa20c466f55d5252f4976f0c527ae6
3
+ size 1868784704
model-00022-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b7e8b0c0ba3a05acbc6f0ee439a233f6951198fc1e0bdf592b53fc248bec238
3
+ size 1868784704
model-00023-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91554f0ec941793b55ba5e54a831128fc1b7b0499e132a43cacd1c8d36dc3e04
3
+ size 1868784704
model-00024-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97f0fbb52a51db3b7078f1056fe2416a301e1f67e7a4aab3276bc186e9677315
3
+ size 289231640
model-00025-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97bff74e1b89a415e5ece0cd0e133286701829446617f7e9ec062218b320ac85
3
+ size 1868782976
model-00026-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f732e285011ea988a3d66744aaf34e7d0facdb6525dadc1387a8fb9a0ab7c4f
3
+ size 1868784704
model-00027-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc41df1c055b3def28fde086183952da4cbe2b83a36088ae3f8043eced468cd2
3
+ size 1868784704
model-00028-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55164eab0415284da2221660a80f028d2022bb3cd0fd1b3dd753f59f421905f9
3
+ size 1868784704
model-00029-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10366a556bcf4de93b8a739789d2d71ab46a11555da879416287a5243fcfe775
3
+ size 1868784704
model-00030-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:882e8e0d12f750364134ed7dcd2bcb9832f1ca87cd02c982101b8341780c010d
3
+ size 299447800
model-00031-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7d1ac0df7ece91ad9e78d53115ba1b4942324ec5ab80c5bcb5e095b59bf91cb
3
+ size 1868782976
model-00032-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d00086611513797a7c3df161e08dc2596cd6cd98c106aa65f427e896f9d3db02
3
+ size 1868784704
model-00033-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2aa252b38df1c9c3fa46beb736a6071ae0415f5ca88bed4850de9e2ba79148e
3
+ size 1868784704
model-00034-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7285e58b319986581878cd428b0234bf70261d67a38cdc542ddc806be581e39c
3
+ size 1868784704
model-00035-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6ab31312714bbe23c616303d8f0ec29e88ab9e79a3aedbd4c956b94bb932c39
3
+ size 1868784704
model-00036-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73950d4631f8104ff034b8a309947b5662d925290e9c6f273908133486b35220
3
+ size 282236344
model-00037-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b53ec23fca6c4e8adc2924e07785aaa0d81ac6a1654ad10549310a2d6231503
3
+ size 1868782976
model-00038-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cebf07a3d251002805b87dec67069f8b1d5fac7d574bab594753207f014755d
3
+ size 1868784704
model-00039-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c418671c47a03c854b916acc00fca32b3438297b3656a15f13243f7bd4f5bacc
3
+ size 1868784704
model-00040-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6791784808dbbdda1db37603e3a4974092f1d129a9561bea5fe87b24e5d4711e
3
+ size 1868784704
model-00041-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c2caf032d7e8eb4aed56822020c31b463c2afec8bc998045c3992c2c8edcda0
3
+ size 1868784704
model-00042-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:895eea131344589305e982d822b7d36def6765c79853e8d27814ad57e6a2b30a
3
+ size 272508728
model-00043-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a61b44a4b23821f1e9afbac930b81d4288734c3e13364effa94b8d8786a94a84
3
+ size 1868782976