Add files using upload-large-folder tool
Browse files- .gitattributes +5 -0
- .gitignore +40 -0
- LICENSE +245 -0
- README.md +20 -0
- README_CN.md +385 -0
- abliteration_report.json +52 -0
- chat_template.jinja +355 -0
- config.json +494 -0
- generation_config.json +10 -0
- model-00014-of-00148.safetensors +3 -0
- model-00015-of-00148.safetensors +3 -0
- model-00016-of-00148.safetensors +3 -0
- model-00024-of-00148.safetensors +3 -0
- model-00028-of-00148.safetensors +3 -0
- model-00031-of-00148.safetensors +3 -0
- model-00041-of-00148.safetensors +3 -0
- model-00043-of-00148.safetensors +3 -0
- model-00050-of-00148.safetensors +3 -0
- model-00051-of-00148.safetensors +3 -0
- model-00055-of-00148.safetensors +3 -0
- model-00057-of-00148.safetensors +3 -0
- model-00061-of-00148.safetensors +3 -0
- model-00063-of-00148.safetensors +3 -0
- model-00064-of-00148.safetensors +3 -0
- model-00066-of-00148.safetensors +3 -0
- model-00081-of-00148.safetensors +3 -0
- model-00091-of-00148.safetensors +3 -0
- model-00094-of-00148.safetensors +3 -0
- model-00101-of-00148.safetensors +3 -0
- model-00103-of-00148.safetensors +3 -0
- model-00105-of-00148.safetensors +3 -0
- model-00106-of-00148.safetensors +3 -0
- model-00107-of-00148.safetensors +3 -0
- model-00110-of-00148.safetensors +3 -0
- model-00112-of-00148.safetensors +3 -0
- model-00114-of-00148.safetensors +3 -0
- model-00116-of-00148.safetensors +3 -0
- model-00129-of-00148.safetensors +3 -0
- model-00132-of-00148.safetensors +3 -0
- model-00135-of-00148.safetensors +3 -0
- model-00138-of-00148.safetensors +3 -0
- model-00143-of-00148.safetensors +3 -0
- model-00144-of-00148.safetensors +3 -0
- model-00145-of-00148.safetensors +3 -0
- model-00146-of-00148.safetensors +3 -0
- model-00147-of-00148.safetensors +3 -0
- model.safetensors.index.json +0 -0
- processor_config.json +75 -0
- tokenizer.json +0 -0
- tokenizer_config.json +28 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,8 @@ 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.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
assets/dfly2.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
assets/performance-cost-open-benchmarks.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
assets/performance-cost-workindex.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
pretrained-model-bpb.png filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
*.so
|
| 6 |
+
*.egg-info/
|
| 7 |
+
dist/
|
| 8 |
+
build/
|
| 9 |
+
*.egg
|
| 10 |
+
|
| 11 |
+
# Virtual environments
|
| 12 |
+
.venv/
|
| 13 |
+
venv/
|
| 14 |
+
env/
|
| 15 |
+
|
| 16 |
+
# IDE
|
| 17 |
+
.idea/
|
| 18 |
+
.vscode/
|
| 19 |
+
*.swp
|
| 20 |
+
*.swo
|
| 21 |
+
|
| 22 |
+
# OS
|
| 23 |
+
.DS_Store
|
| 24 |
+
Thumbs.db
|
| 25 |
+
|
| 26 |
+
# Training outputs
|
| 27 |
+
output/
|
| 28 |
+
saves/
|
| 29 |
+
|
| 30 |
+
# Generated by the multi-node launch scripts
|
| 31 |
+
env.txt
|
| 32 |
+
hostfile
|
| 33 |
+
pssh.hosts
|
| 34 |
+
|
| 35 |
+
# Logs
|
| 36 |
+
*.log
|
| 37 |
+
logs/
|
| 38 |
+
|
| 39 |
+
# Cache
|
| 40 |
+
.cache/
|
LICENSE
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Tencent Hy License, Version 1.0
|
| 2 |
+
|
| 3 |
+
This License is derived from the Apache License, Version 2.0
|
| 4 |
+
(http://www.apache.org/licenses/LICENSE-2.0), with modifications, mainly
|
| 5 |
+
the additional commercial terms for large Model-as-a-Service ("MaaS")
|
| 6 |
+
businesses in Section 10. This License is not the Apache License,
|
| 7 |
+
Version 2.0, and is not endorsed by or affiliated with the Apache
|
| 8 |
+
Software Foundation.
|
| 9 |
+
|
| 10 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 11 |
+
|
| 12 |
+
1. Definitions.
|
| 13 |
+
|
| 14 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 15 |
+
and distribution as defined by Sections 1 through 10 of this document.
|
| 16 |
+
|
| 17 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 18 |
+
the copyright owner that is granting the License.
|
| 19 |
+
|
| 20 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 21 |
+
other entities that control, are controlled by, or are under common
|
| 22 |
+
control with that entity. For the purposes of this definition,
|
| 23 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 24 |
+
direction or management of such entity, whether by contract or
|
| 25 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 26 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 27 |
+
|
| 28 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 29 |
+
exercising permissions granted by this License.
|
| 30 |
+
|
| 31 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 32 |
+
including but not limited to software source code, documentation
|
| 33 |
+
source, and configuration files.
|
| 34 |
+
|
| 35 |
+
"Object" form shall mean any form resulting from mechanical
|
| 36 |
+
transformation or translation of a Source form, including but
|
| 37 |
+
not limited to compiled object code, generated documentation,
|
| 38 |
+
and conversions to other media types.
|
| 39 |
+
|
| 40 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 41 |
+
Object form, made available under the License, as indicated by a
|
| 42 |
+
copyright notice that is included in or attached to the work
|
| 43 |
+
(an example is provided in the Appendix below). For the avoidance
|
| 44 |
+
of doubt, the Work includes the model weights, parameters,
|
| 45 |
+
configuration files, inference and training code, and documentation
|
| 46 |
+
made available by Licensor under this License.
|
| 47 |
+
|
| 48 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 49 |
+
form, that is based on (or derived from) the Work and for which the
|
| 50 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 51 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 52 |
+
of this License, Derivative Works shall not include works that remain
|
| 53 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 54 |
+
the Work and Derivative Works thereof. For the avoidance of doubt,
|
| 55 |
+
Derivative Works include any fine-tuned, quantized, distilled, merged,
|
| 56 |
+
pruned, or otherwise modified versions of the model weights.
|
| 57 |
+
|
| 58 |
+
"Contribution" shall mean any work of authorship, including
|
| 59 |
+
the original version of the Work and any modifications or additions
|
| 60 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 61 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 62 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 63 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 64 |
+
means any form of electronic, verbal, or written communication sent
|
| 65 |
+
to the Licensor or its representatives, including but not limited to
|
| 66 |
+
communication on electronic mailing lists, source code control systems,
|
| 67 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 68 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 69 |
+
excluding communication that is conspicuously marked or otherwise
|
| 70 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 71 |
+
|
| 72 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 73 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 74 |
+
subsequently incorporated within the Work.
|
| 75 |
+
|
| 76 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 77 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 78 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 79 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 80 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 81 |
+
Work and such Derivative Works in Source or Object form.
|
| 82 |
+
|
| 83 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 84 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 85 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 86 |
+
(except as stated in this section) patent license to make, have made,
|
| 87 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 88 |
+
where such license applies only to those patent claims licensable
|
| 89 |
+
by such Contributor that are necessarily infringed by their
|
| 90 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 91 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 92 |
+
institute patent litigation against any entity (including a
|
| 93 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 94 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 95 |
+
or contributory patent infringement, then any patent licenses
|
| 96 |
+
granted to You under this License for that Work shall terminate
|
| 97 |
+
as of the date such litigation is filed.
|
| 98 |
+
|
| 99 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 100 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 101 |
+
modifications, and in Source or Object form, provided that You
|
| 102 |
+
meet the following conditions:
|
| 103 |
+
|
| 104 |
+
(a) You must give any other recipients of the Work or
|
| 105 |
+
Derivative Works a copy of this License; and
|
| 106 |
+
|
| 107 |
+
(b) You must cause any modified files to carry prominent notices
|
| 108 |
+
stating that You changed the files; and
|
| 109 |
+
|
| 110 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 111 |
+
that You distribute, all copyright, patent, trademark, and
|
| 112 |
+
attribution notices from the Source form of the Work,
|
| 113 |
+
excluding those notices that do not pertain to any part of
|
| 114 |
+
the Derivative Works; and
|
| 115 |
+
|
| 116 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 117 |
+
distribution, then any Derivative Works that You distribute must
|
| 118 |
+
include a readable copy of the attribution notices contained
|
| 119 |
+
within such NOTICE file, excluding those notices that do not
|
| 120 |
+
pertain to any part of the Derivative Works, in at least one
|
| 121 |
+
of the following places: within a NOTICE text file distributed
|
| 122 |
+
as part of the Derivative Works; within the Source form or
|
| 123 |
+
documentation, if provided along with the Derivative Works; or,
|
| 124 |
+
within a display generated by the Derivative Works, if and
|
| 125 |
+
wherever such third-party notices normally appear. The contents
|
| 126 |
+
of the NOTICE file are for informational purposes only and
|
| 127 |
+
do not modify the License. You may add Your own attribution
|
| 128 |
+
notices within Derivative Works that You distribute, alongside
|
| 129 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 130 |
+
that such additional attribution notices cannot be construed
|
| 131 |
+
as modifying the License.
|
| 132 |
+
|
| 133 |
+
You may add Your own copyright statement to Your modifications and
|
| 134 |
+
may provide additional or different license terms and conditions
|
| 135 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 136 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 137 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 138 |
+
the conditions stated in this License. Notwithstanding the
|
| 139 |
+
foregoing, any license terms You provide for the Work or any
|
| 140 |
+
Derivative Works must not remove, limit, or conflict with Section 10,
|
| 141 |
+
and Section 10 shall continue to apply to every recipient of the
|
| 142 |
+
Work or any Derivative Works.
|
| 143 |
+
|
| 144 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 145 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 146 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 147 |
+
this License, without any additional terms or conditions.
|
| 148 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 149 |
+
the terms of any separate license agreement you may have executed
|
| 150 |
+
with Licensor regarding such Contributions.
|
| 151 |
+
|
| 152 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 153 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 154 |
+
except as required for reasonable and customary use in describing the
|
| 155 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 156 |
+
|
| 157 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 158 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 159 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 160 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 161 |
+
implied, including, without limitation, any warranties or conditions
|
| 162 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 163 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 164 |
+
appropriateness of using or redistributing the Work and assume any
|
| 165 |
+
risks associated with Your exercise of permissions under this License.
|
| 166 |
+
|
| 167 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 168 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 169 |
+
unless required by applicable law (such as deliberate and grossly
|
| 170 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 171 |
+
liable to You for damages, including any direct, indirect, special,
|
| 172 |
+
incidental, or consequential damages of any character arising as a
|
| 173 |
+
result of this License or out of the use or inability to use the
|
| 174 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 175 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 176 |
+
other commercial damages or losses), even if such Contributor
|
| 177 |
+
has been advised of the possibility of such damages.
|
| 178 |
+
|
| 179 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 180 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 181 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 182 |
+
or other liability obligations and/or rights consistent with this
|
| 183 |
+
License. However, in accepting such obligations, You may act only
|
| 184 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 185 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 186 |
+
defend, and hold each Contributor harmless for any liability
|
| 187 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 188 |
+
of your accepting any such warranty or additional liability.
|
| 189 |
+
|
| 190 |
+
10. Additional Commercial Terms.
|
| 191 |
+
|
| 192 |
+
10.1 MaaS. "MaaS" means giving third parties remote access to model
|
| 193 |
+
inference or fine-tuning (e.g., via API), allowing them to
|
| 194 |
+
submit inputs or specify parameters or training data. This
|
| 195 |
+
excludes (i) end-user products with model capabilities confined
|
| 196 |
+
to specific features or workflows, without general-purpose
|
| 197 |
+
model access, or (ii) merely relaying requests to an
|
| 198 |
+
independently operated third-party model service.
|
| 199 |
+
|
| 200 |
+
10.2 Separate License Required. Notwithstanding Sections 2 and 3,
|
| 201 |
+
and except as provided in Section 10.3, if You operate a MaaS
|
| 202 |
+
business, You must obtain a separate written license to use the
|
| 203 |
+
Work or any Derivative Works from Licensor (including by email),
|
| 204 |
+
in either of the following cases:
|
| 205 |
+
|
| 206 |
+
(a) if Your aggregate worldwide gross revenue exceeds
|
| 207 |
+
US$50 million (or the equivalent in other currencies) in
|
| 208 |
+
any consecutive 12-month period, whether or not such
|
| 209 |
+
revenue is derived from the Work or any Derivative Works,
|
| 210 |
+
before using (or continuing to use) the Work or any
|
| 211 |
+
Derivative Works; or
|
| 212 |
+
|
| 213 |
+
(b) before using the Work or any Derivative Works in or for any
|
| 214 |
+
product or service provided by You that has more than
|
| 215 |
+
100 million monthly active users in any calendar month.
|
| 216 |
+
|
| 217 |
+
10.3 Internal Use. Section 10.2 does not apply to Your use of the
|
| 218 |
+
Work or any Derivative Works solely for internal purposes,
|
| 219 |
+
provided that neither the Work, any Derivative Works, nor their
|
| 220 |
+
outputs are made available to third parties.
|
| 221 |
+
|
| 222 |
+
10.4 Contact. For licensing requests or questions, please contact
|
| 223 |
+
hy_partners@tencent.com.
|
| 224 |
+
|
| 225 |
+
END OF TERMS AND CONDITIONS
|
| 226 |
+
|
| 227 |
+
APPENDIX: How to apply the Tencent Hy License to your work.
|
| 228 |
+
|
| 229 |
+
To apply this License to a Derivative Work, attach the following
|
| 230 |
+
notice, with the fields enclosed by brackets "[]" replaced with your
|
| 231 |
+
own identifying information. (Don't include the brackets!)
|
| 232 |
+
|
| 233 |
+
Copyright [yyyy] [name of copyright owner]
|
| 234 |
+
|
| 235 |
+
Licensed under the Tencent Hy License, Version 1.0 (the "License"),
|
| 236 |
+
which is based on the Apache License, Version 2.0, with additional
|
| 237 |
+
commercial terms. You may not use this file except in compliance
|
| 238 |
+
with the License. You may obtain a copy of the License in the
|
| 239 |
+
LICENSE file distributed with this work.
|
| 240 |
+
|
| 241 |
+
Unless required by applicable law or agreed to in writing, software
|
| 242 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 243 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 244 |
+
implied. See the License for the specific language governing
|
| 245 |
+
permissions and limitations under the License.
|
README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: tencent/Hy4-flash
|
| 3 |
+
tags:
|
| 4 |
+
- hy4-flash
|
| 5 |
+
- bf16
|
| 6 |
+
- abliterated
|
| 7 |
+
- bruh-runtime
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Hy4-flash (Pure BF16 — Definitively Abliterated)
|
| 11 |
+
|
| 12 |
+
Permanent weight-level orthogonalization applied to **tencent/Hy4-flash** (pure BF16, 410.3 GiB) across layers `1..41` (`alpha=1.25`, `norm_preserving=True`, `sandwich_norm_compensated=True`):
|
| 13 |
+
|
| 14 |
+
- `self_attn.o_proj` (BF16): `41`
|
| 15 |
+
- `mlp.routed_expert_up_proj` (BF16 bottleneck of all 512 routed experts): `41`
|
| 16 |
+
- `mlp.shared_experts.down_proj` (BF16): `41`
|
| 17 |
+
- `engram_layer.value_proj` (BF16): `4`
|
| 18 |
+
- `embed_tokens` (BF16): `1`
|
| 19 |
+
|
| 20 |
+
Also available in lossless NVFP4 (150 GiB): [`MidasRev/Hy4-flash-NVFP4-abliterated`](https://huggingface.co/MidasRev/Hy4-flash-NVFP4-abliterated).
|
README_CN.md
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="left">
|
| 2 |
+
<a href="https://huggingface.co/tencent/Hy4-flash">English</a> | 中文
|
| 3 |
+
</p>
|
| 4 |
+
<br>
|
| 5 |
+
|
| 6 |
+
<p align="center">
|
| 7 |
+
<img src="assets/logo-zh.png" alt="腾讯混元" width="400"/>
|
| 8 |
+
</p>
|
| 9 |
+
|
| 10 |
+
<div align="center" style="line-height: 1;">
|
| 11 |
+
|
| 12 |
+
[](#许可证)
|
| 13 |
+
|
| 14 |
+
[](https://huggingface.co/tencent/Hy4-flash)
|
| 15 |
+
|
| 16 |
+
[](https://modelscope.cn/models/Tencent-Hunyuan/Hy4-flash)
|
| 17 |
+
|
| 18 |
+
[](https://ai.gitcode.com/tencent_hunyuan/Hy4-flash)
|
| 19 |
+
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<p align="center">
|
| 23 |
+
<a href="https://hy.tencent.com/research/hy4-flash?langVersion=zh"><b>官方网站</b></a> |
|
| 24 |
+
<a href="https://github.com/Tencent-Hunyuan/Hy4-flash"><b>GitHub</b></a> |
|
| 25 |
+
<a href="https://huggingface.co/AngelSlim/Hy4-flash-GGUF"><b>GGUF</b></a>
|
| 26 |
+
</p>
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## 目录
|
| 31 |
+
|
| 32 |
+
- [模型介绍](#模型介绍)
|
| 33 |
+
- [预训练模型能力](#预训练模型能力)
|
| 34 |
+
- [实用性与成本效率](#实用性与成本效率)
|
| 35 |
+
- [优化思路](#优化思路)
|
| 36 |
+
- [任务效果与成本](#任务效果与成本)
|
| 37 |
+
- [用户盲测](#用户盲测)
|
| 38 |
+
- [Benchmark 附录](#benchmark-附录)
|
| 39 |
+
- [新闻](#新闻)
|
| 40 |
+
- [模型链接](#模型链接)
|
| 41 |
+
- [快速开始](#快速开始)
|
| 42 |
+
- [Transformers](#transformers)
|
| 43 |
+
- [OpenAI 兼容 API](#openai-兼容-api)
|
| 44 |
+
- [推理和部署](#推理和部署)
|
| 45 |
+
- [DFly2 投机解码](#dfly2-投机解码)
|
| 46 |
+
- [量化工具](#量化工具)
|
| 47 |
+
- [推理框架](#推理框架)
|
| 48 |
+
- [vLLM](#vllm)
|
| 49 |
+
- [SGLang](#sglang)
|
| 50 |
+
- [模型微调](#模型微调)
|
| 51 |
+
- [许可证](#许可证)
|
| 52 |
+
- [联系我们](#联系我们)
|
| 53 |
+
|
| 54 |
+
## 模型介绍
|
| 55 |
+
|
| 56 |
+
**Hy4 flash** 是混元系列迄今性价比最高的多模态模型,原生支持文本和图像输入,可生成文本,上下文长度可达 1M token。模型总参数量约为 2200 亿,其中 Engram 约占 640 亿。处理每个 token 时,只需激活约 120 亿个参数。
|
| 57 |
+
|
| 58 |
+
语言模型主干由 1 层稠密前馈网络和 41 层混合专家网络(MoE)组成,共 42 层。各层通过 identity Hyper-Connections(iHC)传递残差信息。视觉编码器由 SigLIP2-So400m-Patch16-Res512 训练而来,提取的图像特征经 MLP 投影后送入语言模型主干。主干之外还内置了 5 层草稿模型 [DFly2](#dfly2-投机解码)(约 8.5 亿参数),直接复用主模型的 KV cache 与稀疏索引,以固定的低开销支持长上下文投机解码。
|
| 59 |
+
|
| 60 |
+
相较于 Hy4,Hy4 flash 在架构上有三处主要变化。
|
| 61 |
+
|
| 62 |
+
1. **混合注意力(Hybrid attention)** 用滑动窗口注意力(SWA)捕捉相邻 token 之间的联系,用 IndexPool 稀疏注意力从更长的上下文中选取相关片段。稀疏注意力与 SWA 以 1:3 的模式交替组合。
|
| 63 |
+
2. **LatentMoE** 将 token 的表示从 3072 维投影到 1536 维,让路由专家在更低维的空间里完成计算。每个 MoE 层会为当前 token 从 512 个路由专家中选出 16 个,另有 1 个共享专家参与每个 token 的计算。
|
| 64 |
+
3. **Engram(N-gram embedding)** 为模型引入了按需查表的记忆机制。模型根据最近两个或三个 token 的组合,通过多头哈希取出训练中学到的片段表示,并将其融入当前 token 的隐藏状态。
|
| 65 |
+
|
| 66 |
+
| 规格项 | 取值 |
|
| 67 |
+
| --- | --- |
|
| 68 |
+
| **模型概览** | |
|
| 69 |
+
| Architecture | Mixture-of-Experts (MoE) |
|
| 70 |
+
| Total Parameters (excluding Engram, ViT, and DFly2) | 155.5B |
|
| 71 |
+
| Engram Parameters | 63.5B |
|
| 72 |
+
| ViT Parameters | 0.43B |
|
| 73 |
+
| DFly2 Parameters | 0.85B |
|
| 74 |
+
| Activated Parameters per Token | Text 11.3B + Vision 0.43B |
|
| 75 |
+
| Context Length | 1M (1,048,576 tokens) |
|
| 76 |
+
| **语言模型主干** | |
|
| 77 |
+
| Backbone Layers | 42 — 1 dense layer and 41 MoE layers |
|
| 78 |
+
| Hidden Size | 3,072 |
|
| 79 |
+
| Vocabulary Size | 120,832 |
|
| 80 |
+
| Residual Connections | iHC (identity Hyper-Connections) with 4 residual streams |
|
| 81 |
+
| **混合注意力布局** | |
|
| 82 |
+
| Attention Architecture | Sparse attention + sliding-window attention (SWA) |
|
| 83 |
+
| Backbone Layer Pattern | 2 × Sparse → 10 × (3 × SWA → Sparse) |
|
| 84 |
+
| Attention Formulation | Multi-head Latent Attention (MLA) |
|
| 85 |
+
| Multimodal Position Encoding | Interleaved MRoPE |
|
| 86 |
+
| **注意力层配置** | **稀疏注意力 / 滑动窗口注意力** |
|
| 87 |
+
| Backbone Layers | 12 / 30 |
|
| 88 |
+
| Attention Heads | 32 / 64 |
|
| 89 |
+
| MLA q_lora_rank | 1,024 / 1,024 |
|
| 90 |
+
| MLA kv_lora_rank | 512 / 512 |
|
| 91 |
+
| QK Head Dimension (non-RoPE + RoPE) | 192 + 64 / 192 + 64 |
|
| 92 |
+
| Value Head Dimension | 256 / 256 |
|
| 93 |
+
| RoPE Base | 10,000,000 / 10,000 |
|
| 94 |
+
| Sparse Context Selection | Up to 2,048 tokens via group-level selection |
|
| 95 |
+
| SWA Context Window | 512-token causal window (511 preceding + current) |
|
| 96 |
+
| **前馈网络** | |
|
| 97 |
+
| Dense FFN Intermediate Size | 13,824 |
|
| 98 |
+
| Routed Experts per MoE Layer | 512 |
|
| 99 |
+
| Shared Experts per MoE Layer | 1 |
|
| 100 |
+
| Activated Routed Experts per Token | 16 |
|
| 101 |
+
| MoE Latent Dimension | 1,536 |
|
| 102 |
+
| Expert Intermediate Size | 1,536 |
|
| 103 |
+
| **N-gram 嵌入(Engram)** | |
|
| 104 |
+
| N-gram Orders | Bigrams and trigrams |
|
| 105 |
+
| Backbone Layer Indices (starting from 0) | 1, 11, 21, 31 |
|
| 106 |
+
| Hash Heads per N-gram Order | 8 |
|
| 107 |
+
| Hash Vocabulary Size per Head | 10.3M |
|
| 108 |
+
| Embedding Dimension per N-gram Order | 768 (8 heads × 96 dimensions) |
|
| 109 |
+
| Embedding Table Parameters | 63.4B |
|
| 110 |
+
| **视觉编码器** | |
|
| 111 |
+
| Vision Encoder Layers | 27 |
|
| 112 |
+
| Vision Encoder Hidden Size | 1,152 |
|
| 113 |
+
| Vision Encoder Intermediate Size | 4,304 |
|
| 114 |
+
| Vision Encoder Attention Heads | 16 |
|
| 115 |
+
| Vision Patch Size | 16 × 16 |
|
| 116 |
+
| Vision Position Embedding Size | 128 × 128 |
|
| 117 |
+
| Visual Feature Merging | 2 x 2 |
|
| 118 |
+
|
| 119 |
+
## 预训练模型能力
|
| 120 |
+
|
| 121 |
+
内部代码与 Agent 验证集上的 BPB(Bits-per-byte,每字节比特数),数值越低越好:
|
| 122 |
+
|
| 123 |
+
<p align="center">
|
| 124 |
+
<a href="pretrained-model-bpb.png"><img src="pretrained-model-bpb.png" alt="内部代码与 Agent 验证集上的 BPB 与激活参数量对比,BPB 越低越好" width="75%"/></a>
|
| 125 |
+
</p>
|
| 126 |
+
|
| 127 |
+
预训练模型的 few-shot 基准评测结果:
|
| 128 |
+
|
| 129 |
+
| 类别 | 评测基准 | #Shots | Hy4 flash Base | Hy4 Base | Hy3 preview Base | DeepSeek-V4-flash-Base | DeepSeek-V4-Pro-Base |
|
| 130 |
+
| --- | --- | :---: | ---: | ---: | ---: | ---: | ---: |
|
| 131 |
+
| **知识** | MMLU† | 5 | 88.7 | **91.6** | 87.5 | 89.7 | 91.1 |
|
| 132 |
+
| | MMLU-Pro† | 5 | 71.1 | **73.9** | 65.8 | 68.6 | 73.4 |
|
| 133 |
+
| | MMLU-Redux† | 5 | 87.6 | **90.6** | 87.0 | 88.8 | 90.2 |
|
| 134 |
+
| | SuperGPQA† | 5 | 57.8 | **62.7** | 52.3 | 52.5 | 54.8 |
|
| 135 |
+
| | C-Eval† | 5 | 92.0 | **95.0** | 90.1 | 91.9 | 93.4 |
|
| 136 |
+
| | CMMLU† | 5 | 91.6 | **93.1** | 89.6 | 89.8 | 90.7 |
|
| 137 |
+
| | SimpleQA | 5 | 37.5 | **57.2** | 26.4 | 31.3 | 52.1 |
|
| 138 |
+
| | Chinese-SimpleQA† | 5 | 74.6 | **83.9** | 69.6 | 71.9 | 76.6 |
|
| 139 |
+
| | AGIEval (English)† | 3 | 75.4 | **79.3** | 76.0 | 76.3 | 78.2 |
|
| 140 |
+
| | AGIEval (Chinese)† | 3 | 90.6 | **91.2** | 87.8 | 88.5 | 89.8 |
|
| 141 |
+
| **推理** | HellaSwag (3,000-item subset) | 10 | 85.2 | **87.1** | 85.7 | 85.1 | 86.8 |
|
| 142 |
+
| | PIQA | 4 | 84.4 | **85.3** | 84.6 | 83.8 | 84.9 |
|
| 143 |
+
| | ARC-Challenge | 0 | 95.0 | **97.3** | 96.0 | **97.3** | 97.0 |
|
| 144 |
+
| | Social IQa | 0 | 80.1 | **82.7** | 80.5 | 72.5 | 73.1 |
|
| 145 |
+
| | KOR-Bench | 3 | 54.7 | **57.6** | 54.6 | 53.4 | 55.4 |
|
| 146 |
+
| | C³ | 0 | 77.3 | **82.4** | 75.9 | 74.1 | 78.3 |
|
| 147 |
+
| **数学** | U-MATH | 5 | 69.8 | **71.6** | 60.9 | 57.4 | 64.8 |
|
| 148 |
+
| | OCW Courses | 5 | 64.0 | 66.7 | 62.6 | 63.3 | **68.2** |
|
| 149 |
+
| **代码** | MBPP-plus | 3 | 73.7 | 74.0 | 77.4 | 76.8 | **79.1** |
|
| 150 |
+
| **多语言** | Belebele (5-language subset)† | 5 | 93.8 | 95.0 | 94.2 | 94.4 | **95.2** |
|
| 151 |
+
| | INCLUDE† | 5 | 82.8 | **88.1** | 84.3 | 84.0 | 84.3 |
|
| 152 |
+
| **多模态** | MMMU-Pro (Standard, 10 opts) | 4 | 52.0 | **59.6** | — | — | — |
|
| 153 |
+
| | SimpleVQA | 4 | 48.5 | **54.5** | — | — | — |
|
| 154 |
+
| | CVBench | 4 | 83.4 | **86.7** | — | — | — |
|
| 155 |
+
| | RealWorldQA | 4 | 71.1 | **72.3** | — | — | — |
|
| 156 |
+
| | TextVQA | 4 | 73.4 | **78.2** | — | — | — |
|
| 157 |
+
| | CountBenchQA | 4 | 86.6 | **90.6** | — | — | — |
|
| 158 |
+
|
| 159 |
+
† 标注的文本评测采用宏平均准确率,其余文本评测采用本评测框架报告的准确率。每行最高分以粗体标示;加粗不代表差异具有统计显著性。
|
| 160 |
+
|
| 161 |
+
多模态结果仅列出 Hy4 flash Base 和 Hy4 Base。
|
| 162 |
+
|
| 163 |
+
ARC-Challenge 和 HellaSwag 分别使用包含 299 道和 3,000 道题目的子集。INCLUDE 使用覆盖 44 种语言、包含 5,000 个样本的 Lite 子集。Belebele 覆盖德语、韩语、越南语、西班牙语和俄语,共 4,475 个样本。
|
| 164 |
+
|
| 165 |
+
**免责声明:我们的基座模型在中期训练中使用了大量合成指令数据,因此在 few-shot 评测中偶尔无法遵循预期的答案格式,可能导致得分失真。**
|
| 166 |
+
|
| 167 |
+
## 实用性与成本效率
|
| 168 |
+
|
| 169 |
+
### 优化思路
|
| 170 |
+
|
| 171 |
+
我们通过一系列工作在极致优化成本的同时兼顾智能水平和实用性:
|
| 172 |
+
|
| 173 |
+
- 在预训练阶段,Hy4 flash 加入了混合注意力、LatentMoE、Engram 等架构特性,KV cache 大小仅为 Hy3 的 **1/24**、Hy4 的 **1/6**,且通过大量 scaling ladder 实验确保效果符合预期;
|
| 174 |
+
- 在后训练阶段,我们通过自蒸馏 Hy4 获得了较强的综合智能水平,再通过强化学习使端到端任务输出长度降低 **50%**;
|
| 175 |
+
- 在评估阶段,我们构建基于 WorkBuddy 典型任务的内部评测集 WorkIndex,并结合人评,聚焦日常工作的**产物效果、单轮输出长度、端到端用时**,而非远离日常工作的公开榜单分数;
|
| 176 |
+
- 在推理阶段,我们结合 megakernel、4bit 量化、[DFly2](#dfly2-投机解码) 等手段极致优化,使 Hy4 flash 解码速度超过 **150 tps**,且可以大规模低成本部署运营。
|
| 177 |
+
|
| 178 |
+
### 任务效果与成本
|
| 179 |
+
|
| 180 |
+
**Hy4 flash 的综合任务效果略优于 Hy4 preview,同时显著降低了完成任务的成本。** 在 WorkIndex 上,其得分为 **42.1**,高于 Hy4 preview 的 **39.7**;平均单任务成本仅为 **Hy4 preview 的 1/13、Hy4 的 1/20、DeepSeek-V4.1-Flash-1017 的 1/8**(DeepSeek 按 `max` 档位、忙时价格计算)。
|
| 181 |
+
|
| 182 |
+
<p align="center">
|
| 183 |
+
<a href="assets/performance-cost-workindex.png"><img src="assets/performance-cost-workindex.png" alt="Hy4 flash 与对比模型在 WorkIndex 上的得分和单任务成本" width="49%"/></a>
|
| 184 |
+
<a href="assets/performance-cost-open-benchmarks.png"><img src="assets/performance-cost-open-benchmarks.png" alt="Hy4 flash 与对比模型在公开评测上的得分和单任务成本" width="49%"/></a>
|
| 185 |
+
</p>
|
| 186 |
+
<p align="left"><sub>图 1:内外部任务上的效果与成本。WorkIndex (internal) 包含 8 个内部评测集:PPT 制作、PPT 修改、PPT 人机双写、Markdown 人机双写、文档编辑、表格修复、音视频处理和视觉理解。<br/>Open Benchmarks 包含 7 个公开 Agent 评测集:DeepSWE、ProgramBench、Terminal-Bench 4.0、APEX-Agents、AutomationBench、HLE 和 OSWorld 2.1。</sub></p>
|
| 187 |
+
|
| 188 |
+
<p align="center">
|
| 189 |
+
<a href="assets/workindex-cost.png"><img src="assets/workindex-cost.png" alt="Hy4 flash、Hy4 preview 和 Hy4 的 WorkIndex 平均单任务成本与得分" width="100%"/></a>
|
| 190 |
+
</p>
|
| 191 |
+
<p align="left"><sub>图 2:WorkIndex 平均单任务成本对比;Hy4 flash、Hy4 preview、Hy4 的任务得分分别为 42.1、39.7、51.4。</sub></p>
|
| 192 |
+
|
| 193 |
+
我们推荐在**深度搜索、文档处理、PPT 制作、简单前端展示和 computer use** 等大部分日常任务中使用 Hy4 flash;对于长程软件工程等复杂任务,仍推荐智能上限更高的 Hy4。
|
| 194 |
+
|
| 195 |
+
### 用户盲测
|
| 196 |
+
|
| 197 |
+
**在真实工作任务盲测中,Hy4 flash 的满意度接近 Claude Haiku 5.5,同时在参评模型中实现了最低的单任务成本和最短的任务耗时中位数。** Hy4 flash 的用户满意度为 **2.79/4**(Claude Haiku 5.5 为 **2.81/4**),端到端任务时长中位数为 **6.7 分钟**,单任务成本为 **0.26 元**。
|
| 198 |
+
|
| 199 |
+
<p align="center">
|
| 200 |
+
<a href="assets/blind-evaluation-zh.png"><img src="assets/blind-evaluation-zh.png" alt="用户盲测中的满意度、端到端任务时长中位数和单任务成本对比" width="100%"/></a>
|
| 201 |
+
</p>
|
| 202 |
+
<p align="left"><sub>图 3:85 位 WorkBuddy 内部用户在 27 类、259 个日常工作任务上的盲测结果。</sub></p>
|
| 203 |
+
|
| 204 |
+
## Benchmark 附录
|
| 205 |
+
|
| 206 |
+
<p align="center">
|
| 207 |
+
<a href="assets/benchmark.png"><img src="assets/benchmark.png" alt="Hy4 flash 与对比模型的完整评测得分、单任务成本和测试说明" width="100%"/></a>
|
| 208 |
+
</p>
|
| 209 |
+
|
| 210 |
+
## 新闻
|
| 211 |
+
|
| 212 |
+
* 我们在 [Hugging Face](https://huggingface.co/tencent/Hy4-flash)、[ModelScope](https://modelscope.cn/models/Tencent-Hunyuan/Hy4-flash) 和 [GitCode](https://ai.gitcode.com/tencent_hunyuan/Hy4-flash) 开源 **Hy4 flash**、**Hy4 flash-FP8** 和预训练模型 **Hy4 flash-base** 的权重。
|
| 213 |
+
|
| 214 |
+
## 模型链接
|
| 215 |
+
|
| 216 |
+
| 模型名 | 简介 | Hugging Face | ModelScope | GitCode |
|
| 217 |
+
|:---|:---|:---:|:---:|:---:|
|
| 218 |
+
| Hy4 flash | Instruct 模型 | [Model](https://huggingface.co/tencent/Hy4-flash) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy4-flash) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy4-flash) |
|
| 219 |
+
| Hy4 flash-FP8 | FP8 量化 Instruct 模型 | [Model](https://huggingface.co/tencent/Hy4-flash-FP8) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy4-flash-FP8) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy4-flash-FP8) |
|
| 220 |
+
| Hy4 flash-base | 预训练模型 | [Model](https://huggingface.co/tencent/Hy4-flash-base) | [Model](https://modelscope.cn/models/Tencent-Hunyuan/Hy4-flash-base) | [Model](https://ai.gitcode.com/tencent_hunyuan/Hy4-flash-base) |
|
| 221 |
+
|
| 222 |
+
Hy4 flash-base 为预训练底座,未经过指令微调;下方对话与推理模式示例适用于 Hy4 flash 和 Hy4 flash-FP8。
|
| 223 |
+
|
| 224 |
+
## 快速开始
|
| 225 |
+
|
| 226 |
+
可使用 [Transformers](#transformers) 直接加载模型进行本地推理,或部署服务后通过 [OpenAI 兼容 API](#openai-兼容-api) 调用。
|
| 227 |
+
|
| 228 |
+
> **推理模式(Instruct 模型)**:`reasoning_effort` 支持 `"high"`(默认,启用思考)和 `"no_think"`(直接回复)。以下两个示例均使用 `"no_think"`。
|
| 229 |
+
>
|
| 230 |
+
> **推荐采样参数**:`temperature=0.9`,`top_p=1.0`。
|
| 231 |
+
|
| 232 |
+
### Transformers
|
| 233 |
+
|
| 234 |
+
> Hy4 flash 的支持即将合入 `transformers` 主分支,在此之前请从下面的提交安装。
|
| 235 |
+
|
| 236 |
+
```bash
|
| 237 |
+
pip install "transformers[torch,vision] @ git+https://github.com/huggingface/transformers.git@refs/pull/50903/head"
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
下面以图片描述为例:
|
| 241 |
+
|
| 242 |
+
```python
|
| 243 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 244 |
+
|
| 245 |
+
model_id = "tencent/Hy4-flash"
|
| 246 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 247 |
+
model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto")
|
| 248 |
+
|
| 249 |
+
messages = [
|
| 250 |
+
{
|
| 251 |
+
"role": "user",
|
| 252 |
+
"content": [
|
| 253 |
+
{
|
| 254 |
+
"type": "image",
|
| 255 |
+
"url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg",
|
| 256 |
+
},
|
| 257 |
+
{"type": "text", "text": "Describe this image in one sentence."},
|
| 258 |
+
],
|
| 259 |
+
}
|
| 260 |
+
]
|
| 261 |
+
|
| 262 |
+
inputs = processor.apply_chat_template(
|
| 263 |
+
messages,
|
| 264 |
+
add_generation_prompt=True,
|
| 265 |
+
tokenize=True,
|
| 266 |
+
return_dict=True,
|
| 267 |
+
return_tensors="pt",
|
| 268 |
+
reasoning_effort="no_think",
|
| 269 |
+
).to(model.device)
|
| 270 |
+
|
| 271 |
+
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 272 |
+
print(processor.decode(outputs[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
### OpenAI 兼容 API
|
| 276 |
+
|
| 277 |
+
选择 API 调用时,先按 [vLLM 部署说明](#vllm) 启动服务,再运行以下客户端示例:
|
| 278 |
+
|
| 279 |
+
```python
|
| 280 |
+
from openai import OpenAI
|
| 281 |
+
|
| 282 |
+
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
|
| 283 |
+
|
| 284 |
+
response = client.chat.completions.create(
|
| 285 |
+
model="hy4-flash",
|
| 286 |
+
messages=[
|
| 287 |
+
{"role": "user", "content": "你好!请简单介绍一下你自己。"},
|
| 288 |
+
],
|
| 289 |
+
temperature=0.9,
|
| 290 |
+
top_p=1.0,
|
| 291 |
+
extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
|
| 292 |
+
)
|
| 293 |
+
print(response.choices[0].message.content)
|
| 294 |
+
```
|
| 295 |
+
|
| 296 |
+
## 推理和部署
|
| 297 |
+
|
| 298 |
+
### DFly2 投机解码
|
| 299 |
+
|
| 300 |
+
DFly2 是基于 [AngelSpec](https://github.com/Tencent/AngelSpec) 框架训练的 Hy4 flash 投机解码草稿模型,直接复用主模型的 **Top-k Sparse KV**:每个 draft 层与主模型对应的稀疏注意力层共享 KV cache(**KV Share**)及压缩索引器选出的最多 2,048 个位置(**Index Share**)。由此带来三点优势:
|
| 301 |
+
|
| 302 |
+
- **计算开销固定**:每个草稿 token 至多关注约 2K 个 key,注意力复杂度与上下文长度无关。
|
| 303 |
+
- **零额外 KV 显存**:无需维护草稿模型独立的 KV cache。
|
| 304 |
+
- **适配 PD 分离**:不参与 prefill,P→D 仅额外传输一个末层隐状态。
|
| 305 |
+
|
| 306 |
+
<p align="center">
|
| 307 |
+
<a href="assets/dfly2.png"><img src="assets/dfly2.png" alt="DFly2 结构图:每个 draft 层复用 Hy4 flash 对应稀疏注意力层的 KV cache 与压缩索引器选出的位置" width="75%"/></a>
|
| 308 |
+
</p>
|
| 309 |
+
|
| 310 |
+
### 量化工具
|
| 311 |
+
|
| 312 |
+
我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim)——一套易用、全面、高效的大模型压缩工具包,涵盖常用量化算法、低比特量化和投机采样等能力。
|
| 313 |
+
|
| 314 |
+
对于本模型我们提供了[GGUF](https://huggingface.co/AngelSlim/Hy4-flash-GGUF) 压缩版本以供端测使用。
|
| 315 |
+
|
| 316 |
+
### 推理框架
|
| 317 |
+
|
| 318 |
+
对于生产环境部署,我们建议使用 [vLLM](https://github.com/vllm-project/vllm) 或 [SGLang](https://docs.sglang.io/)。请参考部署方案:
|
| 319 |
+
- [Hy4 flash vLLM Recipe](https://recipes.vllm.ai/tencent/Hy4-flash)
|
| 320 |
+
- [Hy4 flash SGLang Cookbook](https://docs.sglang.io/cookbook/autoregressive/Tencent/Hy4-flash)
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
|
| 324 |
+
#### vLLM
|
| 325 |
+
|
| 326 |
+
使用社区官方镜像 `vllm/vllm-openai:hy4-flash` 部署:
|
| 327 |
+
|
| 328 |
+
```bash
|
| 329 |
+
docker run --gpus all \
|
| 330 |
+
-p 8000:8000 \
|
| 331 |
+
--ipc=host \
|
| 332 |
+
-v ~/.cache/huggingface:/root/.cache/huggingface \
|
| 333 |
+
vllm/vllm-openai:hy4-flash tencent/Hy4-flash-FP8 \
|
| 334 |
+
--tensor-parallel-size 8 \
|
| 335 |
+
--speculative-config '{"num_speculative_tokens":5,"method":"dfly"}' \
|
| 336 |
+
--attention-backend FLASHMLA_SPARSE \
|
| 337 |
+
--tool-call-parser hy_v4 \
|
| 338 |
+
--reasoning-parser hy_v4 \
|
| 339 |
+
--enable-auto-tool-choice \
|
| 340 |
+
--port 8000 \
|
| 341 |
+
--served-model-name hy4-flash
|
| 342 |
+
```
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
#### SGLang
|
| 346 |
+
|
| 347 |
+
使用社区官方镜像 `lmsysorg/sglang:hy4-flash` 部署,(支持 x86 和 Arm)。
|
| 348 |
+
|
| 349 |
+
```bash
|
| 350 |
+
docker pull lmsysorg/sglang:hy4-flash
|
| 351 |
+
|
| 352 |
+
docker run --gpus all \
|
| 353 |
+
-p 8000:8000 \
|
| 354 |
+
--ipc=host \
|
| 355 |
+
lmsysorg/sglang:hy4-flash \
|
| 356 |
+
sglang serve \
|
| 357 |
+
--trust-remote-code \
|
| 358 |
+
--model-path tencent/Hy4-flash-FP8 \
|
| 359 |
+
--tp 8 \
|
| 360 |
+
--cuda-graph-backend-prefill disabled \
|
| 361 |
+
--speculative-algorithm DFLY \
|
| 362 |
+
--speculative-dfly-block-size 6 \
|
| 363 |
+
--host 127.0.0.1 \
|
| 364 |
+
--port 8000
|
| 365 |
+
```
|
| 366 |
+
|
| 367 |
+
## 模型微调
|
| 368 |
+
|
| 369 |
+
Hy4 flash 提供了完整的模型微调流程,详细的微调文档请参考:[模型微调指南](https://huggingface.co/tencent/Hy4-flash/blob/main/finetune/README_CN.md)
|
| 370 |
+
|
| 371 |
+
## 许可证
|
| 372 |
+
|
| 373 |
+
Hy4 flash 基于 **Tencent Hy License** 发布。详情请参阅 [LICENSE](https://huggingface.co/tencent/Hy4-flash/blob/main/LICENSE)。
|
| 374 |
+
|
| 375 |
+
## 联系我们
|
| 376 |
+
|
| 377 |
+
如有问题或建议,欢迎通过邮件联系我们的研发和产品团队:
|
| 378 |
+
|
| 379 |
+
📧 **hunyuan_opensource@tencent.com**
|
| 380 |
+
|
| 381 |
+
---
|
| 382 |
+
|
| 383 |
+
<p align="center">
|
| 384 |
+
<i>Hy4 flash 由腾讯混元团队研发。</i>
|
| 385 |
+
</p>
|
abliteration_report.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_base": "Avifenesh/Hy4-flash-NVFP4",
|
| 3 |
+
"method": "BRUH-Definitive Sandwich-Compensated Norm-Preserving Abliteration (o_proj FP8 + routed_up + shared_down + engram + embed)",
|
| 4 |
+
"alpha": 1.25,
|
| 5 |
+
"start_layer": 1,
|
| 6 |
+
"end_layer": 41,
|
| 7 |
+
"preserve_norm": true,
|
| 8 |
+
"use_sandwich_comp": true,
|
| 9 |
+
"stats": {
|
| 10 |
+
"o_proj_fp8": 0,
|
| 11 |
+
"o_proj_bf16": 41,
|
| 12 |
+
"routed_up_bf16": 41,
|
| 13 |
+
"shared_down_bf16": 41,
|
| 14 |
+
"dense_down_bf16": 0,
|
| 15 |
+
"engram_val_bf16": 4,
|
| 16 |
+
"embed_tokens": 1,
|
| 17 |
+
"shards_rewritten": [
|
| 18 |
+
"model-00050-of-00148.safetensors",
|
| 19 |
+
"model-00051-of-00148.safetensors",
|
| 20 |
+
"model-00055-of-00148.safetensors",
|
| 21 |
+
"model-00059-of-00148.safetensors",
|
| 22 |
+
"model-00065-of-00148.safetensors",
|
| 23 |
+
"model-00070-of-00148.safetensors",
|
| 24 |
+
"model-00075-of-00148.safetensors",
|
| 25 |
+
"model-00081-of-00148.safetensors",
|
| 26 |
+
"model-00082-of-00148.safetensors",
|
| 27 |
+
"model-00088-of-00148.safetensors",
|
| 28 |
+
"model-00091-of-00148.safetensors",
|
| 29 |
+
"model-00095-of-00148.safetensors",
|
| 30 |
+
"model-00102-of-00148.safetensors",
|
| 31 |
+
"model-00103-of-00148.safetensors",
|
| 32 |
+
"model-00110-of-00148.safetensors",
|
| 33 |
+
"model-00111-of-00148.safetensors",
|
| 34 |
+
"model-00112-of-00148.safetensors",
|
| 35 |
+
"model-00113-of-00148.safetensors",
|
| 36 |
+
"model-00114-of-00148.safetensors",
|
| 37 |
+
"model-00120-of-00148.safetensors",
|
| 38 |
+
"model-00121-of-00148.safetensors",
|
| 39 |
+
"model-00122-of-00148.safetensors",
|
| 40 |
+
"model-00123-of-00148.safetensors",
|
| 41 |
+
"model-00131-of-00148.safetensors",
|
| 42 |
+
"model-00132-of-00148.safetensors",
|
| 43 |
+
"model-00133-of-00148.safetensors",
|
| 44 |
+
"model-00134-of-00148.safetensors",
|
| 45 |
+
"model-00137-of-00148.safetensors",
|
| 46 |
+
"model-00142-of-00148.safetensors",
|
| 47 |
+
"model-00143-of-00148.safetensors",
|
| 48 |
+
"model-00144-of-00148.safetensors"
|
| 49 |
+
]
|
| 50 |
+
},
|
| 51 |
+
"elapsed_s": 20.8
|
| 52 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#- ----------‑‑‑ special token variables ‑‑‑---------- -#}
|
| 2 |
+
{%- set HYTK = ':opensource' %}
|
| 3 |
+
{%- set hy_start_token = '<|hy_start{}|>'.format(HYTK) %}
|
| 4 |
+
{%- set hy_middle_token = '<|hy_middle{}|>'.format(HYTK) %}
|
| 5 |
+
{%- set hy_end_token = '<|hy_end{}|>'.format(HYTK) %}
|
| 6 |
+
{%- set image_start_token = '<|hy_image▁start{}|>'.format(HYTK) %}
|
| 7 |
+
{%- set image_pad_token = '<|hy_image▁pad{}|>'.format(HYTK) %}
|
| 8 |
+
{%- set image_end_token = '<|hy_image▁end{}|>'.format(HYTK) %}
|
| 9 |
+
{%- set video_start_token = '<|hy_video▁start{}|>'.format(HYTK) %}
|
| 10 |
+
{%- set video_pad_token = '<|hy_video▁pad{}|>'.format(HYTK) %}
|
| 11 |
+
{%- set video_end_token = '<|hy_video▁end{}|>'.format(HYTK) %}
|
| 12 |
+
{%- set think_begin_token = '<think{}>'.format(HYTK) %}
|
| 13 |
+
{%- set think_end_token = '</think{}>'.format(HYTK) %}
|
| 14 |
+
{%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}
|
| 15 |
+
{%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}
|
| 16 |
+
{%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}
|
| 17 |
+
{%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}
|
| 18 |
+
{%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}
|
| 19 |
+
{%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}
|
| 20 |
+
{%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}
|
| 21 |
+
{%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}
|
| 22 |
+
{%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}
|
| 23 |
+
{%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}
|
| 24 |
+
{%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}
|
| 25 |
+
|
| 26 |
+
{#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}
|
| 27 |
+
{%- if not add_generation_prompt is defined %}
|
| 28 |
+
{%- set add_generation_prompt = false %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
{%- if not preserved_thinking is defined %}
|
| 31 |
+
{%- if not tools %}
|
| 32 |
+
{%- set preserved_thinking = false %}
|
| 33 |
+
{%- else %}
|
| 34 |
+
{%- set preserved_thinking = true %}
|
| 35 |
+
{%- endif %}
|
| 36 |
+
{%- endif %}
|
| 37 |
+
|
| 38 |
+
{%- if not reasoning_effort is defined %}
|
| 39 |
+
{%- set reasoning_effort = 'high' %}
|
| 40 |
+
{%- elif reasoning_effort not in ['no_think', 'high'] %}
|
| 41 |
+
{%- if reasoning_effort is none %}
|
| 42 |
+
{{- raise_exception('reasoning_effort error : None, should be no_think/high') }}
|
| 43 |
+
{%- else %}
|
| 44 |
+
{{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/high') }}
|
| 45 |
+
{%- endif %}
|
| 46 |
+
{%- endif %}
|
| 47 |
+
|
| 48 |
+
{%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}
|
| 49 |
+
{%- set reasoning_effort = 'high' %}
|
| 50 |
+
{%- set add_generation_prompt = false %}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if not raw_last_assistant is defined %}
|
| 53 |
+
{%- set raw_last_assistant = false %}
|
| 54 |
+
{%- endif %}
|
| 55 |
+
{%- if not add_vision_id is defined %}
|
| 56 |
+
{%- set add_vision_id = false %}
|
| 57 |
+
{%- endif %}
|
| 58 |
+
{%- set image_count = namespace(value=0) %}
|
| 59 |
+
{%- set video_count = namespace(value=0) %}
|
| 60 |
+
|
| 61 |
+
{%- macro tool_to_json(tool) -%}
|
| 62 |
+
{%- set ns_tool = namespace(first=true) -%}
|
| 63 |
+
{{- '{' -}}
|
| 64 |
+
{%- for k, v in tool.items() -%}
|
| 65 |
+
{%- if k != 'defer_loading' and k != 'strict' -%}
|
| 66 |
+
{%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}
|
| 67 |
+
{%- set ns_tool.first = false -%}
|
| 68 |
+
{{- '"' ~ k ~ '": ' ~ (v | tojson(ensure_ascii=False)) -}}
|
| 69 |
+
{%- endif -%}
|
| 70 |
+
{%- endfor -%}
|
| 71 |
+
{{- '}' -}}
|
| 72 |
+
{%- endmacro -%}
|
| 73 |
+
|
| 74 |
+
{%- macro render_content(content, do_vision_count=true, is_system_content=false) -%}
|
| 75 |
+
{%- if content is string -%}
|
| 76 |
+
{{- content -}}
|
| 77 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 78 |
+
{%- for item in content -%}
|
| 79 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 80 |
+
{{- item.text -}}
|
| 81 |
+
{%- elif item is mapping and ('image' in item or 'image_url' in item or item.type in ['image', 'image_url']) -%}
|
| 82 |
+
{%- if is_system_content -%}
|
| 83 |
+
{{- raise_exception('System message cannot contain images.') -}}
|
| 84 |
+
{%- endif -%}
|
| 85 |
+
{%- if do_vision_count -%}
|
| 86 |
+
{%- set image_count.value = image_count.value + 1 -%}
|
| 87 |
+
{%- endif -%}
|
| 88 |
+
{%- if add_vision_id -%}
|
| 89 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' -}}
|
| 90 |
+
{%- endif -%}
|
| 91 |
+
{{- image_start_token ~ image_pad_token ~ image_end_token -}}
|
| 92 |
+
{%- elif item is mapping and ('video' in item or 'video_url' in item or item.type in ['video', 'video_url']) -%}
|
| 93 |
+
{%- if is_system_content -%}
|
| 94 |
+
{{- raise_exception('System message cannot contain videos.') -}}
|
| 95 |
+
{%- endif -%}
|
| 96 |
+
{%- if do_vision_count -%}
|
| 97 |
+
{%- set video_count.value = video_count.value + 1 -%}
|
| 98 |
+
{%- endif -%}
|
| 99 |
+
{%- if add_vision_id -%}
|
| 100 |
+
{{- 'Video ' ~ video_count.value ~ ': ' -}}
|
| 101 |
+
{%- endif -%}
|
| 102 |
+
{{- video_start_token ~ video_pad_token ~ video_end_token -}}
|
| 103 |
+
{%- elif item is string -%}
|
| 104 |
+
{{- item -}}
|
| 105 |
+
{%- else -%}
|
| 106 |
+
{{- item | string -}}
|
| 107 |
+
{%- endif -%}
|
| 108 |
+
{%- endfor -%}
|
| 109 |
+
{%- elif content is none -%}
|
| 110 |
+
{{- '' -}}
|
| 111 |
+
{%- else -%}
|
| 112 |
+
{{- content | string -}}
|
| 113 |
+
{%- endif -%}
|
| 114 |
+
{%- endmacro -%}
|
| 115 |
+
|
| 116 |
+
{%- macro render_tools_prompt() -%}
|
| 117 |
+
{{- '# Tools\n\nYou may call one or more functions to assist with the user query.' -}}
|
| 118 |
+
{{- '\n\nYou are provided with function signatures within <tools></tools> XML tags:' -}}
|
| 119 |
+
{{- '\n<tools>\n' -}}
|
| 120 |
+
{%- set tool_ns = namespace(first=true) -%}
|
| 121 |
+
{%- for tool in tools -%}
|
| 122 |
+
{%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}
|
| 123 |
+
{%- if t.defer_loading is not defined or not t.defer_loading -%}
|
| 124 |
+
{%- if not tool_ns.first -%}{{- '\n' -}}{%- endif -%}
|
| 125 |
+
{%- set tool_ns.first = false -%}
|
| 126 |
+
{{- tool_to_json(t) -}}
|
| 127 |
+
{%- endif -%}
|
| 128 |
+
{%- endfor -%}
|
| 129 |
+
{{- '\n</tools>\n\n' -}}
|
| 130 |
+
{{- 'For function call returns, you should first print ' ~ toolcalls_begin_token -}}
|
| 131 |
+
{{- '\nFor each function call, you should return object like:\n' -}}
|
| 132 |
+
{{- toolcall_begin_token ~ '{function-name}' -}}
|
| 133 |
+
{{- argkey_begin_token ~ '{arg-key-1}' ~ argkey_end_token -}}
|
| 134 |
+
{{- argvalue_begin_token ~ '{arg-value-1}' ~ argvalue_end_token -}}
|
| 135 |
+
{{- argkey_begin_token ~ '{arg-key-2}' ~ argkey_end_token -}}
|
| 136 |
+
{{- argvalue_begin_token ~ '{arg-value-2}' ~ argvalue_end_token -}}
|
| 137 |
+
{{- '...' -}}
|
| 138 |
+
{{- toolcall_end_token -}}
|
| 139 |
+
{{- '\nAt the end of function call returns, you should print ' ~ toolcalls_end_token -}}
|
| 140 |
+
{%- endmacro -%}
|
| 141 |
+
|
| 142 |
+
{#- adjacent tool_search_output parts share one <tools> block, so a tool search result has the same shape as the tools prompt -#}
|
| 143 |
+
{%- macro render_tool_response(message) -%}
|
| 144 |
+
{%- set content = message['content'] -%}
|
| 145 |
+
{{- toolresponse_begin_token -}}
|
| 146 |
+
{%- if content is string -%}
|
| 147 |
+
{{- content -}}
|
| 148 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 149 |
+
{%- set tools_ns = namespace(open=false) -%}
|
| 150 |
+
{%- for item in content -%}
|
| 151 |
+
{%- set is_search_output = item is mapping and item.type is defined and item.type == 'tool_search_output' -%}
|
| 152 |
+
{%- if is_search_output and not tools_ns.open -%}
|
| 153 |
+
{{- '<tools>\n' -}}
|
| 154 |
+
{%- set tools_ns.open = true -%}
|
| 155 |
+
{%- elif not is_search_output and tools_ns.open -%}
|
| 156 |
+
{{- '</tools>' -}}
|
| 157 |
+
{%- set tools_ns.open = false -%}
|
| 158 |
+
{%- endif -%}
|
| 159 |
+
{%- if is_search_output -%}
|
| 160 |
+
{%- if item.tools is defined and item.tools is iterable -%}
|
| 161 |
+
{%- for tool in item.tools -%}
|
| 162 |
+
{%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}
|
| 163 |
+
{{- tool_to_json(t) ~ '\n' -}}
|
| 164 |
+
{%- endfor -%}
|
| 165 |
+
{%- endif -%}
|
| 166 |
+
{%- elif item is mapping and item.output is defined -%}
|
| 167 |
+
{{- render_content(item.output) -}}
|
| 168 |
+
{%- else -%}
|
| 169 |
+
{{- render_content([item]) -}}
|
| 170 |
+
{%- endif -%}
|
| 171 |
+
{%- endfor -%}
|
| 172 |
+
{%- if tools_ns.open -%}
|
| 173 |
+
{{- '</tools>' -}}
|
| 174 |
+
{%- endif -%}
|
| 175 |
+
{%- else -%}
|
| 176 |
+
{{- render_content(content) -}}
|
| 177 |
+
{%- endif -%}
|
| 178 |
+
{{- toolresponse_end_token -}}
|
| 179 |
+
{%- endmacro -%}
|
| 180 |
+
|
| 181 |
+
{#- consecutive tool messages are clustered into a single tool message whose content is the list of the original tool messages; the result is written to merged_ns.messages (a macro cannot return a list) -#}
|
| 182 |
+
{%- set merged_ns = namespace(messages=[]) %}
|
| 183 |
+
{%- macro merge_tool_responses(messages) -%}
|
| 184 |
+
{%- set merge_ns = namespace(result=[], cluster=[]) -%}
|
| 185 |
+
{%- for message in messages -%}
|
| 186 |
+
{%- if message['role'] == 'tool' -%}
|
| 187 |
+
{%- set merge_ns.cluster = merge_ns.cluster + [message] -%}
|
| 188 |
+
{%- else -%}
|
| 189 |
+
{%- if merge_ns.cluster -%}
|
| 190 |
+
{%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}
|
| 191 |
+
{%- set merge_ns.cluster = [] -%}
|
| 192 |
+
{%- endif -%}
|
| 193 |
+
{%- set merge_ns.result = merge_ns.result + [message] -%}
|
| 194 |
+
{%- endif -%}
|
| 195 |
+
{%- endfor -%}
|
| 196 |
+
{%- if merge_ns.cluster -%}
|
| 197 |
+
{%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}
|
| 198 |
+
{%- endif -%}
|
| 199 |
+
{%- set merged_ns.messages = merge_ns.result -%}
|
| 200 |
+
{%- endmacro -%}
|
| 201 |
+
|
| 202 |
+
{#- render one tool cluster, reordered to follow the tool_call order of the preceding assistant turn; any missing / ambiguous id falls back to the original tool message order for the whole cluster -#}
|
| 203 |
+
{%- macro render_tool_responses(tool_messages, tool_call_ids) -%}
|
| 204 |
+
{%- set order_ns = namespace(ordered=[], matched=true) -%}
|
| 205 |
+
{%- if tool_call_ids and tool_call_ids | length == tool_messages | length -%}
|
| 206 |
+
{%- for tool_call_id in tool_call_ids -%}
|
| 207 |
+
{%- set hit_ns = namespace(count=0, message=none) -%}
|
| 208 |
+
{%- for tool_message in tool_messages -%}
|
| 209 |
+
{%- set message_id = tool_message['tool_call_id'] if tool_message['tool_call_id'] is defined else tool_message['id'] -%}
|
| 210 |
+
{%- if message_id is defined and message_id == tool_call_id -%}
|
| 211 |
+
{%- set hit_ns.count = hit_ns.count + 1 -%}
|
| 212 |
+
{%- set hit_ns.message = tool_message -%}
|
| 213 |
+
{%- endif -%}
|
| 214 |
+
{%- endfor -%}
|
| 215 |
+
{%- if hit_ns.count == 1 -%}
|
| 216 |
+
{%- set order_ns.ordered = order_ns.ordered + [hit_ns.message] -%}
|
| 217 |
+
{%- else -%}
|
| 218 |
+
{%- set order_ns.matched = false -%}
|
| 219 |
+
{%- endif -%}
|
| 220 |
+
{%- endfor -%}
|
| 221 |
+
{%- else -%}
|
| 222 |
+
{%- set order_ns.matched = false -%}
|
| 223 |
+
{%- endif -%}
|
| 224 |
+
{%- for tool_message in (order_ns.ordered if order_ns.matched else tool_messages) -%}
|
| 225 |
+
{{- render_tool_response(tool_message) -}}
|
| 226 |
+
{%- endfor -%}
|
| 227 |
+
{%- endmacro -%}
|
| 228 |
+
|
| 229 |
+
{%- set _ = merge_tool_responses(messages) %}
|
| 230 |
+
{%- set normed_messages = merged_ns.messages %}
|
| 231 |
+
|
| 232 |
+
{%- set ns = namespace(last_user_index=-1, has_leading_system=false) %}
|
| 233 |
+
{%- if normed_messages and normed_messages[0].role == 'system' %}
|
| 234 |
+
{%- set ns.has_leading_system = true %}
|
| 235 |
+
{%- endif %}
|
| 236 |
+
{%- for message in normed_messages %}
|
| 237 |
+
{%- if message['role'] == 'user' %}
|
| 238 |
+
{%- set ns.last_user_index = loop.index0 %}
|
| 239 |
+
{%- endif %}
|
| 240 |
+
{%- endfor %}
|
| 241 |
+
|
| 242 |
+
{#- no leading system: synthesize one for tools and/or reasoning_mode -#}
|
| 243 |
+
{%- if not ns.has_leading_system %}
|
| 244 |
+
{{- hy_start_token ~ 'system' ~ hy_middle_token -}}
|
| 245 |
+
{%- if tools %}
|
| 246 |
+
{{- render_tools_prompt() -}}
|
| 247 |
+
{%- endif %}
|
| 248 |
+
{{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}
|
| 249 |
+
{{- hy_end_token -}}
|
| 250 |
+
{%- endif %}
|
| 251 |
+
|
| 252 |
+
{%- set last_ns = namespace(last_is_assistant=false) %}
|
| 253 |
+
{%- set prev_ns = namespace(tool_call_ids=[]) %}
|
| 254 |
+
{%- for message in normed_messages %}
|
| 255 |
+
{%- if message['role'] == 'system' %}
|
| 256 |
+
{{- hy_start_token ~ 'system' ~ hy_middle_token -}}
|
| 257 |
+
{#- tools / reasoning_mode only attach to the leading system (messages[0]) -#}
|
| 258 |
+
{%- if loop.first %}
|
| 259 |
+
{%- if tools %}
|
| 260 |
+
{{- render_tools_prompt() -}}
|
| 261 |
+
{%- endif %}
|
| 262 |
+
{%- set content = render_content(message['content']) -%}
|
| 263 |
+
{%- if tools and content -%}
|
| 264 |
+
{{- '\n\n' -}}
|
| 265 |
+
{%- endif -%}
|
| 266 |
+
{{- content -}}
|
| 267 |
+
{{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}
|
| 268 |
+
{%- else %}
|
| 269 |
+
{{- render_content(message['content']) -}}
|
| 270 |
+
{%- endif %}
|
| 271 |
+
{{- hy_end_token -}}
|
| 272 |
+
{%- elif message['role'] == 'user' %}
|
| 273 |
+
{{- hy_start_token ~ 'user' ~ hy_middle_token -}}
|
| 274 |
+
{{- render_content(message['content']) -}}
|
| 275 |
+
{{- hy_end_token -}}
|
| 276 |
+
{%- elif message['role'] == 'assistant' %}
|
| 277 |
+
{%- set content_body = render_content(message['content']) -%}
|
| 278 |
+
{#- 'reasoning' takes precedence, fall back to 'reasoning_content' when it is empty -#}
|
| 279 |
+
{%- set reasoning_text = '' %}
|
| 280 |
+
{%- if message['reasoning'] is defined and message['reasoning'] is string and message['reasoning'] %}
|
| 281 |
+
{%- set reasoning_text = message['reasoning'] %}
|
| 282 |
+
{%- elif message['reasoning_content'] is defined and message['reasoning_content'] is string and message['reasoning_content'] %}
|
| 283 |
+
{%- set reasoning_text = message['reasoning_content'] %}
|
| 284 |
+
{%- endif %}
|
| 285 |
+
{#- no_think overrides preserved_thinking: history is always emitted with empty think tags -#}
|
| 286 |
+
{%- if reasoning_effort != 'no_think' and (preserved_thinking or loop.index0 > ns.last_user_index) and reasoning_text %}
|
| 287 |
+
{%- set content = think_begin_token ~ reasoning_text ~ think_end_token ~ content_body %}
|
| 288 |
+
{%- else %}
|
| 289 |
+
{%- set content = think_begin_token ~ think_end_token ~ content_body %}
|
| 290 |
+
{%- endif %}
|
| 291 |
+
{{- hy_start_token ~ 'assistant' ~ hy_middle_token -}}
|
| 292 |
+
{%- if message['tool_calls'] is defined and message['tool_calls'] %}
|
| 293 |
+
{#- remember the tool_call ids of this turn to order the following tool responses; an incomplete id set means "do not reorder" -#}
|
| 294 |
+
{%- set ids_ns = namespace(ids=[], complete=true) %}
|
| 295 |
+
{%- for tool in message['tool_calls'] %}
|
| 296 |
+
{%- set tool_call_id = tool['id'] if tool['id'] is defined and tool['id'] else tool['tool_call_id'] %}
|
| 297 |
+
{%- if tool_call_id is defined and tool_call_id %}
|
| 298 |
+
{%- set ids_ns.ids = ids_ns.ids + [tool_call_id] %}
|
| 299 |
+
{%- else %}
|
| 300 |
+
{%- set ids_ns.complete = false %}
|
| 301 |
+
{%- endif %}
|
| 302 |
+
{%- endfor %}
|
| 303 |
+
{%- set prev_ns.tool_call_ids = ids_ns.ids if ids_ns.complete else [] %}
|
| 304 |
+
{{- content -}}
|
| 305 |
+
{{- toolcalls_begin_token -}}
|
| 306 |
+
{%- for tool in message['tool_calls'] -%}
|
| 307 |
+
{%- set func = tool['function'] if tool is mapping and 'function' in tool else tool -%}
|
| 308 |
+
{%- set arguments = func['arguments'] -%}
|
| 309 |
+
{{- toolcall_begin_token ~ func['name'] -}}
|
| 310 |
+
{%- for key, value in arguments.items() -%}
|
| 311 |
+
{{- argkey_begin_token ~ key ~ argkey_end_token -}}
|
| 312 |
+
{%- if value is not string -%}
|
| 313 |
+
{%- set value = value | tojson(ensure_ascii=False) -%}
|
| 314 |
+
{%- endif -%}
|
| 315 |
+
{{- argvalue_begin_token ~ value ~ argvalue_end_token -}}
|
| 316 |
+
{%- endfor -%}
|
| 317 |
+
{{- toolcall_end_token -}}
|
| 318 |
+
{%- endfor -%}
|
| 319 |
+
{{- toolcalls_end_token -}}
|
| 320 |
+
{%- else %}
|
| 321 |
+
{%- if loop.last and raw_last_assistant %}
|
| 322 |
+
{{- content_body -}}
|
| 323 |
+
{%- else %}
|
| 324 |
+
{{- content -}}
|
| 325 |
+
{%- endif %}
|
| 326 |
+
{%- endif %}
|
| 327 |
+
{#- continuation / prefill: last assistant is still open, do not close with hy_end -#}
|
| 328 |
+
{%- if not (loop.last and raw_last_assistant) and not (loop.last and fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry') %}
|
| 329 |
+
{{- hy_end_token -}}
|
| 330 |
+
{%- endif %}
|
| 331 |
+
{%- elif message['role'] == 'tool' %}
|
| 332 |
+
{{- hy_start_token ~ 'tool' ~ hy_middle_token -}}
|
| 333 |
+
{{- render_tool_responses(message['content'], prev_ns.tool_call_ids) -}}
|
| 334 |
+
{{- hy_end_token -}}
|
| 335 |
+
{%- else %}
|
| 336 |
+
{{- hy_start_token ~ message['role'] ~ hy_middle_token -}}
|
| 337 |
+
{{- render_content(message['content']) -}}
|
| 338 |
+
{{- hy_end_token -}}
|
| 339 |
+
{%- endif %}
|
| 340 |
+
{%- if message['role'] != 'assistant' or not (message['tool_calls'] is defined and message['tool_calls']) %}
|
| 341 |
+
{%- set prev_ns.tool_call_ids = [] %}
|
| 342 |
+
{%- endif %}
|
| 343 |
+
{%- if loop.last and message['role'] == 'assistant' %}
|
| 344 |
+
{%- set last_ns.last_is_assistant = true %}
|
| 345 |
+
{%- endif %}
|
| 346 |
+
{%- endfor %}
|
| 347 |
+
{%- if add_generation_prompt %}
|
| 348 |
+
{%- if not last_ns.last_is_assistant %}
|
| 349 |
+
{%- if reasoning_effort == 'no_think' %}
|
| 350 |
+
{{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token ~ think_end_token -}}
|
| 351 |
+
{%- else %}
|
| 352 |
+
{{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token -}}
|
| 353 |
+
{%- endif %}
|
| 354 |
+
{%- endif %}
|
| 355 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"HYV4FlashForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "bfloat16",
|
| 6 |
+
"image_end_token_id": 120119,
|
| 7 |
+
"image_newline_token_id": 120121,
|
| 8 |
+
"image_start_token_id": 120118,
|
| 9 |
+
"image_token_id": 120120,
|
| 10 |
+
"model_type": "hy_v4_flash",
|
| 11 |
+
"processor_class": "HYV4FlashProcessor",
|
| 12 |
+
"spatial_merge_size": 2,
|
| 13 |
+
"text_config": {
|
| 14 |
+
"architectures": [
|
| 15 |
+
"HYV4FlashForCausalLM"
|
| 16 |
+
],
|
| 17 |
+
"attention_bias": false,
|
| 18 |
+
"attention_dropout": 0.0,
|
| 19 |
+
"bitwise_backward_align": true,
|
| 20 |
+
"bos_token_id": 120000,
|
| 21 |
+
"compressed_indexer_candidate_topk": 2048,
|
| 22 |
+
"compressed_indexer_compress_ratio": 4,
|
| 23 |
+
"compressed_indexer_group_topk": 512,
|
| 24 |
+
"compressed_indexer_head_dim": 128,
|
| 25 |
+
"compressed_indexer_key_pooling": "gated",
|
| 26 |
+
"compressed_indexer_num_attention_heads": 16,
|
| 27 |
+
"compressed_indexer_reuse_fine_indexer": false,
|
| 28 |
+
"compressed_indexer_skip_fine_select": true,
|
| 29 |
+
"compressed_indexer_stage2_query_block_size": 8192,
|
| 30 |
+
"compressed_indexer_teacher_pooling_type": "max",
|
| 31 |
+
"compressed_indexer_triton_pooling_min_groups": 1,
|
| 32 |
+
"compressed_indexer_use_triton_pooling": true,
|
| 33 |
+
"dsa_skip_attn_post_norm": false,
|
| 34 |
+
"enable_ihc": true,
|
| 35 |
+
"enable_lm_head_fp32": true,
|
| 36 |
+
"engram_embed_random_seed": 1234,
|
| 37 |
+
"engram_fp8_embedding": false,
|
| 38 |
+
"engram_isolate_fffd_namespace": false,
|
| 39 |
+
"engram_layer_head_vocab_sizes": {
|
| 40 |
+
"12": [
|
| 41 |
+
[
|
| 42 |
+
10312277,
|
| 43 |
+
10312283,
|
| 44 |
+
10312301,
|
| 45 |
+
10312343,
|
| 46 |
+
10312373,
|
| 47 |
+
10312397,
|
| 48 |
+
10312409,
|
| 49 |
+
10312453
|
| 50 |
+
],
|
| 51 |
+
[
|
| 52 |
+
10312457,
|
| 53 |
+
10312483,
|
| 54 |
+
10312507,
|
| 55 |
+
10312513,
|
| 56 |
+
10312531,
|
| 57 |
+
10312543,
|
| 58 |
+
10312567,
|
| 59 |
+
10312571
|
| 60 |
+
]
|
| 61 |
+
],
|
| 62 |
+
"2": [
|
| 63 |
+
[
|
| 64 |
+
10312007,
|
| 65 |
+
10312021,
|
| 66 |
+
10312039,
|
| 67 |
+
10312069,
|
| 68 |
+
10312091,
|
| 69 |
+
10312121,
|
| 70 |
+
10312123,
|
| 71 |
+
10312147
|
| 72 |
+
],
|
| 73 |
+
[
|
| 74 |
+
10312177,
|
| 75 |
+
10312187,
|
| 76 |
+
10312207,
|
| 77 |
+
10312213,
|
| 78 |
+
10312229,
|
| 79 |
+
10312241,
|
| 80 |
+
10312249,
|
| 81 |
+
10312259
|
| 82 |
+
]
|
| 83 |
+
],
|
| 84 |
+
"22": [
|
| 85 |
+
[
|
| 86 |
+
10312613,
|
| 87 |
+
10312619,
|
| 88 |
+
10312633,
|
| 89 |
+
10312657,
|
| 90 |
+
10312681,
|
| 91 |
+
10312699,
|
| 92 |
+
10312723,
|
| 93 |
+
10312747
|
| 94 |
+
],
|
| 95 |
+
[
|
| 96 |
+
10312759,
|
| 97 |
+
10312789,
|
| 98 |
+
10312811,
|
| 99 |
+
10312823,
|
| 100 |
+
10312867,
|
| 101 |
+
10312873,
|
| 102 |
+
10312889,
|
| 103 |
+
10312903
|
| 104 |
+
]
|
| 105 |
+
],
|
| 106 |
+
"32": [
|
| 107 |
+
[
|
| 108 |
+
10312909,
|
| 109 |
+
10312919,
|
| 110 |
+
10312927,
|
| 111 |
+
10312957,
|
| 112 |
+
10312979,
|
| 113 |
+
10313011,
|
| 114 |
+
10313021,
|
| 115 |
+
10313057
|
| 116 |
+
],
|
| 117 |
+
[
|
| 118 |
+
10313063,
|
| 119 |
+
10313117,
|
| 120 |
+
10313123,
|
| 121 |
+
10313129,
|
| 122 |
+
10313161,
|
| 123 |
+
10313179,
|
| 124 |
+
10313189,
|
| 125 |
+
10313201
|
| 126 |
+
]
|
| 127 |
+
]
|
| 128 |
+
},
|
| 129 |
+
"engram_layer_ids": [
|
| 130 |
+
2,
|
| 131 |
+
12,
|
| 132 |
+
22,
|
| 133 |
+
32
|
| 134 |
+
],
|
| 135 |
+
"engram_max_ngram_size": 3,
|
| 136 |
+
"engram_n_embed_per_ngram": 768,
|
| 137 |
+
"engram_n_head_per_ngram": 8,
|
| 138 |
+
"engram_pad_id": 120002,
|
| 139 |
+
"engram_seed": 0,
|
| 140 |
+
"engram_tokenizer_name_or_path": null,
|
| 141 |
+
"engram_vocab_map_path": null,
|
| 142 |
+
"engram_vocab_size": [
|
| 143 |
+
10312000,
|
| 144 |
+
10312000
|
| 145 |
+
],
|
| 146 |
+
"eos_token_id": 120025,
|
| 147 |
+
"fast_op_fp32_linear_gemm": true,
|
| 148 |
+
"first_k_dense_replace": 1,
|
| 149 |
+
"full_nope": false,
|
| 150 |
+
"gate_groups": 1,
|
| 151 |
+
"gate_lora_op": "none",
|
| 152 |
+
"gate_lora_rank": null,
|
| 153 |
+
"gated_mla": true,
|
| 154 |
+
"gating_type": "elementwise",
|
| 155 |
+
"hc_eps": 1e-06,
|
| 156 |
+
"hc_magnitude": 2.0,
|
| 157 |
+
"hc_mult": 4,
|
| 158 |
+
"head_dim": 64,
|
| 159 |
+
"hidden_act": "silu",
|
| 160 |
+
"hidden_size": 3072,
|
| 161 |
+
"ihc_kernel_backend": "naive",
|
| 162 |
+
"index_head_dim": 128,
|
| 163 |
+
"index_n_heads": 16,
|
| 164 |
+
"index_topk": 2048,
|
| 165 |
+
"indexer_types": [
|
| 166 |
+
"full",
|
| 167 |
+
"full",
|
| 168 |
+
"full",
|
| 169 |
+
"full",
|
| 170 |
+
"full",
|
| 171 |
+
"full",
|
| 172 |
+
"full",
|
| 173 |
+
"full",
|
| 174 |
+
"full",
|
| 175 |
+
"full",
|
| 176 |
+
"full",
|
| 177 |
+
"full",
|
| 178 |
+
"full",
|
| 179 |
+
"full",
|
| 180 |
+
"full",
|
| 181 |
+
"full",
|
| 182 |
+
"full",
|
| 183 |
+
"full",
|
| 184 |
+
"full",
|
| 185 |
+
"full",
|
| 186 |
+
"full",
|
| 187 |
+
"full",
|
| 188 |
+
"full",
|
| 189 |
+
"full",
|
| 190 |
+
"full",
|
| 191 |
+
"full",
|
| 192 |
+
"full",
|
| 193 |
+
"full",
|
| 194 |
+
"full",
|
| 195 |
+
"full",
|
| 196 |
+
"full",
|
| 197 |
+
"full",
|
| 198 |
+
"full",
|
| 199 |
+
"full",
|
| 200 |
+
"full",
|
| 201 |
+
"full",
|
| 202 |
+
"full",
|
| 203 |
+
"full",
|
| 204 |
+
"full",
|
| 205 |
+
"full",
|
| 206 |
+
"full",
|
| 207 |
+
"full"
|
| 208 |
+
],
|
| 209 |
+
"initializer_range": 0.006,
|
| 210 |
+
"intermediate_size": 13824,
|
| 211 |
+
"kv_lora_rank": 512,
|
| 212 |
+
"layer_types": [
|
| 213 |
+
"deepseek_sparse_attention",
|
| 214 |
+
"deepseek_sparse_attention",
|
| 215 |
+
"sliding_attention",
|
| 216 |
+
"sliding_attention",
|
| 217 |
+
"sliding_attention",
|
| 218 |
+
"deepseek_sparse_attention",
|
| 219 |
+
"sliding_attention",
|
| 220 |
+
"sliding_attention",
|
| 221 |
+
"sliding_attention",
|
| 222 |
+
"deepseek_sparse_attention",
|
| 223 |
+
"sliding_attention",
|
| 224 |
+
"sliding_attention",
|
| 225 |
+
"sliding_attention",
|
| 226 |
+
"deepseek_sparse_attention",
|
| 227 |
+
"sliding_attention",
|
| 228 |
+
"sliding_attention",
|
| 229 |
+
"sliding_attention",
|
| 230 |
+
"deepseek_sparse_attention",
|
| 231 |
+
"sliding_attention",
|
| 232 |
+
"sliding_attention",
|
| 233 |
+
"sliding_attention",
|
| 234 |
+
"deepseek_sparse_attention",
|
| 235 |
+
"sliding_attention",
|
| 236 |
+
"sliding_attention",
|
| 237 |
+
"sliding_attention",
|
| 238 |
+
"deepseek_sparse_attention",
|
| 239 |
+
"sliding_attention",
|
| 240 |
+
"sliding_attention",
|
| 241 |
+
"sliding_attention",
|
| 242 |
+
"deepseek_sparse_attention",
|
| 243 |
+
"sliding_attention",
|
| 244 |
+
"sliding_attention",
|
| 245 |
+
"sliding_attention",
|
| 246 |
+
"deepseek_sparse_attention",
|
| 247 |
+
"sliding_attention",
|
| 248 |
+
"sliding_attention",
|
| 249 |
+
"sliding_attention",
|
| 250 |
+
"deepseek_sparse_attention",
|
| 251 |
+
"sliding_attention",
|
| 252 |
+
"sliding_attention",
|
| 253 |
+
"sliding_attention",
|
| 254 |
+
"deepseek_sparse_attention"
|
| 255 |
+
],
|
| 256 |
+
"learnable_sink": true,
|
| 257 |
+
"learnable_sink_init": 0.0,
|
| 258 |
+
"max_position_embeddings": 1048576,
|
| 259 |
+
"mlp_layer_types": [
|
| 260 |
+
"dense",
|
| 261 |
+
"sparse",
|
| 262 |
+
"sparse",
|
| 263 |
+
"sparse",
|
| 264 |
+
"sparse",
|
| 265 |
+
"sparse",
|
| 266 |
+
"sparse",
|
| 267 |
+
"sparse",
|
| 268 |
+
"sparse",
|
| 269 |
+
"sparse",
|
| 270 |
+
"sparse",
|
| 271 |
+
"sparse",
|
| 272 |
+
"sparse",
|
| 273 |
+
"sparse",
|
| 274 |
+
"sparse",
|
| 275 |
+
"sparse",
|
| 276 |
+
"sparse",
|
| 277 |
+
"sparse",
|
| 278 |
+
"sparse",
|
| 279 |
+
"sparse",
|
| 280 |
+
"sparse",
|
| 281 |
+
"sparse",
|
| 282 |
+
"sparse",
|
| 283 |
+
"sparse",
|
| 284 |
+
"sparse",
|
| 285 |
+
"sparse",
|
| 286 |
+
"sparse",
|
| 287 |
+
"sparse",
|
| 288 |
+
"sparse",
|
| 289 |
+
"sparse",
|
| 290 |
+
"sparse",
|
| 291 |
+
"sparse",
|
| 292 |
+
"sparse",
|
| 293 |
+
"sparse",
|
| 294 |
+
"sparse",
|
| 295 |
+
"sparse",
|
| 296 |
+
"sparse",
|
| 297 |
+
"sparse",
|
| 298 |
+
"sparse",
|
| 299 |
+
"sparse",
|
| 300 |
+
"sparse",
|
| 301 |
+
"sparse"
|
| 302 |
+
],
|
| 303 |
+
"model_type": "hy_v4_flash",
|
| 304 |
+
"moe_aux_loss_coeff": 0.0,
|
| 305 |
+
"moe_intermediate_size": 1536,
|
| 306 |
+
"moe_router_enable_expert_bias": true,
|
| 307 |
+
"moe_router_use_sigmoid": true,
|
| 308 |
+
"n_group": 1,
|
| 309 |
+
"n_routed_experts": 512,
|
| 310 |
+
"n_shared_experts": 1,
|
| 311 |
+
"norm_topk_prob": true,
|
| 312 |
+
"num_attention_heads": 32,
|
| 313 |
+
"num_experts_per_tok": 16,
|
| 314 |
+
"num_hidden_layers": 42,
|
| 315 |
+
"num_key_value_heads": 32,
|
| 316 |
+
"num_nextn_predict_layers": 0,
|
| 317 |
+
"o_groups": 1,
|
| 318 |
+
"o_lora_op": "none",
|
| 319 |
+
"o_lora_rank": null,
|
| 320 |
+
"output_router_logits": false,
|
| 321 |
+
"pad_token_id": 120002,
|
| 322 |
+
"q_lora_rank": 1024,
|
| 323 |
+
"qk_head_dim": 256,
|
| 324 |
+
"qk_nope_head_dim": 192,
|
| 325 |
+
"qk_norm": true,
|
| 326 |
+
"qk_rope_head_dim": 64,
|
| 327 |
+
"return_bos_score": true,
|
| 328 |
+
"return_max_logit": true,
|
| 329 |
+
"rms_norm_eps": 1e-05,
|
| 330 |
+
"rope_parameters": {
|
| 331 |
+
"sliding_attention": {
|
| 332 |
+
"mrope_interleaved": true,
|
| 333 |
+
"mrope_section": [
|
| 334 |
+
12,
|
| 335 |
+
10,
|
| 336 |
+
10
|
| 337 |
+
],
|
| 338 |
+
"rope_theta": 10000,
|
| 339 |
+
"rope_type": "default"
|
| 340 |
+
},
|
| 341 |
+
"deepseek_sparse_attention": {
|
| 342 |
+
"mrope_interleaved": true,
|
| 343 |
+
"mrope_section": [
|
| 344 |
+
12,
|
| 345 |
+
10,
|
| 346 |
+
10
|
| 347 |
+
],
|
| 348 |
+
"rope_theta": 10000000,
|
| 349 |
+
"rope_type": "default"
|
| 350 |
+
}
|
| 351 |
+
},
|
| 352 |
+
"routed_expert_hidden_size": 1536,
|
| 353 |
+
"routed_scaling_factor": 3.998,
|
| 354 |
+
"sandwich_norm": true,
|
| 355 |
+
"sliding_window": 512,
|
| 356 |
+
"swa_num_attention_heads": 64,
|
| 357 |
+
"swa_pattern": [
|
| 358 |
+
0,
|
| 359 |
+
0,
|
| 360 |
+
1,
|
| 361 |
+
1,
|
| 362 |
+
1,
|
| 363 |
+
0,
|
| 364 |
+
1,
|
| 365 |
+
1,
|
| 366 |
+
1,
|
| 367 |
+
0,
|
| 368 |
+
1,
|
| 369 |
+
1,
|
| 370 |
+
1,
|
| 371 |
+
0,
|
| 372 |
+
1,
|
| 373 |
+
1,
|
| 374 |
+
1,
|
| 375 |
+
0,
|
| 376 |
+
1,
|
| 377 |
+
1,
|
| 378 |
+
1,
|
| 379 |
+
0,
|
| 380 |
+
1,
|
| 381 |
+
1,
|
| 382 |
+
1,
|
| 383 |
+
0,
|
| 384 |
+
1,
|
| 385 |
+
1,
|
| 386 |
+
1,
|
| 387 |
+
0,
|
| 388 |
+
1,
|
| 389 |
+
1,
|
| 390 |
+
1,
|
| 391 |
+
0,
|
| 392 |
+
1,
|
| 393 |
+
1,
|
| 394 |
+
1,
|
| 395 |
+
0,
|
| 396 |
+
1,
|
| 397 |
+
1,
|
| 398 |
+
1,
|
| 399 |
+
0
|
| 400 |
+
],
|
| 401 |
+
"swa_qk_head_dim": 256,
|
| 402 |
+
"swa_qk_nope_head_dim": 192,
|
| 403 |
+
"swa_qk_rope_head_dim": 64,
|
| 404 |
+
"swa_v_head_dim": 256,
|
| 405 |
+
"swiglu_limit": 10.0,
|
| 406 |
+
"tie_word_embeddings": false,
|
| 407 |
+
"topk_group": 1,
|
| 408 |
+
"use_cache": true,
|
| 409 |
+
"use_compressed_indexer": true,
|
| 410 |
+
"use_dsa": true,
|
| 411 |
+
"use_grouped_mm": false,
|
| 412 |
+
"use_mla": true,
|
| 413 |
+
"v_head_dim": 256,
|
| 414 |
+
"vocab_size": 120832,
|
| 415 |
+
"window_size": [
|
| 416 |
+
511,
|
| 417 |
+
0
|
| 418 |
+
]
|
| 419 |
+
},
|
| 420 |
+
"transformers_version": "5.23.0",
|
| 421 |
+
"video_end_token_id": 120123,
|
| 422 |
+
"video_start_token_id": 120122,
|
| 423 |
+
"video_token_id": 120124,
|
| 424 |
+
"vision_config": {
|
| 425 |
+
"add_patchemb_bias": true,
|
| 426 |
+
"anyres_vit_max_image_size": 2048,
|
| 427 |
+
"attention_backend": "hf_align_sdpa",
|
| 428 |
+
"attention_dropout": 0.0,
|
| 429 |
+
"bias_activation_fusion": true,
|
| 430 |
+
"cat_extra_token": 0,
|
| 431 |
+
"hidden_act": "gelu",
|
| 432 |
+
"hidden_dropout": 0.0,
|
| 433 |
+
"hidden_size": 1152,
|
| 434 |
+
"img_max_token_num": 4096,
|
| 435 |
+
"intermediate_size": 4304,
|
| 436 |
+
"interpolate_mode": "bilinear",
|
| 437 |
+
"learnable_mlp_pooling_size": 0,
|
| 438 |
+
"max_image_size": 2048,
|
| 439 |
+
"max_vit_seq_len": 16384,
|
| 440 |
+
"min_image_size": 512,
|
| 441 |
+
"model_type": "hy_v4_flash",
|
| 442 |
+
"num_attention_heads": 16,
|
| 443 |
+
"num_channels": 3,
|
| 444 |
+
"num_hidden_layers": 27,
|
| 445 |
+
"num_key_value_heads": 16,
|
| 446 |
+
"out_hidden_size": 3072,
|
| 447 |
+
"packed_seq_alignment": 128,
|
| 448 |
+
"patch_size": 16,
|
| 449 |
+
"perceive_post_norm": false,
|
| 450 |
+
"perceive_pre_norm": true,
|
| 451 |
+
"projector_type": "rmsnorm_mlp_adapter",
|
| 452 |
+
"remove_prenorm": true,
|
| 453 |
+
"resize_resolution": 2048,
|
| 454 |
+
"rms_norm_eps": 1e-05,
|
| 455 |
+
"rope_2d_percent": 1.0,
|
| 456 |
+
"rope_2d_theta": 10000.0,
|
| 457 |
+
"spatial_merge_size": 2,
|
| 458 |
+
"spatial_patch_size": 1,
|
| 459 |
+
"temporal_patch_size": 1,
|
| 460 |
+
"text_hidden_size": 3072,
|
| 461 |
+
"video_max_image_size": 768,
|
| 462 |
+
"video_min_image_size": 256,
|
| 463 |
+
"video_spatial_compression": false,
|
| 464 |
+
"video_temporal_compression": false,
|
| 465 |
+
"vision_full_attention": false
|
| 466 |
+
},
|
| 467 |
+
"vision_start_token_id": 120118,
|
| 468 |
+
"speculative_config": {
|
| 469 |
+
"method": "dfly",
|
| 470 |
+
"model": "dfly",
|
| 471 |
+
"num_speculative_tokens": 5,
|
| 472 |
+
"draft_sample_method": "probabilistic"
|
| 473 |
+
},
|
| 474 |
+
"dfly_mtp_fusion": "slot0",
|
| 475 |
+
"dfly_target_index_topk": 2048,
|
| 476 |
+
"dfly_context_local_window": null,
|
| 477 |
+
"dfly_enable_hidden_correction": true,
|
| 478 |
+
"dfly_num_hidden_layers": 5,
|
| 479 |
+
"dfly_mask_token_id": 120009,
|
| 480 |
+
"dfly_target_index_layer": [
|
| 481 |
+
25,
|
| 482 |
+
29,
|
| 483 |
+
33,
|
| 484 |
+
37,
|
| 485 |
+
41
|
| 486 |
+
],
|
| 487 |
+
"dfly_target_kv_layers": [
|
| 488 |
+
25,
|
| 489 |
+
29,
|
| 490 |
+
33,
|
| 491 |
+
37,
|
| 492 |
+
41
|
| 493 |
+
]
|
| 494 |
+
}
|
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.23.0"
|
| 10 |
+
}
|
model-00014-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:663cd15ef2523cf00ab2b9f34bae658c977416d68aabe1ee99036ca49dc4cb8f
|
| 3 |
+
size 4831838336
|
model-00015-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b13745d08c4586bedfa05d0a28c003827062c73104e3f43aceb59264aba3ece
|
| 3 |
+
size 4831838336
|
model-00016-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7621196e46fda51e3e9c1316cd95bab9cf6cc8a09727c9cccc519bd992e383f4
|
| 3 |
+
size 2415919224
|
model-00024-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef0a960bf72284d2772be56d3e0154102232ccdc2cd9d0dc2d342865c489779e
|
| 3 |
+
size 4831838336
|
model-00028-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da3d77a9d343c25cddea7df7943a3b61c727b75dfd220f8e679f0debcb375c4b
|
| 3 |
+
size 2415919224
|
model-00031-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e0deb8c40b1bcec4d0efbcb2f23ddc47bd6aa0bfd89621744b88a3e804a2dcf
|
| 3 |
+
size 2415919224
|
model-00041-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9620254bd1eb46c50e7da9186e53f58fed7ea18e48fe398b34185ffa800e90b0
|
| 3 |
+
size 4831838336
|
model-00043-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:546d62194dc57d94849b0525af28b27592fb585ffdd1233e009e1755d77a8684
|
| 3 |
+
size 2415919224
|
model-00050-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f46f1354088edee8806128cc864d66058312e92504c793aee27921a714e77ea6
|
| 3 |
+
size 1073743280
|
model-00051-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e4702811e894eac4d03ccd16792c5ad3da9b3f052f5390c63d66ed67507c61f
|
| 3 |
+
size 9437328
|
model-00055-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfaa57d8c4b3767188a9cad9ab58aaadb775f41f575f40d5c3f8da57fe08e358
|
| 3 |
+
size 1058412816
|
model-00057-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3477db2b82e5ca16fe4ee4cedc12fd7f9c05c8b5c717e0c73c01d468b7b6aa48
|
| 3 |
+
size 2415919224
|
model-00061-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:292d019bc23c97e5114e640a10e03d8a6b8bdddfb79e283b8b27b21294e1315e
|
| 3 |
+
size 3539072
|
model-00063-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9180b138a969dcf6e2eaaa9eba94a9b9191d480a1c35d9a60778e25b8568721a
|
| 3 |
+
size 2415919224
|
model-00064-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40a187465904e815a841d0e9793fba3209ab27c37420a93b60cd16234f630b33
|
| 3 |
+
size 2415919224
|
model-00066-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd11550ab57fe178eaf149ec122ab7c278936bc763caee586f9d1bcc54c3bb5c
|
| 3 |
+
size 16777336
|
model-00081-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3a70dcd9a72750653c11b7f9da12ed49238037abf76ac76b20dc2ec55c962cbb
|
| 3 |
+
size 987760520
|
model-00091-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9ce10370c8c4b8b1c1fe35e1268a51288f143fd88110e92a862dcfc76fe9824
|
| 3 |
+
size 9437328
|
model-00094-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4145bb3df4c2477c4b1415011f938a9d32e165e4a8a632bc1dc552c94717ec57
|
| 3 |
+
size 2415919224
|
model-00101-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15b9b0448d7b57f3a6c8f8c28f6ed55672badc53f7f3478dd1956b43bf64ff0c
|
| 3 |
+
size 2415919224
|
model-00103-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77ad6f941e4dd084cb26a86e0acd6ca0899f32dd37298d0f1470b707c55ec96f
|
| 3 |
+
size 167143360
|
model-00105-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c71def642f032ca4ea464f51250886a552ce3dc1f356fb2bfc8a83fee6d8ea09
|
| 3 |
+
size 29360248
|
model-00106-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5574cef2c0694fb4998b74c2aca58494468977ac7257a63e56a533ec3b39f1e8
|
| 3 |
+
size 6291576
|
model-00107-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3af5be9edbb5309ce51ccd377151acb4470308a5368331bbe7ef8be214055c0
|
| 3 |
+
size 4831838336
|
model-00110-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:edba00fbae8e0fffc8ddc01c29edc059219fcc78f08658aa972440dafa782a1f
|
| 3 |
+
size 446694104
|
model-00112-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9b51d419d1d2b60f59d6f2aa16a47aa15e6b66f69c5cd2ac1f230a351295d50
|
| 3 |
+
size 184031280
|
model-00114-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1177a136888c4bd8afef62c6052167b59a30dcddb8811b2785a1d2de5323206
|
| 3 |
+
size 58061528
|
model-00116-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ce9ae9690f79c3de7586d14bef8c8481019360e76dfe2482095232a48bbd015
|
| 3 |
+
size 14680184
|
model-00129-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:611d3d2a6157630dca9842c23ccf1ef8be5ae095b2b647d9f420152a532a4b84
|
| 3 |
+
size 2415919224
|
model-00132-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23f8113c9d203e580b5241f252968056ab374f5193ff5b6b667655e9dd64e43d
|
| 3 |
+
size 243270592
|
model-00135-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f5fe15caa0ccbfc06a4198b5db6b4e646e8a4d14ea79b574a793706621c1444
|
| 3 |
+
size 100663424
|
model-00138-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98d44637bd2461c7007c5612c517e99639f997a53cde416e7b0d45525bdfcf8d
|
| 3 |
+
size 4831838336
|
model-00143-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c684f8dd8b4f41daa93649485286006b2394d40a4dd865664446e8353c1066b
|
| 3 |
+
size 209696576
|
model-00144-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5875c245365d650f57f6d2c9b022612f18777ae493650741d280d6866d592262
|
| 3 |
+
size 141559656
|
model-00145-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95ea6657191f618e34a71911c2503063562b7b3025cdf153d58b5e3d61c409c6
|
| 3 |
+
size 109052376
|
model-00146-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f785cf7a322572190dd29ee60033330e6ef719e390fbfdc1885799116f9d9060
|
| 3 |
+
size 18874616
|
model-00147-of-00148.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ec9e33be81d1792086401a534b822cd8d52898409bea3bfd5dd1144f901afb3
|
| 3 |
+
size 1398728
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"device": "cpu",
|
| 4 |
+
"do_convert_rgb": true,
|
| 5 |
+
"do_normalize": true,
|
| 6 |
+
"do_rescale": true,
|
| 7 |
+
"do_resize": true,
|
| 8 |
+
"image_mean": [
|
| 9 |
+
0.5,
|
| 10 |
+
0.5,
|
| 11 |
+
0.5
|
| 12 |
+
],
|
| 13 |
+
"image_processor_type": "HYV4VLImageProcessor",
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"max_frames": 1024,
|
| 20 |
+
"max_pixels": 4194304,
|
| 21 |
+
"merge_size": 2,
|
| 22 |
+
"min_frames": 2,
|
| 23 |
+
"min_pixels": 4096,
|
| 24 |
+
"patch_size": 16,
|
| 25 |
+
"resample": 1,
|
| 26 |
+
"rescale_factor": 0.00392156862745098,
|
| 27 |
+
"size": {
|
| 28 |
+
"longest_edge": 4194304,
|
| 29 |
+
"shortest_edge": 4096
|
| 30 |
+
},
|
| 31 |
+
"spatial_patch_size": 1,
|
| 32 |
+
"temporal_patch_size": 1,
|
| 33 |
+
"timestamp_token_per_frame": 6,
|
| 34 |
+
"timestamp_token_reserve": 1000,
|
| 35 |
+
"video_max_image_size": 1024
|
| 36 |
+
},
|
| 37 |
+
"processor_class": "HYV4FlashProcessor",
|
| 38 |
+
"video_processor": {
|
| 39 |
+
"do_convert_rgb": true,
|
| 40 |
+
"do_normalize": true,
|
| 41 |
+
"do_rescale": true,
|
| 42 |
+
"do_resize": true,
|
| 43 |
+
"do_sample_frames": false,
|
| 44 |
+
"fps": 2,
|
| 45 |
+
"image_mean": [
|
| 46 |
+
0.5,
|
| 47 |
+
0.5,
|
| 48 |
+
0.5
|
| 49 |
+
],
|
| 50 |
+
"image_std": [
|
| 51 |
+
0.5,
|
| 52 |
+
0.5,
|
| 53 |
+
0.5
|
| 54 |
+
],
|
| 55 |
+
"max_frames": 2048,
|
| 56 |
+
"max_pixels": 61440000,
|
| 57 |
+
"merge_size": 2,
|
| 58 |
+
"min_frames": 2,
|
| 59 |
+
"min_pixels": 16384,
|
| 60 |
+
"patch_size": 16,
|
| 61 |
+
"resample": 1,
|
| 62 |
+
"rescale_factor": 0.00392156862745098,
|
| 63 |
+
"return_metadata": false,
|
| 64 |
+
"size": {
|
| 65 |
+
"longest_edge": 61440000,
|
| 66 |
+
"shortest_edge": 16384
|
| 67 |
+
},
|
| 68 |
+
"spatial_patch_size": 1,
|
| 69 |
+
"temporal_patch_size": 1,
|
| 70 |
+
"timestamp_token_per_frame": 6,
|
| 71 |
+
"timestamp_token_reserve": 1000,
|
| 72 |
+
"video_max_image_size": 1024,
|
| 73 |
+
"video_processor_type": "HYV4VLVideoProcessor"
|
| 74 |
+
}
|
| 75 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|hy_start:opensource|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|hy_end:opensource|>",
|
| 6 |
+
"image_end_token": "<|hy_image▁end:opensource|>",
|
| 7 |
+
"image_newline_token": "<|hy_image▁newline:opensource|>",
|
| 8 |
+
"image_start_token": "<|hy_image▁start:opensource|>",
|
| 9 |
+
"image_token": "<|hy_image▁pad:opensource|>",
|
| 10 |
+
"is_local": true,
|
| 11 |
+
"local_files_only": false,
|
| 12 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 13 |
+
"model_specific_special_tokens": {
|
| 14 |
+
"image_end_token": "<|hy_image▁end:opensource|>",
|
| 15 |
+
"image_newline_token": "<|hy_image▁newline:opensource|>",
|
| 16 |
+
"image_start_token": "<|hy_image▁start:opensource|>",
|
| 17 |
+
"image_token": "<|hy_image▁pad:opensource|>",
|
| 18 |
+
"video_end_token": "<|hy_video▁end:opensource|>",
|
| 19 |
+
"video_start_token": "<|hy_video▁start:opensource|>",
|
| 20 |
+
"video_token": "<|hy_video▁pad:opensource|>"
|
| 21 |
+
},
|
| 22 |
+
"pad_token": "<|hy_pad:opensource|>",
|
| 23 |
+
"processor_class": "HYV4FlashProcessor",
|
| 24 |
+
"tokenizer_class": "TokenizersBackend",
|
| 25 |
+
"video_end_token": "<|hy_video▁end:opensource|>",
|
| 26 |
+
"video_start_token": "<|hy_video▁start:opensource|>",
|
| 27 |
+
"video_token": "<|hy_video▁pad:opensource|>"
|
| 28 |
+
}
|