Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- LICENSE +202 -0
- README.md +66 -0
- SHA256SUMS.txt +17 -0
- added_tokens.json +9 -0
- chat_template.jinja +195 -0
- config.json +69 -0
- configuration_nanbeige.py +418 -0
- generation_config.json +10 -0
- openvino_detokenizer.bin +3 -0
- openvino_detokenizer.xml +353 -0
- openvino_model.bin +3 -0
- openvino_model.xml +0 -0
- openvino_tokenizer.bin +3 -0
- openvino_tokenizer.xml +816 -0
- special_tokens_map.json +33 -0
- tokenizer.json +3 -0
- tokenizer.model +3 -0
- tokenizer_config.json +102 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Irfanuruchi/Nanbeige4.2-3B-CE-v1.0
|
| 4 |
+
tags:
|
| 5 |
+
- openvino
|
| 6 |
+
- int4
|
| 7 |
+
- text-generation
|
| 8 |
+
- computer-engineering
|
| 9 |
+
- intel
|
| 10 |
+
- npu
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Nanbeige4.2-3B-CE v1.0 — OpenVINO INT4 NPU Candidate
|
| 14 |
+
|
| 15 |
+
INT4-targeted OpenVINO weight-compressed derivative of the validated stateful FP16 artifact.
|
| 16 |
+
|
| 17 |
+
## Provenance
|
| 18 |
+
|
| 19 |
+
- Canonical source revision: `v1.0`
|
| 20 |
+
- Canonical source commit: `171d26c743c6f1f5e3fd49f88c0454448a28c39e`
|
| 21 |
+
- Source OpenVINO artifact: Nanbeige4.2-3B-CE-v1.0-OpenVINO-FP16-Stateful
|
| 22 |
+
|
| 23 |
+
## Compression
|
| 24 |
+
|
| 25 |
+
Created with NNCF 3.3.0 using:
|
| 26 |
+
|
| 27 |
+
- mode: `INT4_SYM`
|
| 28 |
+
- group size: 128
|
| 29 |
+
- ratio: 1.0
|
| 30 |
+
|
| 31 |
+
NNCF reported:
|
| 32 |
+
|
| 33 |
+
- 154/157 layers using symmetric INT4 group-size 128
|
| 34 |
+
- 2/157 layers using asymmetric per-channel INT8 fallback
|
| 35 |
+
- 1/157 layer left floating-point
|
| 36 |
+
- compressed `openvino_model.bin`: 2,645,700,572 bytes
|
| 37 |
+
- FP16 source `openvino_model.bin`: 8,339,601,804 bytes
|
| 38 |
+
- INT4/FP16 model-bin size ratio: 0.3172
|
| 39 |
+
|
| 40 |
+
The compressed stateful IR retains the 3-input / 1-output GenAI interface.
|
| 41 |
+
|
| 42 |
+
A separate stateless structural probe also confirmed that all 44 explicit key/value cache pairs survived compression: 90 inputs, 89 outputs, with all 88 `past_key_values.*` inputs and all 88 `present.*` outputs present.
|
| 43 |
+
|
| 44 |
+
## Intel NPU validation status
|
| 45 |
+
|
| 46 |
+
**Not hardware-validated for successful generation on the tested Intel AI Boost system.**
|
| 47 |
+
|
| 48 |
+
Test machine had 32 GB system RAM and Intel(R) AI Boost.
|
| 49 |
+
|
| 50 |
+
Observed behavior:
|
| 51 |
+
|
| 52 |
+
- OpenVINO 2026.3.1: NPU compilation completed after applying the documented Level Zero allocation workaround, but generation hit a KV-cache output-name lookup failure.
|
| 53 |
+
- OpenVINO 2026.5 nightly (2026-09-03): the previous KV-name failure was no longer observed; NPU compilation completed, but execution failed with `ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY`.
|
| 54 |
+
- A minimum-memory test with a 1-token prompt and very small static prompt/response limits still exhausted practical host-memory headroom during the specialized NPU LLM path.
|
| 55 |
+
- Plain direct stateful NPU compilation rejected the unbounded dynamic state shapes.
|
| 56 |
+
- A fully static explicit-KV compilation probe consumed essentially all available memory on the 32 GB test system and was stopped.
|
| 57 |
+
|
| 58 |
+
Therefore this package is published as an **experimental NPU candidate / structurally validated artifact**, not as production-proven Intel NPU support.
|
| 59 |
+
|
| 60 |
+
## Important quality note
|
| 61 |
+
|
| 62 |
+
Runtime or structural validation is not a factual-quality benchmark. This release preserves the known limitations of the frozen Nanbeige4.2-3B-CE v1.0 checkpoint.
|
| 63 |
+
|
| 64 |
+
## License
|
| 65 |
+
|
| 66 |
+
Apache License 2.0. See `LICENSE`.
|
SHA256SUMS.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
262b22f66560f79d4a9d275dd9606cef111551b762d48afbba86d83dffb34685 added_tokens.json
|
| 2 |
+
5ced81014283211bb50053e016abced7ec87a7c72d79f714df081ab49bbcdaf5 chat_template.jinja
|
| 3 |
+
41f7907bb57614b175df9283005dad6feb5bdca1a811fac4f4372c3791afa157 config.json
|
| 4 |
+
c517227741f0fc007061bde1873138545ce15e67716a062513193c06300c7685 configuration_nanbeige.py
|
| 5 |
+
3bd3ab8e75137ace4a2f1d1095f587e6a5cfeb3d324a16189c0b0dbca3c4a841 generation_config.json
|
| 6 |
+
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
|
| 7 |
+
e4a83e25c3b9c9ac821f32305f03a5766e1398af2af378190ff312ad83eb63d1 openvino_detokenizer.bin
|
| 8 |
+
79a5e5fd3d78e328ef76d16eafab577d43541835b0e6b72ffa55cbeb72b94997 openvino_detokenizer.xml
|
| 9 |
+
a4cc1f373e4d1307f0730eb61ff17f7f84446b0989a52bb72e286590a0bd539d openvino_model.bin
|
| 10 |
+
1e90f82ff70e5eb43e102225caa4a02b0cf6419af650337811c588c9ce1d8c83 openvino_model.xml
|
| 11 |
+
c6f5ace4703428ddfdf8f52d1470878eb1c062fa90832599ae9ce5e21511d61a openvino_tokenizer.bin
|
| 12 |
+
9f07f77700634feb220195ee4d9534d5aab2cf54b8823729a1c65b9e2749e30c openvino_tokenizer.xml
|
| 13 |
+
95050cfa5dc82f2d87737fb3f35521018de023a320de67704f5f89f6a175f78d README.md
|
| 14 |
+
613a79fa552736b1dba5f862cb9f28715f1d120bbb650c608e82573b71572b94 special_tokens_map.json
|
| 15 |
+
1d858a0fc007f22af6ae18bfa1ae52d30e398aa9cd1ea06e7777176869346a3f tokenizer.json
|
| 16 |
+
fb41d04798b714520a9b075727b0226538b7330254299062742c50ec8374bc36 tokenizer.model
|
| 17 |
+
4f10a47f864ff28d9d2d67129bec3746c1b6ca82df1db934a06c05a01b67c905 tokenizer_config.json
|
added_tokens.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</think>": 166104,
|
| 3 |
+
"</tool_call>": 166106,
|
| 4 |
+
"<think>": 166103,
|
| 5 |
+
"<tool_call>": 166105,
|
| 6 |
+
"<|endoftext|>": 166102,
|
| 7 |
+
"<|im_end|>": 166101,
|
| 8 |
+
"<|im_start|>": 166100
|
| 9 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
{%- macro visible_text(content) -%}
|
| 4 |
+
{%- if content is string -%}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 7 |
+
{%- for item in content -%}
|
| 8 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 9 |
+
{{- item.text }}
|
| 10 |
+
{%- elif item is string -%}
|
| 11 |
+
{{- item }}
|
| 12 |
+
{%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%}
|
| 13 |
+
{%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%}
|
| 14 |
+
{{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }}
|
| 15 |
+
{%- endif -%}
|
| 16 |
+
{%- endfor -%}
|
| 17 |
+
{%- else -%}
|
| 18 |
+
{{- content }}
|
| 19 |
+
{%- endif -%}
|
| 20 |
+
{%- endmacro -%}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
{%- set tool_call_format = tool_call_format if tool_call_format is defined else 'xml' %}
|
| 24 |
+
{%- if tools %}
|
| 25 |
+
{{- '<|im_start|>system\n' }}
|
| 26 |
+
{%- if messages|length > 0 and messages[0].get('role', '') == 'system' %}
|
| 27 |
+
{{- visible_text(messages[0].content) + '\n\n' }}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{{- '你是一位工具函数调用专家,你会得到一个问题和一组可能的工具函数。根据问题,你需要进行一个或多个函数/工具调用以实现目的,请尽量尝试探索通过工具解决问题。\n如果没有一个函数可以使用,请直接使用自然语言回复用户。\n如果给定的问题缺少函数所需的参数,请使用自然语言进行提问,向用户询问必要信息。\n如果调用结果已经足够回答用户问题,请对历史结果进行总结,使用自然语言回复用户。' }}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
|
| 32 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 33 |
+
{%- for tool in tools %}
|
| 34 |
+
{{- "\n" }}
|
| 35 |
+
{{- tool | tojson }}
|
| 36 |
+
{%- endfor %}
|
| 37 |
+
|
| 38 |
+
{%- if tool_call_format == 'json' %}
|
| 39 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n" }}
|
| 40 |
+
{{- '<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n' }}
|
| 41 |
+
{%- else %}
|
| 42 |
+
{{- "\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n" }}
|
| 43 |
+
{{- '<tool_call>
|
| 44 |
+
<function=example_function_name>
|
| 45 |
+
<parameter=example_parameter_1>
|
| 46 |
+
value_1
|
| 47 |
+
</parameter>
|
| 48 |
+
<parameter=example_parameter_2>
|
| 49 |
+
This is the value for the second parameter
|
| 50 |
+
that can span
|
| 51 |
+
multiple lines
|
| 52 |
+
</parameter>
|
| 53 |
+
</function>
|
| 54 |
+
</tool_call><|im_end|>\n' }}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
|
| 57 |
+
{%- else %}
|
| 58 |
+
{%- if messages|length > 0 and messages[0].get('role', '') == 'system' %}
|
| 59 |
+
{{- '<|im_start|>system\n' + visible_text(messages[0].content) + '<|im_end|>\n' }}
|
| 60 |
+
{%- else %}
|
| 61 |
+
{{- '<|im_start|>system\n你是南北阁,一款由BOSS直聘自主研发并训练的专业大语言模型。<|im_end|>\n' }}
|
| 62 |
+
{%- endif %}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
|
| 65 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 66 |
+
{%- for message in messages[::-1] %}
|
| 67 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 68 |
+
{%- if ns.multi_step_tool and message.get('role', '') == "user" and visible_text(message.content) is string and not(visible_text(message.content).startswith('<tool_response>') and visible_text(message.content).endswith('</tool_response>')) %}
|
| 69 |
+
{%- set ns.multi_step_tool = false %}
|
| 70 |
+
{%- set ns.last_query_index = index %}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{%- endfor %}
|
| 73 |
+
|
| 74 |
+
{%- for message in messages %}
|
| 75 |
+
{%- if visible_text(message.content) is string %}
|
| 76 |
+
{%- set content = visible_text(message.content) %}
|
| 77 |
+
{%- else %}
|
| 78 |
+
{%- set content = '' %}
|
| 79 |
+
{%- endif %}
|
| 80 |
+
|
| 81 |
+
{%- if message.get('role', '') == "system" %}
|
| 82 |
+
{%- if not loop.first %}
|
| 83 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
|
| 86 |
+
{%- elif message.get('role', '') == "assistant" %}
|
| 87 |
+
{%- set reasoning_content = '' %}
|
| 88 |
+
{%- if message.reasoning_content is string %}
|
| 89 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 90 |
+
{%- else %}
|
| 91 |
+
{%- if '</think>' in content %}
|
| 92 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 93 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n').rstrip('\n') %}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{%- endif %}
|
| 96 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 97 |
+
|
| 98 |
+
{%- if (preserve_thinking is defined and preserve_thinking is false) and (loop.index0 < ns.last_query_index) %}
|
| 99 |
+
{{- '<|im_start|>' + message.get('role', '') + '\n<think>\n\n</think>\n\n' + content }}
|
| 100 |
+
{%- else %}
|
| 101 |
+
{{- '<|im_start|>' + message.get('role', '') + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
|
| 104 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 105 |
+
{%- if tool_call_format == 'json' %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 108 |
+
{{- '\n' }}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if tool_call.function %}
|
| 111 |
+
{%- set tool_call = tool_call.function %}
|
| 112 |
+
{%- endif %}
|
| 113 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 114 |
+
{{- tool_call.name }}
|
| 115 |
+
{{- '", "arguments": ' }}
|
| 116 |
+
{%- if tool_call.arguments is string %}
|
| 117 |
+
{{- tool_call.arguments }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- tool_call.arguments | tojson }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{{- '}\n</tool_call>' }}
|
| 122 |
+
{%- endfor %}
|
| 123 |
+
{%- else %}
|
| 124 |
+
{%- for tool_call in message.tool_calls %}
|
| 125 |
+
{%- if tool_call.function is defined %}
|
| 126 |
+
{%- set tool_call = tool_call.function %}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
|
| 129 |
+
{%- if loop.first %}
|
| 130 |
+
{%- if content|trim %}
|
| 131 |
+
{{- '
|
| 132 |
+
|
| 133 |
+
<tool_call>
|
| 134 |
+
<function=' + tool_call.name + '>
|
| 135 |
+
' }}
|
| 136 |
+
{%- else %}
|
| 137 |
+
{{- '<tool_call>
|
| 138 |
+
<function=' + tool_call.name + '>
|
| 139 |
+
' }}
|
| 140 |
+
{%- endif %}
|
| 141 |
+
{%- else %}
|
| 142 |
+
{{- '
|
| 143 |
+
<tool_call>
|
| 144 |
+
<function=' + tool_call.name + '>
|
| 145 |
+
' }}
|
| 146 |
+
{%- endif %}
|
| 147 |
+
|
| 148 |
+
{%- if tool_call.arguments is defined %}
|
| 149 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 150 |
+
{{- '<parameter=' + args_name + '>
|
| 151 |
+
' }}
|
| 152 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 153 |
+
{{- args_value }}
|
| 154 |
+
{{- '
|
| 155 |
+
</parameter>
|
| 156 |
+
' }}
|
| 157 |
+
{%- endfor %}
|
| 158 |
+
{%- endif %}
|
| 159 |
+
{{- '</function>
|
| 160 |
+
</tool_call>' }}
|
| 161 |
+
{%- endfor %}
|
| 162 |
+
{%- endif %}
|
| 163 |
+
{%- endif %}
|
| 164 |
+
{{- '<|im_end|>\n' }}
|
| 165 |
+
|
| 166 |
+
{%- elif message.get('role', '') == "tool" %}
|
| 167 |
+
{%- if loop.previtem and loop.previtem.get('role', '') != "tool" %}
|
| 168 |
+
{{- '<|im_start|>user' }}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{{- '\n<tool_response>\n' }}
|
| 171 |
+
{{- content }}
|
| 172 |
+
{{- '\n</tool_response>' }}
|
| 173 |
+
{%- if loop.last or loop.nextitem.get('role', '') != "tool" %}
|
| 174 |
+
{{- '<|im_end|>\n' }}
|
| 175 |
+
{%- endif %}
|
| 176 |
+
{%- elif message.get('role', '') != '' %}
|
| 177 |
+
{{- '<|im_start|>' + message.get('role', '') + '\n' + content + '<|im_end|>' + '\n' }}
|
| 178 |
+
{%- endif %}
|
| 179 |
+
{%- endfor %}
|
| 180 |
+
|
| 181 |
+
{%- if add_generation_prompt %}
|
| 182 |
+
{{- '<|im_start|>assistant\n' }}
|
| 183 |
+
|
| 184 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 185 |
+
{{- '<think>
|
| 186 |
+
|
| 187 |
+
</think>
|
| 188 |
+
|
| 189 |
+
' }}
|
| 190 |
+
{%- else %}
|
| 191 |
+
{{- '<think>
|
| 192 |
+
' }}
|
| 193 |
+
{%- endif %}
|
| 194 |
+
|
| 195 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"NanbeigeForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_nanbeige.NanbeigeConfig",
|
| 9 |
+
"AutoModel": "Nanbeige/Nanbeige4.2-3B--modeling_nanbeige.NanbeigeModel",
|
| 10 |
+
"AutoModelForCausalLM": "Nanbeige/Nanbeige4.2-3B--modeling_nanbeige.NanbeigeForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"bos_token_id": 166100,
|
| 13 |
+
"depth_attention_recent_window": 0,
|
| 14 |
+
"depth_attention_static_anchor_once": true,
|
| 15 |
+
"depth_attention_stride": null,
|
| 16 |
+
"dtype": "float16",
|
| 17 |
+
"emb_neighbor_num": null,
|
| 18 |
+
"emb_split_num": null,
|
| 19 |
+
"emb_tp_num": null,
|
| 20 |
+
"enable_depth_attention": false,
|
| 21 |
+
"enable_double_loop_split": false,
|
| 22 |
+
"enable_h_res_identity": false,
|
| 23 |
+
"enable_hyper_connection": false,
|
| 24 |
+
"enable_mhc": false,
|
| 25 |
+
"eos_token_id": 166101,
|
| 26 |
+
"head_dim": 128,
|
| 27 |
+
"hidden_act": "silu",
|
| 28 |
+
"hidden_size": 3072,
|
| 29 |
+
"initializer_range": 0.02,
|
| 30 |
+
"insert_ngram_layer_idx": [],
|
| 31 |
+
"intermediate_size": 10752,
|
| 32 |
+
"kv_channels": 128,
|
| 33 |
+
"loop_loss_weights": [],
|
| 34 |
+
"loop_middle_layers": null,
|
| 35 |
+
"loop_share_kv": false,
|
| 36 |
+
"max_length": null,
|
| 37 |
+
"max_position_embeddings": 262144,
|
| 38 |
+
"mhc_diff_for_loop": false,
|
| 39 |
+
"mhc_double_stream_position_for_loop": null,
|
| 40 |
+
"mhc_identity_nohresparam": false,
|
| 41 |
+
"mhc_init_gating_factor": 0.01,
|
| 42 |
+
"mhc_sinkhorn_iterations": 20,
|
| 43 |
+
"mlp_bias": false,
|
| 44 |
+
"model_type": "nanbeige",
|
| 45 |
+
"ngram_compressed_tokenizer": false,
|
| 46 |
+
"ngram_embedding_hidden_size": null,
|
| 47 |
+
"ngram_fused_mode": "average",
|
| 48 |
+
"ngram_insert_all_layers": false,
|
| 49 |
+
"ngram_layer_downproject_size": null,
|
| 50 |
+
"ngram_mod_force_prime": false,
|
| 51 |
+
"ngram_vocab_size_ratio": null,
|
| 52 |
+
"num_attention_heads": 48,
|
| 53 |
+
"num_hidden_layers": 22,
|
| 54 |
+
"num_key_value_heads": 8,
|
| 55 |
+
"num_loops": 2,
|
| 56 |
+
"num_residual_streams": 4,
|
| 57 |
+
"pad_token_id": 0,
|
| 58 |
+
"pretraining_tp": 1,
|
| 59 |
+
"qk_layernorm": false,
|
| 60 |
+
"rms_norm_eps": 1e-05,
|
| 61 |
+
"rope_scaling": null,
|
| 62 |
+
"rope_theta": 70000000,
|
| 63 |
+
"skip_loop_final_norm": false,
|
| 64 |
+
"skip_ngram_for_input": false,
|
| 65 |
+
"tie_word_embeddings": false,
|
| 66 |
+
"transformers_version": "4.57.6",
|
| 67 |
+
"use_cache": true,
|
| 68 |
+
"vocab_size": 166144
|
| 69 |
+
}
|
configuration_nanbeige.py
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 |
+
# you may not use this file except in compliance with the License.
|
| 4 |
+
# You may obtain a copy of the License at
|
| 5 |
+
#
|
| 6 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 7 |
+
#
|
| 8 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 9 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 10 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 11 |
+
# See the License for the specific language governing permissions and
|
| 12 |
+
# limitations under the License.
|
| 13 |
+
"""Nanbeige model configuration."""
|
| 14 |
+
|
| 15 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 16 |
+
from transformers.utils import logging
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
logger = logging.get_logger(__name__)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class NanbeigeConfig(PretrainedConfig):
|
| 23 |
+
r"""
|
| 24 |
+
This is the configuration class to store the configuration of a [`NanbeigeModel`]. It is used to instantiate a Nanbeige model
|
| 25 |
+
according to the specified arguments, defining the model architecture.
|
| 26 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 27 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 28 |
+
Args:
|
| 29 |
+
vocab_size (`int`, *optional*, defaults to 32000):
|
| 30 |
+
Vocabulary size of the Nanbeige model. Defines the number of different tokens that can be represented by the
|
| 31 |
+
`input_ids` passed when calling [`NanbeigeModel`]
|
| 32 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
| 33 |
+
Dimension of the hidden representations.
|
| 34 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
| 35 |
+
Dimension of the MLP representations.
|
| 36 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
| 37 |
+
Number of hidden layers in the Transformer decoder.
|
| 38 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
| 39 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 40 |
+
head_dim (`int`, *optional*):
|
| 41 |
+
Dimension of each attention head. If unset, defaults to `hidden_size // num_attention_heads`.
|
| 42 |
+
num_key_value_heads (`int`, *optional*):
|
| 43 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 44 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 45 |
+
`num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
| 46 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
| 47 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
| 48 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
| 49 |
+
`num_attention_heads`.
|
| 50 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 51 |
+
The non-linear activation function (function or string) in the decoder.
|
| 52 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
| 53 |
+
The maximum sequence length that this model might ever be used with.
|
| 54 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
| 55 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
| 56 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 57 |
+
The epsilon used by the rms normalization layers.
|
| 58 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 59 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 60 |
+
relevant if `config.is_decoder=True`.
|
| 61 |
+
pad_token_id (`int`, *optional*):
|
| 62 |
+
Padding token id.
|
| 63 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
| 64 |
+
Beginning of stream token id.
|
| 65 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
| 66 |
+
End of stream token id.
|
| 67 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
| 68 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
| 69 |
+
document](https://huggingface.co/docs/transformers/main/perf_train_gpu_many#tensor-parallelism) to understand more about it. This value is
|
| 70 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
| 71 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
| 72 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 73 |
+
Whether to tie weight embeddings
|
| 74 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
| 75 |
+
The base period of the RoPE embeddings.
|
| 76 |
+
rope_scaling (`Dict`, *optional*):
|
| 77 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
| 78 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
| 79 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
| 80 |
+
`max_position_embeddings` to the expected new maximum. See the following thread for more information on how
|
| 81 |
+
these scaling strategies behave:
|
| 82 |
+
https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
|
| 83 |
+
experimental feature, subject to breaking API changes in future versions.
|
| 84 |
+
attention_bias (`bool`, *optional*, defaults to `False`):
|
| 85 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 86 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 87 |
+
The dropout ratio for the attention probabilities.
|
| 88 |
+
mlp_bias (`bool`, *optional*, defaults to `False`):
|
| 89 |
+
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.
|
| 90 |
+
qk_layernorm (`bool`, *optional*, defaults to `False`):
|
| 91 |
+
Whether to use LayerNorm on query and key states before applying attention.
|
| 92 |
+
emb_neighbor_num (`int`, *optional*):
|
| 93 |
+
Maximum N-gram length for N-gram embeddings. This parameter determines the context window size for N-gram computation. Higher values capture
|
| 94 |
+
longer-range lexical patterns but increase memory usage. If None, N-gram embeddings are disabled.
|
| 95 |
+
emb_split_num (`int`, *optional*):
|
| 96 |
+
Number of hash functions (or splits) to use for N-gram embeddings. Multiple hash functions help improve the quality of N-gram representations.
|
| 97 |
+
Required if emb_neighbor_num is set.
|
| 98 |
+
ngram_vocab_size_ratio (`float`, *optional*):
|
| 99 |
+
Ratio multiplier for N-gram vocabulary size relative to the base vocabulary size. The N-gram vocabulary
|
| 100 |
+
size is calculated as `vocab_size * ngram_vocab_size_ratio`. Required if emb_neighbor_num is set.
|
| 101 |
+
ngram_mod_force_prime (`bool`, *optional*, defaults to `False`):
|
| 102 |
+
Whether to use consecutive prime numbers greater than the N-gram base vocabulary size as hash modulo
|
| 103 |
+
dimensions for N-gram subtables, and the first prime greater than vocab_size as the N-gram hash base.
|
| 104 |
+
ngram_embedding_hidden_size (`int`, *optional*):
|
| 105 |
+
Total hidden size used to split N-gram embedding table dimensions. If None, uses `hidden_size`.
|
| 106 |
+
ngram_fused_mode (`str`, *optional*, defaults to `"average"`):
|
| 107 |
+
How N-gram embeddings are fused into token embeddings. `"average"` preserves the existing per-table
|
| 108 |
+
projector and averaging behavior. `"concat"` concatenates raw N-gram table embeddings, projects once to
|
| 109 |
+
`hidden_size`, and adds the projected N-gram embedding to the token embedding.
|
| 110 |
+
emb_tp_num (`int`, *optional*):
|
| 111 |
+
Tensor parallel padding multiplier for N-gram embeddings. The N-gram embedding vocabulary size is padded
|
| 112 |
+
to the nearest multiple of emb_tp_num. This ensures compatibility with tensor parallel training in Megatron.
|
| 113 |
+
Required if emb_neighbor_num is set.
|
| 114 |
+
ngram_compressed_tokenizer (`bool`, *optional*, defaults to `False`):
|
| 115 |
+
Whether to use compressed tokenizer for N-gram computation. When enabled, the model's tokenizer is used to
|
| 116 |
+
construct a compressed tokenizer similar to the one in engram_demo_v1.py, which normalizes and deduplicates
|
| 117 |
+
tokens before computing N-gram hashes.
|
| 118 |
+
skip_ngram_for_input (`bool`, *optional*, defaults to `False`):
|
| 119 |
+
Whether to skip adding N-gram embeddings to the input embedding.
|
| 120 |
+
insert_ngram_layer_idx (`List[int]`, *optional*):
|
| 121 |
+
0-based decoder layer indices where averaged N-gram embeddings are fused before attention.
|
| 122 |
+
ngram_insert_all_layers (`bool`, *optional*, defaults to `False`):
|
| 123 |
+
Whether to fuse averaged N-gram embeddings before attention in every decoder layer.
|
| 124 |
+
ngram_layer_downproject_size (`int`, *optional*):
|
| 125 |
+
Optional hidden size for N-gram layer fusion projections. If None, fusion uses `hidden_size`.
|
| 126 |
+
num_loops (`int`, *optional*, defaults to 1):
|
| 127 |
+
Number of times the complete decoder-layer stack is executed with shared parameters. Increasing this value
|
| 128 |
+
increases the model's effective depth and FLOPs without adding a separate set of decoder-layer weights.
|
| 129 |
+
This value is ignored when `loop_loss_weights` is non-empty or `enable_double_loop_split=True`.
|
| 130 |
+
loop_loss_weights (`List[float]`, *optional*):
|
| 131 |
+
Weights associated with intermediate loop outputs during multi-loop training. When this list is non-empty,
|
| 132 |
+
the model executes `len(loop_loss_weights) + 1` loops instead of using `num_loops`. For the standard loop
|
| 133 |
+
layout, the weights must sum to at most 1.0. Defaults to an empty list.
|
| 134 |
+
skip_loop_final_norm (`bool`, *optional*, defaults to `False`):
|
| 135 |
+
Whether to skip the final RMS normalization between loops. If `True`, normalization is applied only after
|
| 136 |
+
the last loop; if `False`, every loop output is normalized before it is passed to the next loop.
|
| 137 |
+
enable_double_loop_split (`bool`, *optional*, defaults to `False`):
|
| 138 |
+
Whether to enable LoopSplit. LoopSplit keeps the outer decoder layers unlooped and repeatedly executes a
|
| 139 |
+
contiguous middle block, providing different effective depths for different parts of the network. When
|
| 140 |
+
enabled, the execution order is controlled by `loop_middle_layers` rather than `num_loops`.
|
| 141 |
+
loop_middle_layers (`int`, *optional*):
|
| 142 |
+
Number of contiguous middle decoder layers repeatedly executed by LoopSplit. It must be a positive factor
|
| 143 |
+
of `num_hidden_layers`. If omitted while LoopSplit is enabled, it defaults to half of
|
| 144 |
+
`num_hidden_layers`, which therefore must be even.
|
| 145 |
+
loop_share_kv (`bool`, *optional*, defaults to `False`):
|
| 146 |
+
Whether repeated executions of a LoopSplit middle layer reuse the key and value states produced by that
|
| 147 |
+
layer's first execution. Requires `enable_double_loop_split=True`.
|
| 148 |
+
mhc_diff_for_loop (`bool`, *optional*, defaults to `False`):
|
| 149 |
+
Whether each repeated execution of a LoopSplit middle layer uses separate mHC connection modules instead
|
| 150 |
+
of sharing one set across repetitions. Requires both `enable_double_loop_split=True` and `enable_mhc=True`.
|
| 151 |
+
mhc_double_stream_position_for_loop (`str`, *optional*):
|
| 152 |
+
Selects where LoopSplit doubles the configured number of residual streams. Accepted values are `"mid"`,
|
| 153 |
+
which doubles streams in the looped middle block, and `"edge"`, which doubles streams in the unlooped outer
|
| 154 |
+
blocks. Requires `enable_double_loop_split=True`.
|
| 155 |
+
enable_hyper_connection (`bool`, *optional*, defaults to `False`):
|
| 156 |
+
Whether to replace the standard single residual path with multiple residual streams connected around each
|
| 157 |
+
attention and MLP sublayer by learned hyper-connection modules.
|
| 158 |
+
enable_mhc (`bool`, *optional*, defaults to `False`):
|
| 159 |
+
Whether to use manifold-constrained hyper-connections (mHC), which constrain the learned residual-stream
|
| 160 |
+
mixing matrices with Sinkhorn normalization. Requires `enable_hyper_connection=True`.
|
| 161 |
+
enable_h_res_identity (`bool`, *optional*, defaults to `False`):
|
| 162 |
+
Whether the residual-stream mixing matrix includes an explicit identity component. Requires
|
| 163 |
+
`enable_hyper_connection=True`.
|
| 164 |
+
mhc_identity_nohresparam (`bool`, *optional*, defaults to `False`):
|
| 165 |
+
Whether the identity component is used without a separately learned residual mixing parameter. Requires
|
| 166 |
+
both `enable_mhc=True` and `enable_h_res_identity=True`.
|
| 167 |
+
num_residual_streams (`int`, *optional*, defaults to 4):
|
| 168 |
+
Base number of residual streams used by hyper-connections. It must be at least 2 when
|
| 169 |
+
`enable_hyper_connection=True`; LoopSplit may double it in the region selected by
|
| 170 |
+
`mhc_double_stream_position_for_loop`.
|
| 171 |
+
mhc_sinkhorn_iterations (`int`, *optional*, defaults to 20):
|
| 172 |
+
Number of Sinkhorn normalization iterations used to constrain mHC residual-stream mixing matrices. It must
|
| 173 |
+
be at least 1 when `enable_mhc=True`.
|
| 174 |
+
mhc_init_gating_factor (`float`, *optional*, defaults to 0.01):
|
| 175 |
+
Initial scale of the learned mHC gating terms that perturb the identity-like initialization of the
|
| 176 |
+
hyper-connection matrices.
|
| 177 |
+
enable_depth_attention (`bool`, *optional*, defaults to `False`):
|
| 178 |
+
Whether to enable depth attention. At each decoder layer, the current query selects and mixes value states
|
| 179 |
+
from cached anchor depths before normal token-level self-attention is applied.
|
| 180 |
+
depth_attention_stride (`int`, *optional*):
|
| 181 |
+
Layer interval at which key/value states are added as depth-attention anchors. It must be positive and
|
| 182 |
+
defaults to `num_hidden_layers // 2` when depth attention is enabled.
|
| 183 |
+
depth_attention_recent_window (`int`, *optional*, defaults to 0):
|
| 184 |
+
Reserved size of a recent-depth window in addition to anchor depths. The current anchor-only implementation
|
| 185 |
+
requires this value to be 0.
|
| 186 |
+
depth_attention_static_anchor_once (`bool`, *optional*, defaults to `True`):
|
| 187 |
+
Whether depth-attention anchors are collected once and reused across repeated LoopSplit executions. This
|
| 188 |
+
must be `True` when depth attention and LoopSplit are enabled together.
|
| 189 |
+
```python
|
| 190 |
+
>>> from transformers import NanbeigeModel, NanbeigeConfig
|
| 191 |
+
>>> # Initializing a Nanbeige style configuration
|
| 192 |
+
>>> configuration = NanbeigeConfig()
|
| 193 |
+
>>> # Initializing a model from the Nanbeige style configuration
|
| 194 |
+
>>> model = NanbeigeModel(configuration)
|
| 195 |
+
>>> # Accessing the model configuration
|
| 196 |
+
>>> configuration = model.config
|
| 197 |
+
```"""
|
| 198 |
+
|
| 199 |
+
model_type = "nanbeige"
|
| 200 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 201 |
+
|
| 202 |
+
def __init__(
|
| 203 |
+
self,
|
| 204 |
+
vocab_size=32000,
|
| 205 |
+
hidden_size=4096,
|
| 206 |
+
intermediate_size=11008,
|
| 207 |
+
num_hidden_layers=32,
|
| 208 |
+
num_attention_heads=32,
|
| 209 |
+
num_key_value_heads=None,
|
| 210 |
+
head_dim=None,
|
| 211 |
+
hidden_act="silu",
|
| 212 |
+
max_position_embeddings=2048,
|
| 213 |
+
initializer_range=0.02,
|
| 214 |
+
rms_norm_eps=1e-6,
|
| 215 |
+
use_cache=True,
|
| 216 |
+
pad_token_id=None,
|
| 217 |
+
bos_token_id=1,
|
| 218 |
+
eos_token_id=2,
|
| 219 |
+
pretraining_tp=1,
|
| 220 |
+
tie_word_embeddings=False,
|
| 221 |
+
rope_theta=10000.0,
|
| 222 |
+
rope_scaling=None,
|
| 223 |
+
attention_bias=False,
|
| 224 |
+
attention_dropout=0.0,
|
| 225 |
+
mlp_bias=False,
|
| 226 |
+
qk_layernorm=False,
|
| 227 |
+
emb_neighbor_num=None,
|
| 228 |
+
emb_split_num=None,
|
| 229 |
+
ngram_vocab_size_ratio=None,
|
| 230 |
+
ngram_mod_force_prime=False,
|
| 231 |
+
ngram_embedding_hidden_size=None,
|
| 232 |
+
ngram_fused_mode="average",
|
| 233 |
+
emb_tp_num=None,
|
| 234 |
+
ngram_compressed_tokenizer=False,
|
| 235 |
+
skip_ngram_for_input=False,
|
| 236 |
+
insert_ngram_layer_idx=None,
|
| 237 |
+
ngram_insert_all_layers=False,
|
| 238 |
+
ngram_layer_downproject_size=None,
|
| 239 |
+
num_loops=1,
|
| 240 |
+
loop_loss_weights=None,
|
| 241 |
+
skip_loop_final_norm=False,
|
| 242 |
+
enable_double_loop_split=False,
|
| 243 |
+
loop_middle_layers=None,
|
| 244 |
+
loop_share_kv=False,
|
| 245 |
+
mhc_diff_for_loop=False,
|
| 246 |
+
mhc_double_stream_position_for_loop=None,
|
| 247 |
+
enable_hyper_connection=False,
|
| 248 |
+
enable_mhc=False,
|
| 249 |
+
enable_h_res_identity=False,
|
| 250 |
+
mhc_identity_nohresparam=False,
|
| 251 |
+
num_residual_streams=4,
|
| 252 |
+
mhc_sinkhorn_iterations=20,
|
| 253 |
+
mhc_init_gating_factor=0.01,
|
| 254 |
+
enable_depth_attention=False,
|
| 255 |
+
depth_attention_stride=None,
|
| 256 |
+
depth_attention_recent_window=0,
|
| 257 |
+
depth_attention_static_anchor_once=True,
|
| 258 |
+
**kwargs,
|
| 259 |
+
):
|
| 260 |
+
self.vocab_size = vocab_size
|
| 261 |
+
self.max_position_embeddings = max_position_embeddings
|
| 262 |
+
self.hidden_size = hidden_size
|
| 263 |
+
self.intermediate_size = intermediate_size
|
| 264 |
+
self.num_hidden_layers = num_hidden_layers
|
| 265 |
+
self.num_attention_heads = num_attention_heads
|
| 266 |
+
self.head_dim = head_dim if head_dim is not None else hidden_size // num_attention_heads
|
| 267 |
+
|
| 268 |
+
# for backward compatibility
|
| 269 |
+
if num_key_value_heads is None:
|
| 270 |
+
num_key_value_heads = num_attention_heads
|
| 271 |
+
|
| 272 |
+
self.num_key_value_heads = num_key_value_heads
|
| 273 |
+
self.hidden_act = hidden_act
|
| 274 |
+
self.initializer_range = initializer_range
|
| 275 |
+
self.rms_norm_eps = rms_norm_eps
|
| 276 |
+
self.pretraining_tp = pretraining_tp
|
| 277 |
+
self.use_cache = use_cache
|
| 278 |
+
self.rope_theta = rope_theta
|
| 279 |
+
self.rope_scaling = rope_scaling
|
| 280 |
+
self._rope_scaling_validation()
|
| 281 |
+
self.attention_bias = attention_bias
|
| 282 |
+
self.attention_dropout = attention_dropout
|
| 283 |
+
self.mlp_bias = mlp_bias
|
| 284 |
+
self.qk_layernorm = qk_layernorm
|
| 285 |
+
self.emb_neighbor_num = emb_neighbor_num
|
| 286 |
+
self.emb_split_num = emb_split_num
|
| 287 |
+
self.ngram_vocab_size_ratio = ngram_vocab_size_ratio
|
| 288 |
+
self.ngram_mod_force_prime = ngram_mod_force_prime
|
| 289 |
+
self.ngram_embedding_hidden_size = ngram_embedding_hidden_size
|
| 290 |
+
self.ngram_fused_mode = ngram_fused_mode
|
| 291 |
+
self.emb_tp_num = emb_tp_num
|
| 292 |
+
self.ngram_compressed_tokenizer = ngram_compressed_tokenizer
|
| 293 |
+
self.skip_ngram_for_input = skip_ngram_for_input
|
| 294 |
+
self.insert_ngram_layer_idx = insert_ngram_layer_idx if insert_ngram_layer_idx is not None else []
|
| 295 |
+
self.ngram_insert_all_layers = ngram_insert_all_layers
|
| 296 |
+
self.ngram_layer_downproject_size = ngram_layer_downproject_size
|
| 297 |
+
self.num_loops = num_loops
|
| 298 |
+
self.loop_loss_weights = loop_loss_weights if loop_loss_weights is not None else []
|
| 299 |
+
self.skip_loop_final_norm = skip_loop_final_norm
|
| 300 |
+
self.enable_double_loop_split = enable_double_loop_split
|
| 301 |
+
self.loop_middle_layers = loop_middle_layers
|
| 302 |
+
self.loop_share_kv = loop_share_kv
|
| 303 |
+
self.mhc_diff_for_loop = mhc_diff_for_loop
|
| 304 |
+
self.mhc_double_stream_position_for_loop = mhc_double_stream_position_for_loop
|
| 305 |
+
self.enable_hyper_connection = enable_hyper_connection
|
| 306 |
+
self.enable_mhc = enable_mhc
|
| 307 |
+
self.enable_h_res_identity = enable_h_res_identity
|
| 308 |
+
self.mhc_identity_nohresparam = mhc_identity_nohresparam
|
| 309 |
+
self.num_residual_streams = num_residual_streams
|
| 310 |
+
self.mhc_sinkhorn_iterations = mhc_sinkhorn_iterations
|
| 311 |
+
self.mhc_init_gating_factor = mhc_init_gating_factor
|
| 312 |
+
self.enable_depth_attention = enable_depth_attention
|
| 313 |
+
self.depth_attention_stride = depth_attention_stride
|
| 314 |
+
self.depth_attention_recent_window = depth_attention_recent_window
|
| 315 |
+
self.depth_attention_static_anchor_once = depth_attention_static_anchor_once
|
| 316 |
+
self._hyper_connection_validation()
|
| 317 |
+
|
| 318 |
+
super().__init__(
|
| 319 |
+
pad_token_id=pad_token_id,
|
| 320 |
+
bos_token_id=bos_token_id,
|
| 321 |
+
eos_token_id=eos_token_id,
|
| 322 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 323 |
+
**kwargs,
|
| 324 |
+
)
|
| 325 |
+
|
| 326 |
+
def _rope_scaling_validation(self):
|
| 327 |
+
"""
|
| 328 |
+
Validate the `rope_scaling` configuration.
|
| 329 |
+
"""
|
| 330 |
+
if self.rope_scaling is None:
|
| 331 |
+
return
|
| 332 |
+
|
| 333 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
|
| 334 |
+
raise ValueError(
|
| 335 |
+
"`rope_scaling` must be a dictionary with two fields, `type` and `factor`, " f"got {self.rope_scaling}"
|
| 336 |
+
)
|
| 337 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
| 338 |
+
rope_scaling_factor = self.rope_scaling.get("factor", None)
|
| 339 |
+
if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
|
| 340 |
+
raise ValueError(
|
| 341 |
+
f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
|
| 342 |
+
)
|
| 343 |
+
if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
|
| 344 |
+
raise ValueError(f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}")
|
| 345 |
+
|
| 346 |
+
def _hyper_connection_validation(self):
|
| 347 |
+
if self.mhc_diff_for_loop and not self.enable_double_loop_split:
|
| 348 |
+
raise ValueError("mhc_diff_for_loop requires enable_double_loop_split=True.")
|
| 349 |
+
if self.mhc_diff_for_loop and not self.enable_mhc:
|
| 350 |
+
raise ValueError("mhc_diff_for_loop requires enable_mhc=True.")
|
| 351 |
+
if self.loop_share_kv and not self.enable_double_loop_split:
|
| 352 |
+
raise ValueError("loop_share_kv requires enable_double_loop_split=True.")
|
| 353 |
+
if self.enable_depth_attention:
|
| 354 |
+
if self.num_hidden_layers <= 0:
|
| 355 |
+
raise ValueError("enable_depth_attention requires num_hidden_layers to be greater than 0.")
|
| 356 |
+
if self.depth_attention_stride is None:
|
| 357 |
+
self.depth_attention_stride = self.num_hidden_layers // 2
|
| 358 |
+
if self.depth_attention_stride <= 0:
|
| 359 |
+
raise ValueError("depth_attention_stride must be greater than 0.")
|
| 360 |
+
if self.depth_attention_recent_window < 0:
|
| 361 |
+
raise ValueError("depth_attention_recent_window must be >= 0.")
|
| 362 |
+
if self.depth_attention_recent_window != 0:
|
| 363 |
+
raise ValueError("anchor-only Depth-Attention requires depth_attention_recent_window == 0.")
|
| 364 |
+
if self.enable_double_loop_split and not self.depth_attention_static_anchor_once:
|
| 365 |
+
raise ValueError(
|
| 366 |
+
"enable_depth_attention with double-loop split requires "
|
| 367 |
+
"depth_attention_static_anchor_once=True."
|
| 368 |
+
)
|
| 369 |
+
if self.mhc_double_stream_position_for_loop is not None:
|
| 370 |
+
if self.mhc_double_stream_position_for_loop not in ("mid", "edge"):
|
| 371 |
+
raise ValueError("mhc_double_stream_position_for_loop must be one of: mid, edge.")
|
| 372 |
+
if not self.enable_double_loop_split:
|
| 373 |
+
raise ValueError(
|
| 374 |
+
"mhc_double_stream_position_for_loop requires enable_double_loop_split=True."
|
| 375 |
+
)
|
| 376 |
+
if (self.enable_mhc or self.enable_h_res_identity) and not self.enable_hyper_connection:
|
| 377 |
+
raise ValueError(
|
| 378 |
+
"enable_mhc/enable_h_res_identity require enable_hyper_connection=True."
|
| 379 |
+
)
|
| 380 |
+
if self.mhc_identity_nohresparam:
|
| 381 |
+
if not self.enable_h_res_identity:
|
| 382 |
+
raise ValueError("mhc_identity_nohresparam requires enable_h_res_identity=True.")
|
| 383 |
+
if not self.enable_mhc:
|
| 384 |
+
raise ValueError("mhc_identity_nohresparam requires enable_mhc=True.")
|
| 385 |
+
if self.enable_hyper_connection and self.num_residual_streams < 2:
|
| 386 |
+
raise ValueError("num_residual_streams must be >= 2 when enable_hyper_connection=True.")
|
| 387 |
+
if self.enable_mhc and self.mhc_sinkhorn_iterations < 1:
|
| 388 |
+
raise ValueError("mhc_sinkhorn_iterations must be >= 1 when enable_mhc=True.")
|
| 389 |
+
if self.ngram_insert_all_layers and self.insert_ngram_layer_idx:
|
| 390 |
+
raise ValueError("ngram_insert_all_layers cannot be used with insert_ngram_layer_idx.")
|
| 391 |
+
if self.ngram_layer_downproject_size is not None and self.ngram_layer_downproject_size <= 0:
|
| 392 |
+
raise ValueError("ngram_layer_downproject_size must be greater than 0 when set.")
|
| 393 |
+
if self.ngram_embedding_hidden_size is not None and self.ngram_embedding_hidden_size <= 0:
|
| 394 |
+
raise ValueError("ngram_embedding_hidden_size must be greater than 0 when set.")
|
| 395 |
+
if self.ngram_fused_mode not in ("average", "concat"):
|
| 396 |
+
raise ValueError("ngram_fused_mode must be one of: average, concat.")
|
| 397 |
+
if (
|
| 398 |
+
not self.enable_double_loop_split
|
| 399 |
+
and self.loop_loss_weights is not None
|
| 400 |
+
and sum(self.loop_loss_weights) > 1.0
|
| 401 |
+
):
|
| 402 |
+
raise ValueError("sum(loop_loss_weights) must be <= 1.0.")
|
| 403 |
+
if self.enable_double_loop_split and self.loop_middle_layers is None:
|
| 404 |
+
if self.num_hidden_layers <= 0:
|
| 405 |
+
raise ValueError("enable_double_loop_split requires num_hidden_layers to be greater than 0.")
|
| 406 |
+
if self.num_hidden_layers % 2 != 0:
|
| 407 |
+
raise ValueError(
|
| 408 |
+
"enable_double_loop_split requires num_hidden_layers to be divisible by 2 "
|
| 409 |
+
"when loop_middle_layers is not set."
|
| 410 |
+
)
|
| 411 |
+
self.loop_middle_layers = self.num_hidden_layers // 2
|
| 412 |
+
if self.loop_middle_layers is not None:
|
| 413 |
+
if self.num_hidden_layers <= 0:
|
| 414 |
+
raise ValueError("loop_middle_layers requires num_hidden_layers to be greater than 0.")
|
| 415 |
+
if self.loop_middle_layers <= 0:
|
| 416 |
+
raise ValueError("loop_middle_layers must be greater than 0.")
|
| 417 |
+
if self.num_hidden_layers % self.loop_middle_layers != 0:
|
| 418 |
+
raise ValueError("loop_middle_layers must be a factor of num_hidden_layers.")
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 166100,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 166101,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"temperature": 0.6,
|
| 7 |
+
"top_k": 20,
|
| 8 |
+
"top_p": 0.95,
|
| 9 |
+
"transformers_version": "4.57.6"
|
| 10 |
+
}
|
openvino_detokenizer.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4a83e25c3b9c9ac821f32305f03a5766e1398af2af378190ff312ad83eb63d1
|
| 3 |
+
size 2615642
|
openvino_detokenizer.xml
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<net name="detokenizer" version="11">
|
| 3 |
+
<layers>
|
| 4 |
+
<layer id="0" name="Parameter_121413" type="Parameter" version="opset1">
|
| 5 |
+
<data shape="?,?" element_type="i64" />
|
| 6 |
+
<output>
|
| 7 |
+
<port id="0" precision="I64" names="Parameter_121413">
|
| 8 |
+
<dim>-1</dim>
|
| 9 |
+
<dim>-1</dim>
|
| 10 |
+
</port>
|
| 11 |
+
</output>
|
| 12 |
+
</layer>
|
| 13 |
+
<layer id="1" name="Convert_121453" type="Convert" version="opset1">
|
| 14 |
+
<data destination_type="i32" />
|
| 15 |
+
<input>
|
| 16 |
+
<port id="0" precision="I64">
|
| 17 |
+
<dim>-1</dim>
|
| 18 |
+
<dim>-1</dim>
|
| 19 |
+
</port>
|
| 20 |
+
</input>
|
| 21 |
+
<output>
|
| 22 |
+
<port id="1" precision="I32">
|
| 23 |
+
<dim>-1</dim>
|
| 24 |
+
<dim>-1</dim>
|
| 25 |
+
</port>
|
| 26 |
+
</output>
|
| 27 |
+
</layer>
|
| 28 |
+
<layer id="2" name="Constant_121366" type="Const" version="opset1">
|
| 29 |
+
<data element_type="i32" shape="166107" offset="0" size="664428" />
|
| 30 |
+
<output>
|
| 31 |
+
<port id="0" precision="I32">
|
| 32 |
+
<dim>166107</dim>
|
| 33 |
+
</port>
|
| 34 |
+
</output>
|
| 35 |
+
</layer>
|
| 36 |
+
<layer id="3" name="Constant_121368" type="Const" version="opset1">
|
| 37 |
+
<data element_type="i32" shape="166107" offset="664428" size="664428" />
|
| 38 |
+
<output>
|
| 39 |
+
<port id="0" precision="I32">
|
| 40 |
+
<dim>166107</dim>
|
| 41 |
+
</port>
|
| 42 |
+
</output>
|
| 43 |
+
</layer>
|
| 44 |
+
<layer id="4" name="Constant_121370" type="Const" version="opset1">
|
| 45 |
+
<data element_type="u8" shape="1286755" offset="1328856" size="1286755" />
|
| 46 |
+
<output>
|
| 47 |
+
<port id="0" precision="U8">
|
| 48 |
+
<dim>1286755</dim>
|
| 49 |
+
</port>
|
| 50 |
+
</output>
|
| 51 |
+
</layer>
|
| 52 |
+
<layer id="5" name="Slice_121418" type="Const" version="opset1">
|
| 53 |
+
<data element_type="i32" shape="6" offset="2615611" size="24" />
|
| 54 |
+
<output>
|
| 55 |
+
<port id="0" precision="I32">
|
| 56 |
+
<dim>6</dim>
|
| 57 |
+
</port>
|
| 58 |
+
</output>
|
| 59 |
+
</layer>
|
| 60 |
+
<layer id="6" name="VocabDecoder_121420" type="VocabDecoder" version="extension">
|
| 61 |
+
<data skip_tokens="" />
|
| 62 |
+
<input>
|
| 63 |
+
<port id="0" precision="I32">
|
| 64 |
+
<dim>-1</dim>
|
| 65 |
+
<dim>-1</dim>
|
| 66 |
+
</port>
|
| 67 |
+
<port id="1" precision="I32">
|
| 68 |
+
<dim>166107</dim>
|
| 69 |
+
</port>
|
| 70 |
+
<port id="2" precision="I32">
|
| 71 |
+
<dim>166107</dim>
|
| 72 |
+
</port>
|
| 73 |
+
<port id="3" precision="U8">
|
| 74 |
+
<dim>1286755</dim>
|
| 75 |
+
</port>
|
| 76 |
+
<port id="4" precision="I32">
|
| 77 |
+
<dim>6</dim>
|
| 78 |
+
</port>
|
| 79 |
+
</input>
|
| 80 |
+
<output>
|
| 81 |
+
<port id="5" precision="I32">
|
| 82 |
+
<dim>-1</dim>
|
| 83 |
+
</port>
|
| 84 |
+
<port id="6" precision="I32">
|
| 85 |
+
<dim>-1</dim>
|
| 86 |
+
</port>
|
| 87 |
+
<port id="7" precision="I32">
|
| 88 |
+
<dim>-1</dim>
|
| 89 |
+
</port>
|
| 90 |
+
<port id="8" precision="I32">
|
| 91 |
+
<dim>-1</dim>
|
| 92 |
+
</port>
|
| 93 |
+
<port id="9" precision="U8">
|
| 94 |
+
<dim>-1</dim>
|
| 95 |
+
</port>
|
| 96 |
+
</output>
|
| 97 |
+
</layer>
|
| 98 |
+
<layer id="7" name="Constant_121422" type="Const" version="opset1">
|
| 99 |
+
<data element_type="u8" shape="3" offset="2615635" size="3" />
|
| 100 |
+
<output>
|
| 101 |
+
<port id="0" precision="U8">
|
| 102 |
+
<dim>3</dim>
|
| 103 |
+
</port>
|
| 104 |
+
</output>
|
| 105 |
+
</layer>
|
| 106 |
+
<layer id="8" name="Constant_121424" type="Const" version="opset1">
|
| 107 |
+
<data element_type="u8" shape="1" offset="2615638" size="1" />
|
| 108 |
+
<output>
|
| 109 |
+
<port id="0" precision="U8">
|
| 110 |
+
<dim>1</dim>
|
| 111 |
+
</port>
|
| 112 |
+
</output>
|
| 113 |
+
</layer>
|
| 114 |
+
<layer id="9" name="RegexNormalization_121425" type="RegexNormalization" version="extension">
|
| 115 |
+
<data global_replace="true" />
|
| 116 |
+
<input>
|
| 117 |
+
<port id="0" precision="I32">
|
| 118 |
+
<dim>-1</dim>
|
| 119 |
+
</port>
|
| 120 |
+
<port id="1" precision="I32">
|
| 121 |
+
<dim>-1</dim>
|
| 122 |
+
</port>
|
| 123 |
+
<port id="2" precision="U8">
|
| 124 |
+
<dim>-1</dim>
|
| 125 |
+
</port>
|
| 126 |
+
<port id="3" precision="U8">
|
| 127 |
+
<dim>3</dim>
|
| 128 |
+
</port>
|
| 129 |
+
<port id="4" precision="U8">
|
| 130 |
+
<dim>1</dim>
|
| 131 |
+
</port>
|
| 132 |
+
</input>
|
| 133 |
+
<output>
|
| 134 |
+
<port id="5" precision="I32">
|
| 135 |
+
<dim>-1</dim>
|
| 136 |
+
</port>
|
| 137 |
+
<port id="6" precision="I32">
|
| 138 |
+
<dim>-1</dim>
|
| 139 |
+
</port>
|
| 140 |
+
<port id="7" precision="U8">
|
| 141 |
+
<dim>-1</dim>
|
| 142 |
+
</port>
|
| 143 |
+
</output>
|
| 144 |
+
</layer>
|
| 145 |
+
<layer id="10" name="ByteFallback_121426" type="ByteFallback" version="extension">
|
| 146 |
+
<input>
|
| 147 |
+
<port id="0" precision="I32">
|
| 148 |
+
<dim>-1</dim>
|
| 149 |
+
</port>
|
| 150 |
+
<port id="1" precision="I32">
|
| 151 |
+
<dim>-1</dim>
|
| 152 |
+
</port>
|
| 153 |
+
<port id="2" precision="U8">
|
| 154 |
+
<dim>-1</dim>
|
| 155 |
+
</port>
|
| 156 |
+
</input>
|
| 157 |
+
<output>
|
| 158 |
+
<port id="3" precision="I32">
|
| 159 |
+
<dim>-1</dim>
|
| 160 |
+
</port>
|
| 161 |
+
<port id="4" precision="I32">
|
| 162 |
+
<dim>-1</dim>
|
| 163 |
+
</port>
|
| 164 |
+
<port id="5" precision="U8">
|
| 165 |
+
<dim>-1</dim>
|
| 166 |
+
</port>
|
| 167 |
+
</output>
|
| 168 |
+
</layer>
|
| 169 |
+
<layer id="11" name="FuzeRagged_121427" type="FuzeRagged" version="extension">
|
| 170 |
+
<input>
|
| 171 |
+
<port id="0" precision="I32">
|
| 172 |
+
<dim>-1</dim>
|
| 173 |
+
</port>
|
| 174 |
+
<port id="1" precision="I32">
|
| 175 |
+
<dim>-1</dim>
|
| 176 |
+
</port>
|
| 177 |
+
<port id="2" precision="I32">
|
| 178 |
+
<dim>-1</dim>
|
| 179 |
+
</port>
|
| 180 |
+
<port id="3" precision="I32">
|
| 181 |
+
<dim>-1</dim>
|
| 182 |
+
</port>
|
| 183 |
+
</input>
|
| 184 |
+
<output>
|
| 185 |
+
<port id="4" precision="I32">
|
| 186 |
+
<dim>-1</dim>
|
| 187 |
+
</port>
|
| 188 |
+
<port id="5" precision="I32">
|
| 189 |
+
<dim>-1</dim>
|
| 190 |
+
</port>
|
| 191 |
+
</output>
|
| 192 |
+
</layer>
|
| 193 |
+
<layer id="12" name="Constant_121429" type="Const" version="opset1">
|
| 194 |
+
<data element_type="u8" shape="2" offset="2615639" size="2" />
|
| 195 |
+
<output>
|
| 196 |
+
<port id="0" precision="U8">
|
| 197 |
+
<dim>2</dim>
|
| 198 |
+
</port>
|
| 199 |
+
</output>
|
| 200 |
+
</layer>
|
| 201 |
+
<layer id="13" name="Constant_121431" type="Const" version="opset1">
|
| 202 |
+
<data element_type="u8" shape="0" offset="2615641" size="1" />
|
| 203 |
+
<output>
|
| 204 |
+
<port id="0" precision="U8">
|
| 205 |
+
<dim>0</dim>
|
| 206 |
+
</port>
|
| 207 |
+
</output>
|
| 208 |
+
</layer>
|
| 209 |
+
<layer id="14" name="RegexNormalization_121432" type="RegexNormalization" version="extension">
|
| 210 |
+
<data global_replace="true" />
|
| 211 |
+
<input>
|
| 212 |
+
<port id="0" precision="I32">
|
| 213 |
+
<dim>-1</dim>
|
| 214 |
+
</port>
|
| 215 |
+
<port id="1" precision="I32">
|
| 216 |
+
<dim>-1</dim>
|
| 217 |
+
</port>
|
| 218 |
+
<port id="2" precision="U8">
|
| 219 |
+
<dim>-1</dim>
|
| 220 |
+
</port>
|
| 221 |
+
<port id="3" precision="U8">
|
| 222 |
+
<dim>2</dim>
|
| 223 |
+
</port>
|
| 224 |
+
<port id="4" precision="U8">
|
| 225 |
+
<dim>0</dim>
|
| 226 |
+
</port>
|
| 227 |
+
</input>
|
| 228 |
+
<output>
|
| 229 |
+
<port id="5" precision="I32">
|
| 230 |
+
<dim>-1</dim>
|
| 231 |
+
</port>
|
| 232 |
+
<port id="6" precision="I32">
|
| 233 |
+
<dim>-1</dim>
|
| 234 |
+
</port>
|
| 235 |
+
<port id="7" precision="U8">
|
| 236 |
+
<dim>-1</dim>
|
| 237 |
+
</port>
|
| 238 |
+
</output>
|
| 239 |
+
</layer>
|
| 240 |
+
<layer id="15" name="UTF8Validate_121433" type="UTF8Validate" version="extension">
|
| 241 |
+
<data replace_mode="true" />
|
| 242 |
+
<input>
|
| 243 |
+
<port id="0" precision="I32">
|
| 244 |
+
<dim>-1</dim>
|
| 245 |
+
</port>
|
| 246 |
+
<port id="1" precision="I32">
|
| 247 |
+
<dim>-1</dim>
|
| 248 |
+
</port>
|
| 249 |
+
<port id="2" precision="U8">
|
| 250 |
+
<dim>-1</dim>
|
| 251 |
+
</port>
|
| 252 |
+
</input>
|
| 253 |
+
<output>
|
| 254 |
+
<port id="3" precision="I32">
|
| 255 |
+
<dim>-1</dim>
|
| 256 |
+
</port>
|
| 257 |
+
<port id="4" precision="I32">
|
| 258 |
+
<dim>-1</dim>
|
| 259 |
+
</port>
|
| 260 |
+
<port id="5" precision="U8">
|
| 261 |
+
<dim>-1</dim>
|
| 262 |
+
</port>
|
| 263 |
+
</output>
|
| 264 |
+
</layer>
|
| 265 |
+
<layer id="16" name="StringTensorPack_121434" type="StringTensorPack" version="opset15">
|
| 266 |
+
<input>
|
| 267 |
+
<port id="0" precision="I32">
|
| 268 |
+
<dim>-1</dim>
|
| 269 |
+
</port>
|
| 270 |
+
<port id="1" precision="I32">
|
| 271 |
+
<dim>-1</dim>
|
| 272 |
+
</port>
|
| 273 |
+
<port id="2" precision="U8">
|
| 274 |
+
<dim>-1</dim>
|
| 275 |
+
</port>
|
| 276 |
+
</input>
|
| 277 |
+
<output>
|
| 278 |
+
<port id="3" precision="STRING" names="Result_121435,string_output">
|
| 279 |
+
<dim>-1</dim>
|
| 280 |
+
</port>
|
| 281 |
+
</output>
|
| 282 |
+
</layer>
|
| 283 |
+
<layer id="17" name="Result_121435" type="Result" version="opset1" output_names="Result_121435,string_output">
|
| 284 |
+
<input>
|
| 285 |
+
<port id="0" precision="STRING">
|
| 286 |
+
<dim>-1</dim>
|
| 287 |
+
</port>
|
| 288 |
+
</input>
|
| 289 |
+
</layer>
|
| 290 |
+
</layers>
|
| 291 |
+
<edges>
|
| 292 |
+
<edge from-layer="0" from-port="0" to-layer="1" to-port="0" />
|
| 293 |
+
<edge from-layer="1" from-port="1" to-layer="6" to-port="0" />
|
| 294 |
+
<edge from-layer="2" from-port="0" to-layer="6" to-port="1" />
|
| 295 |
+
<edge from-layer="3" from-port="0" to-layer="6" to-port="2" />
|
| 296 |
+
<edge from-layer="4" from-port="0" to-layer="6" to-port="3" />
|
| 297 |
+
<edge from-layer="5" from-port="0" to-layer="6" to-port="4" />
|
| 298 |
+
<edge from-layer="6" from-port="7" to-layer="9" to-port="0" />
|
| 299 |
+
<edge from-layer="6" from-port="8" to-layer="9" to-port="1" />
|
| 300 |
+
<edge from-layer="6" from-port="9" to-layer="9" to-port="2" />
|
| 301 |
+
<edge from-layer="6" from-port="5" to-layer="11" to-port="0" />
|
| 302 |
+
<edge from-layer="6" from-port="6" to-layer="11" to-port="1" />
|
| 303 |
+
<edge from-layer="7" from-port="0" to-layer="9" to-port="3" />
|
| 304 |
+
<edge from-layer="8" from-port="0" to-layer="9" to-port="4" />
|
| 305 |
+
<edge from-layer="9" from-port="5" to-layer="10" to-port="0" />
|
| 306 |
+
<edge from-layer="9" from-port="6" to-layer="10" to-port="1" />
|
| 307 |
+
<edge from-layer="9" from-port="7" to-layer="10" to-port="2" />
|
| 308 |
+
<edge from-layer="10" from-port="3" to-layer="11" to-port="2" />
|
| 309 |
+
<edge from-layer="10" from-port="4" to-layer="11" to-port="3" />
|
| 310 |
+
<edge from-layer="10" from-port="5" to-layer="14" to-port="2" />
|
| 311 |
+
<edge from-layer="11" from-port="4" to-layer="14" to-port="0" />
|
| 312 |
+
<edge from-layer="11" from-port="5" to-layer="14" to-port="1" />
|
| 313 |
+
<edge from-layer="12" from-port="0" to-layer="14" to-port="3" />
|
| 314 |
+
<edge from-layer="13" from-port="0" to-layer="14" to-port="4" />
|
| 315 |
+
<edge from-layer="14" from-port="5" to-layer="15" to-port="0" />
|
| 316 |
+
<edge from-layer="14" from-port="6" to-layer="15" to-port="1" />
|
| 317 |
+
<edge from-layer="14" from-port="7" to-layer="15" to-port="2" />
|
| 318 |
+
<edge from-layer="15" from-port="3" to-layer="16" to-port="0" />
|
| 319 |
+
<edge from-layer="15" from-port="4" to-layer="16" to-port="1" />
|
| 320 |
+
<edge from-layer="15" from-port="5" to-layer="16" to-port="2" />
|
| 321 |
+
<edge from-layer="16" from-port="3" to-layer="17" to-port="0" />
|
| 322 |
+
</edges>
|
| 323 |
+
<rt_info>
|
| 324 |
+
<info name="OpenVINO Runtime" value="2026.3.1-22476-759c5a6ab8c-releases/2026/3" />
|
| 325 |
+
<add_attention_mask value="True" />
|
| 326 |
+
<add_prefix_space />
|
| 327 |
+
<add_special_tokens value="True" />
|
| 328 |
+
<bos_token_id value="166100" />
|
| 329 |
+
<chat_template value=" {%- macro visible_text(content) -%} {%- if content is string -%} {{- content }} {%- elif content is iterable and content is not mapping -%} {%- for item in content -%} {%- if item is mapping and item.type == 'text' -%} {{- item.text }} {%- elif item is string -%} {{- item }} {%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%} {%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%} {{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }} {%- endif -%} {%- endfor -%} {%- else -%} {{- content }} {%- endif -%} {%- endmacro -%} {%- set tool_call_format = tool_call_format if tool_call_format is defined else 'xml' %} {%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages|length > 0 and messages[0].get('role', '') == 'system' %} {{- visible_text(messages[0].content) + '\n\n' }} {%- else %} {{- '你是一位工具函数调用专家,你会得到一个问题和一组可能的工具函数。根据问题,你需要进行一个或多个函数/工具调用以实现目的,请尽量尝试探索通过工具解决问题。\n如果没有一个函数可以使用,请直接使用自然语言回复用户。\n如果给定的问题缺少函数所需的参数,请使用自然语言进行提问,向用户询问必要信息。\n如果调用结果已经足够回答用户问题,请对历史结果进行总结,使用自然语言回复用户。' }} {%- endif %} {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {%- if tool_call_format == 'json' %} {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n" }} {{- '<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n' }} {%- else %} {{- "\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n" }} {{- '<tool_call> <function=example_function_name> <parameter=example_parameter_1> value_1 </parameter> <parameter=example_parameter_2> This is the value for the second parameter that can span multiple lines </parameter> </function> </tool_call><|im_end|>\n' }} {%- endif %} {%- else %} {%- if messages|length > 0 and messages[0].get('role', '') == 'system' %} {{- '<|im_start|>system\n' + visible_text(messages[0].content) + '<|im_end|>\n' }} {%- else %} {{- '<|im_start|>system\n你是南北阁,一款由BOSS直聘自主研发并训练的专业大语言模型。<|im_end|>\n' }} {%- endif %} {%- endif %} {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %} {%- for message in messages[::-1] %} {%- set index = (messages|length - 1) - loop.index0 %} {%- if ns.multi_step_tool and message.get('role', '') == "user" and visible_text(message.content) is string and not(visible_text(message.content).startswith('<tool_response>') and visible_text(message.content).endswith('</tool_response>')) %} {%- set ns.multi_step_tool = false %} {%- set ns.last_query_index = index %} {%- endif %} {%- endfor %} {%- for message in messages %} {%- if visible_text(message.content) is string %} {%- set content = visible_text(message.content) %} {%- else %} {%- set content = '' %} {%- endif %} {%- if message.get('role', '') == "system" %} {%- if not loop.first %} {{- raise_exception('System message must be at the beginning.') }} {%- endif %} {%- elif message.get('role', '') == "assistant" %} {%- set reasoning_content = '' %} {%- if message.reasoning_content is string %} {%- set reasoning_content = message.reasoning_content %} {%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n').rstrip('\n') %} {%- endif %} {%- endif %} {%- set reasoning_content = reasoning_content|trim %} {%- if (preserve_thinking is defined and preserve_thinking is false) and (loop.index0 < ns.last_query_index) %} {{- '<|im_start|>' + message.get('role', '') + '\n<think>\n\n</think>\n\n' + content }} {%- else %} {{- '<|im_start|>' + message.get('role', '') + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }} {%- endif %} {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %} {%- if tool_call_format == 'json' %} {%- for tool_call in message.tool_calls %} {%- if (loop.first and content) or (not loop.first) %} {{- '\n' }} {%- endif %} {%- if tool_call.function %} {%- set tool_call = tool_call.function %} {%- endif %} {{- '<tool_call>\n{"name": "' }} {{- tool_call.name }} {{- '", "arguments": ' }} {%- if tool_call.arguments is string %} {{- tool_call.arguments }} {%- else %} {{- tool_call.arguments | tojson }} {%- endif %} {{- '}\n</tool_call>' }} {%- endfor %} {%- else %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {%- if loop.first %} {%- if content|trim %} {{- ' <tool_call> <function=' + tool_call.name + '> ' }} {%- else %} {{- '<tool_call> <function=' + tool_call.name + '> ' }} {%- endif %} {%- else %} {{- ' <tool_call> <function=' + tool_call.name + '> ' }} {%- endif %} {%- if tool_call.arguments is defined %} {%- for args_name, args_value in tool_call.arguments|items %} {{- '<parameter=' + args_name + '> ' }} {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %} {{- args_value }} {{- ' </parameter> ' }} {%- endfor %} {%- endif %} {{- '</function> </tool_call>' }} {%- endfor %} {%- endif %} {%- endif %} {{- '<|im_end|>\n' }} {%- elif message.get('role', '') == "tool" %} {%- if loop.previtem and loop.previtem.get('role', '') != "tool" %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- content }} {{- '\n</tool_response>' }} {%- if loop.last or loop.nextitem.get('role', '') != "tool" %} {{- '<|im_end|>\n' }} {%- endif %} {%- elif message.get('role', '') != '' %} {{- '<|im_start|>' + message.get('role', '') + '\n' + content + '<|im_end|>' + '\n' }} {%- endif %} {%- endfor %} {%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- if enable_thinking is defined and enable_thinking is false %} {{- '<think> </think> ' }} {%- else %} {{- '<think> ' }} {%- endif %} {%- endif %} " />
|
| 330 |
+
<clean_up_tokenization_spaces />
|
| 331 |
+
<detokenizer_input_type value="i64" />
|
| 332 |
+
<eos_token_id value="166101" />
|
| 333 |
+
<handle_special_tokens_with_re />
|
| 334 |
+
<max_length />
|
| 335 |
+
<number_of_inputs value="1" />
|
| 336 |
+
<openvino_tokenizers_version value="2026.3.1.0-705-77e4637387c" />
|
| 337 |
+
<openvino_version value="2026.3.1-22476-759c5a6ab8c-releases/2026/3" />
|
| 338 |
+
<original_post_processor_template value="{"type": "TemplateProcessing", "single": [{"SpecialToken": {"id": "<|im_start|>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}], "pair": [{"SpecialToken": {"id": "<|im_start|>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}, {"SpecialToken": {"id": "<|im_start|>", "type_id": 1}}, {"Sequence": {"id": "B", "type_id": 1}}], "special_tokens": {"<|im_start|>": {"id": "<|im_start|>", "ids": [166100], "tokens": ["<|im_start|>"]}}}" />
|
| 339 |
+
<original_tokenizer_class value="<class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>" />
|
| 340 |
+
<pad_token_id value="0" />
|
| 341 |
+
<processed_post_processor_template value="{"single": {"ids": [166100, -1], "type_ids": [0, 0]}, "pair": {"ids": [166100, -1, 166100, -2], "type_ids": [0, 0, 1, 1]}}" />
|
| 342 |
+
<sentencepiece_version value="0.2.2" />
|
| 343 |
+
<skip_special_tokens value="True" />
|
| 344 |
+
<streaming_detokenizer value="False" />
|
| 345 |
+
<tokenizer_output_type value="i64" />
|
| 346 |
+
<tokenizers_version value="0.22.2" />
|
| 347 |
+
<transformers_version value="4.57.6" />
|
| 348 |
+
<use_max_padding value="False" />
|
| 349 |
+
<use_sentencepiece_backend value="False" />
|
| 350 |
+
<utf8_replace_mode value="replace" />
|
| 351 |
+
<with_detokenizer value="True" />
|
| 352 |
+
</rt_info>
|
| 353 |
+
</net>
|
openvino_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4cc1f373e4d1307f0730eb61ff17f7f84446b0989a52bb72e286590a0bd539d
|
| 3 |
+
size 2645700572
|
openvino_model.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
openvino_tokenizer.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c6f5ace4703428ddfdf8f52d1470878eb1c062fa90832599ae9ce5e21511d61a
|
| 3 |
+
size 9767068
|
openvino_tokenizer.xml
ADDED
|
@@ -0,0 +1,816 @@
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<net name="tokenizer" version="11">
|
| 3 |
+
<layers>
|
| 4 |
+
<layer id="0" name="Parameter_121276" type="Parameter" version="opset1">
|
| 5 |
+
<data shape="?" element_type="string" />
|
| 6 |
+
<output>
|
| 7 |
+
<port id="0" precision="STRING" names="Parameter_121276">
|
| 8 |
+
<dim>-1</dim>
|
| 9 |
+
</port>
|
| 10 |
+
</output>
|
| 11 |
+
</layer>
|
| 12 |
+
<layer id="1" name="Constant_121397" type="Const" version="opset1">
|
| 13 |
+
<data element_type="i32" shape="" offset="0" size="4" />
|
| 14 |
+
<output>
|
| 15 |
+
<port id="0" precision="I32" />
|
| 16 |
+
</output>
|
| 17 |
+
</layer>
|
| 18 |
+
<layer id="2" name="Constant_121398" type="Const" version="opset1">
|
| 19 |
+
<data element_type="i32" shape="" offset="4" size="4" />
|
| 20 |
+
<output>
|
| 21 |
+
<port id="0" precision="I32" />
|
| 22 |
+
</output>
|
| 23 |
+
</layer>
|
| 24 |
+
<layer id="3" name="Constant_121399" type="Const" version="opset1">
|
| 25 |
+
<data element_type="i32" shape="1" offset="8" size="4" />
|
| 26 |
+
<output>
|
| 27 |
+
<port id="0" precision="I32">
|
| 28 |
+
<dim>1</dim>
|
| 29 |
+
</port>
|
| 30 |
+
</output>
|
| 31 |
+
</layer>
|
| 32 |
+
<layer id="4" name="Constant_121287" type="Const" version="opset1">
|
| 33 |
+
<data element_type="i64" shape="" offset="12" size="8" />
|
| 34 |
+
<output>
|
| 35 |
+
<port id="0" precision="I64" />
|
| 36 |
+
</output>
|
| 37 |
+
</layer>
|
| 38 |
+
<layer id="5" name="StringTensorUnpack_121277" type="StringTensorUnpack" version="opset15">
|
| 39 |
+
<input>
|
| 40 |
+
<port id="0" precision="STRING">
|
| 41 |
+
<dim>-1</dim>
|
| 42 |
+
</port>
|
| 43 |
+
</input>
|
| 44 |
+
<output>
|
| 45 |
+
<port id="1" precision="I32">
|
| 46 |
+
<dim>-1</dim>
|
| 47 |
+
</port>
|
| 48 |
+
<port id="2" precision="I32">
|
| 49 |
+
<dim>-1</dim>
|
| 50 |
+
</port>
|
| 51 |
+
<port id="3" precision="U8">
|
| 52 |
+
<dim>-1</dim>
|
| 53 |
+
</port>
|
| 54 |
+
</output>
|
| 55 |
+
</layer>
|
| 56 |
+
<layer id="6" name="Constant_121279" type="Const" version="opset1">
|
| 57 |
+
<data element_type="u8" shape="153" offset="20" size="153" />
|
| 58 |
+
<output>
|
| 59 |
+
<port id="0" precision="U8">
|
| 60 |
+
<dim>153</dim>
|
| 61 |
+
</port>
|
| 62 |
+
</output>
|
| 63 |
+
</layer>
|
| 64 |
+
<layer id="7" name="Constant_121281" type="Const" version="opset1">
|
| 65 |
+
<data element_type="u8" shape="5" offset="173" size="5" />
|
| 66 |
+
<output>
|
| 67 |
+
<port id="0" precision="U8">
|
| 68 |
+
<dim>5</dim>
|
| 69 |
+
</port>
|
| 70 |
+
</output>
|
| 71 |
+
</layer>
|
| 72 |
+
<layer id="8" name="RegexNormalization_121282" type="RegexNormalization" version="extension">
|
| 73 |
+
<data global_replace="false" />
|
| 74 |
+
<input>
|
| 75 |
+
<port id="0" precision="I32">
|
| 76 |
+
<dim>-1</dim>
|
| 77 |
+
</port>
|
| 78 |
+
<port id="1" precision="I32">
|
| 79 |
+
<dim>-1</dim>
|
| 80 |
+
</port>
|
| 81 |
+
<port id="2" precision="U8">
|
| 82 |
+
<dim>-1</dim>
|
| 83 |
+
</port>
|
| 84 |
+
<port id="3" precision="U8">
|
| 85 |
+
<dim>153</dim>
|
| 86 |
+
</port>
|
| 87 |
+
<port id="4" precision="U8">
|
| 88 |
+
<dim>5</dim>
|
| 89 |
+
</port>
|
| 90 |
+
</input>
|
| 91 |
+
<output>
|
| 92 |
+
<port id="5" precision="I32">
|
| 93 |
+
<dim>-1</dim>
|
| 94 |
+
</port>
|
| 95 |
+
<port id="6" precision="I32">
|
| 96 |
+
<dim>-1</dim>
|
| 97 |
+
</port>
|
| 98 |
+
<port id="7" precision="U8">
|
| 99 |
+
<dim>-1</dim>
|
| 100 |
+
</port>
|
| 101 |
+
</output>
|
| 102 |
+
</layer>
|
| 103 |
+
<layer id="9" name="ShapeOf_121283" type="ShapeOf" version="opset3">
|
| 104 |
+
<data output_type="i64" />
|
| 105 |
+
<input>
|
| 106 |
+
<port id="0" precision="I32">
|
| 107 |
+
<dim>-1</dim>
|
| 108 |
+
</port>
|
| 109 |
+
</input>
|
| 110 |
+
<output>
|
| 111 |
+
<port id="1" precision="I64">
|
| 112 |
+
<dim>1</dim>
|
| 113 |
+
</port>
|
| 114 |
+
</output>
|
| 115 |
+
</layer>
|
| 116 |
+
<layer id="10" name="Constant_121284" type="Const" version="opset1">
|
| 117 |
+
<data element_type="i64" shape="" offset="12" size="8" />
|
| 118 |
+
<output>
|
| 119 |
+
<port id="0" precision="I64" />
|
| 120 |
+
</output>
|
| 121 |
+
</layer>
|
| 122 |
+
<layer id="11" name="Constant_121285" type="Const" version="opset1">
|
| 123 |
+
<data element_type="i64" shape="" offset="12" size="8" />
|
| 124 |
+
<output>
|
| 125 |
+
<port id="0" precision="I64" />
|
| 126 |
+
</output>
|
| 127 |
+
</layer>
|
| 128 |
+
<layer id="12" name="Gather_121286" type="Gather" version="opset8">
|
| 129 |
+
<data batch_dims="0" />
|
| 130 |
+
<input>
|
| 131 |
+
<port id="0" precision="I64">
|
| 132 |
+
<dim>1</dim>
|
| 133 |
+
</port>
|
| 134 |
+
<port id="1" precision="I64" />
|
| 135 |
+
<port id="2" precision="I64" />
|
| 136 |
+
</input>
|
| 137 |
+
<output>
|
| 138 |
+
<port id="3" precision="I64" />
|
| 139 |
+
</output>
|
| 140 |
+
</layer>
|
| 141 |
+
<layer id="13" name="Constant_121288" type="Const" version="opset1">
|
| 142 |
+
<data element_type="i64" shape="" offset="178" size="8" />
|
| 143 |
+
<output>
|
| 144 |
+
<port id="0" precision="I64" />
|
| 145 |
+
</output>
|
| 146 |
+
</layer>
|
| 147 |
+
<layer id="14" name="Range_121289" type="Range" version="opset4">
|
| 148 |
+
<data output_type="i32" />
|
| 149 |
+
<input>
|
| 150 |
+
<port id="0" precision="I64" />
|
| 151 |
+
<port id="1" precision="I64" />
|
| 152 |
+
<port id="2" precision="I64" />
|
| 153 |
+
</input>
|
| 154 |
+
<output>
|
| 155 |
+
<port id="3" precision="I32">
|
| 156 |
+
<dim>-1</dim>
|
| 157 |
+
</port>
|
| 158 |
+
</output>
|
| 159 |
+
</layer>
|
| 160 |
+
<layer id="15" name="Constant_121290" type="Const" version="opset1">
|
| 161 |
+
<data element_type="i64" shape="" offset="178" size="8" />
|
| 162 |
+
<output>
|
| 163 |
+
<port id="0" precision="I64" />
|
| 164 |
+
</output>
|
| 165 |
+
</layer>
|
| 166 |
+
<layer id="16" name="Constant_121291" type="Const" version="opset1">
|
| 167 |
+
<data element_type="i64" shape="" offset="178" size="8" />
|
| 168 |
+
<output>
|
| 169 |
+
<port id="0" precision="I64" />
|
| 170 |
+
</output>
|
| 171 |
+
</layer>
|
| 172 |
+
<layer id="17" name="Add_121292" type="Add" version="opset1">
|
| 173 |
+
<data auto_broadcast="numpy" />
|
| 174 |
+
<input>
|
| 175 |
+
<port id="0" precision="I64" />
|
| 176 |
+
<port id="1" precision="I64" />
|
| 177 |
+
</input>
|
| 178 |
+
<output>
|
| 179 |
+
<port id="2" precision="I64" />
|
| 180 |
+
</output>
|
| 181 |
+
</layer>
|
| 182 |
+
<layer id="18" name="Constant_121293" type="Const" version="opset1">
|
| 183 |
+
<data element_type="i64" shape="" offset="178" size="8" />
|
| 184 |
+
<output>
|
| 185 |
+
<port id="0" precision="I64" />
|
| 186 |
+
</output>
|
| 187 |
+
</layer>
|
| 188 |
+
<layer id="19" name="Range_121294" type="Range" version="opset4">
|
| 189 |
+
<data output_type="i32" />
|
| 190 |
+
<input>
|
| 191 |
+
<port id="0" precision="I64" />
|
| 192 |
+
<port id="1" precision="I64" />
|
| 193 |
+
<port id="2" precision="I64" />
|
| 194 |
+
</input>
|
| 195 |
+
<output>
|
| 196 |
+
<port id="3" precision="I32">
|
| 197 |
+
<dim>-1</dim>
|
| 198 |
+
</port>
|
| 199 |
+
</output>
|
| 200 |
+
</layer>
|
| 201 |
+
<layer id="20" name="Constant_121358" type="Const" version="opset1">
|
| 202 |
+
<data element_type="u8" shape="125" offset="186" size="125" />
|
| 203 |
+
<output>
|
| 204 |
+
<port id="0" precision="U8">
|
| 205 |
+
<dim>125</dim>
|
| 206 |
+
</port>
|
| 207 |
+
</output>
|
| 208 |
+
</layer>
|
| 209 |
+
<layer id="21" name="SpecialTokensSplit_121359" type="SpecialTokensSplit" version="extension">
|
| 210 |
+
<input>
|
| 211 |
+
<port id="0" precision="I32">
|
| 212 |
+
<dim>-1</dim>
|
| 213 |
+
</port>
|
| 214 |
+
<port id="1" precision="I32">
|
| 215 |
+
<dim>-1</dim>
|
| 216 |
+
</port>
|
| 217 |
+
<port id="2" precision="I32">
|
| 218 |
+
<dim>-1</dim>
|
| 219 |
+
</port>
|
| 220 |
+
<port id="3" precision="I32">
|
| 221 |
+
<dim>-1</dim>
|
| 222 |
+
</port>
|
| 223 |
+
<port id="4" precision="U8">
|
| 224 |
+
<dim>-1</dim>
|
| 225 |
+
</port>
|
| 226 |
+
<port id="5" precision="U8">
|
| 227 |
+
<dim>125</dim>
|
| 228 |
+
</port>
|
| 229 |
+
</input>
|
| 230 |
+
<output>
|
| 231 |
+
<port id="6" precision="I32">
|
| 232 |
+
<dim>-1</dim>
|
| 233 |
+
</port>
|
| 234 |
+
<port id="7" precision="I32">
|
| 235 |
+
<dim>-1</dim>
|
| 236 |
+
</port>
|
| 237 |
+
<port id="8" precision="I32">
|
| 238 |
+
<dim>-1</dim>
|
| 239 |
+
</port>
|
| 240 |
+
<port id="9" precision="I32">
|
| 241 |
+
<dim>-1</dim>
|
| 242 |
+
</port>
|
| 243 |
+
<port id="10" precision="U8">
|
| 244 |
+
<dim>-1</dim>
|
| 245 |
+
</port>
|
| 246 |
+
<port id="11" precision="BOOL">
|
| 247 |
+
<dim>-1</dim>
|
| 248 |
+
</port>
|
| 249 |
+
</output>
|
| 250 |
+
</layer>
|
| 251 |
+
<layer id="22" name="Constant_121361" type="Const" version="opset1">
|
| 252 |
+
<data element_type="u8" shape="1" offset="311" size="1" />
|
| 253 |
+
<output>
|
| 254 |
+
<port id="0" precision="U8">
|
| 255 |
+
<dim>1</dim>
|
| 256 |
+
</port>
|
| 257 |
+
</output>
|
| 258 |
+
</layer>
|
| 259 |
+
<layer id="23" name="Constant_121363" type="Const" version="opset1">
|
| 260 |
+
<data element_type="u8" shape="3" offset="312" size="3" />
|
| 261 |
+
<output>
|
| 262 |
+
<port id="0" precision="U8">
|
| 263 |
+
<dim>3</dim>
|
| 264 |
+
</port>
|
| 265 |
+
</output>
|
| 266 |
+
</layer>
|
| 267 |
+
<layer id="24" name="RegexNormalization_121364" type="RegexNormalization" version="extension">
|
| 268 |
+
<data global_replace="true" />
|
| 269 |
+
<input>
|
| 270 |
+
<port id="0" precision="I32">
|
| 271 |
+
<dim>-1</dim>
|
| 272 |
+
</port>
|
| 273 |
+
<port id="1" precision="I32">
|
| 274 |
+
<dim>-1</dim>
|
| 275 |
+
</port>
|
| 276 |
+
<port id="2" precision="U8">
|
| 277 |
+
<dim>-1</dim>
|
| 278 |
+
</port>
|
| 279 |
+
<port id="3" precision="BOOL">
|
| 280 |
+
<dim>-1</dim>
|
| 281 |
+
</port>
|
| 282 |
+
<port id="4" precision="U8">
|
| 283 |
+
<dim>1</dim>
|
| 284 |
+
</port>
|
| 285 |
+
<port id="5" precision="U8">
|
| 286 |
+
<dim>3</dim>
|
| 287 |
+
</port>
|
| 288 |
+
</input>
|
| 289 |
+
<output>
|
| 290 |
+
<port id="6" precision="I32">
|
| 291 |
+
<dim>-1</dim>
|
| 292 |
+
</port>
|
| 293 |
+
<port id="7" precision="I32">
|
| 294 |
+
<dim>-1</dim>
|
| 295 |
+
</port>
|
| 296 |
+
<port id="8" precision="U8">
|
| 297 |
+
<dim>-1</dim>
|
| 298 |
+
</port>
|
| 299 |
+
<port id="9" precision="BOOL">
|
| 300 |
+
<dim>-1</dim>
|
| 301 |
+
</port>
|
| 302 |
+
</output>
|
| 303 |
+
</layer>
|
| 304 |
+
<layer id="25" name="Constant_121366" type="Const" version="opset1">
|
| 305 |
+
<data element_type="i32" shape="166107" offset="315" size="664428" />
|
| 306 |
+
<output>
|
| 307 |
+
<port id="0" precision="I32">
|
| 308 |
+
<dim>166107</dim>
|
| 309 |
+
</port>
|
| 310 |
+
</output>
|
| 311 |
+
</layer>
|
| 312 |
+
<layer id="26" name="Constant_121368" type="Const" version="opset1">
|
| 313 |
+
<data element_type="i32" shape="166107" offset="664743" size="664428" />
|
| 314 |
+
<output>
|
| 315 |
+
<port id="0" precision="I32">
|
| 316 |
+
<dim>166107</dim>
|
| 317 |
+
</port>
|
| 318 |
+
</output>
|
| 319 |
+
</layer>
|
| 320 |
+
<layer id="27" name="Constant_121370" type="Const" version="opset1">
|
| 321 |
+
<data element_type="u8" shape="1286755" offset="1329171" size="1286755" />
|
| 322 |
+
<output>
|
| 323 |
+
<port id="0" precision="U8">
|
| 324 |
+
<dim>1286755</dim>
|
| 325 |
+
</port>
|
| 326 |
+
</output>
|
| 327 |
+
</layer>
|
| 328 |
+
<layer id="28" name="Constant_121378" type="Const" version="opset1">
|
| 329 |
+
<data element_type="i32" shape="296888" offset="2615926" size="1187552" />
|
| 330 |
+
<output>
|
| 331 |
+
<port id="0" precision="I32">
|
| 332 |
+
<dim>296888</dim>
|
| 333 |
+
</port>
|
| 334 |
+
</output>
|
| 335 |
+
</layer>
|
| 336 |
+
<layer id="29" name="Constant_121380" type="Const" version="opset1">
|
| 337 |
+
<data element_type="i32" shape="296888" offset="3803478" size="1187552" />
|
| 338 |
+
<output>
|
| 339 |
+
<port id="0" precision="I32">
|
| 340 |
+
<dim>296888</dim>
|
| 341 |
+
</port>
|
| 342 |
+
</output>
|
| 343 |
+
</layer>
|
| 344 |
+
<layer id="30" name="Constant_121382" type="Const" version="opset1">
|
| 345 |
+
<data element_type="u8" shape="1363596" offset="4991030" size="1363596" />
|
| 346 |
+
<output>
|
| 347 |
+
<port id="0" precision="U8">
|
| 348 |
+
<dim>1363596</dim>
|
| 349 |
+
</port>
|
| 350 |
+
</output>
|
| 351 |
+
</layer>
|
| 352 |
+
<layer id="31" name="Constant_121384" type="Const" version="opset1">
|
| 353 |
+
<data element_type="i32" shape="296888" offset="6354626" size="1187552" />
|
| 354 |
+
<output>
|
| 355 |
+
<port id="0" precision="I32">
|
| 356 |
+
<dim>296888</dim>
|
| 357 |
+
</port>
|
| 358 |
+
</output>
|
| 359 |
+
</layer>
|
| 360 |
+
<layer id="32" name="Constant_121386" type="Const" version="opset1">
|
| 361 |
+
<data element_type="i32" shape="296888" offset="7542178" size="1187552" />
|
| 362 |
+
<output>
|
| 363 |
+
<port id="0" precision="I32">
|
| 364 |
+
<dim>296888</dim>
|
| 365 |
+
</port>
|
| 366 |
+
</output>
|
| 367 |
+
</layer>
|
| 368 |
+
<layer id="33" name="Constant_121388" type="Const" version="opset1">
|
| 369 |
+
<data element_type="u8" shape="1037128" offset="8729730" size="1037128" />
|
| 370 |
+
<output>
|
| 371 |
+
<port id="0" precision="U8">
|
| 372 |
+
<dim>1037128</dim>
|
| 373 |
+
</port>
|
| 374 |
+
</output>
|
| 375 |
+
</layer>
|
| 376 |
+
<layer id="34" name="Constant_121372" type="Const" version="opset1">
|
| 377 |
+
<data element_type="i32" shape="9" offset="9766858" size="36" />
|
| 378 |
+
<output>
|
| 379 |
+
<port id="0" precision="I32">
|
| 380 |
+
<dim>9</dim>
|
| 381 |
+
</port>
|
| 382 |
+
</output>
|
| 383 |
+
</layer>
|
| 384 |
+
<layer id="35" name="Constant_121374" type="Const" version="opset1">
|
| 385 |
+
<data element_type="i32" shape="9" offset="9766894" size="36" />
|
| 386 |
+
<output>
|
| 387 |
+
<port id="0" precision="I32">
|
| 388 |
+
<dim>9</dim>
|
| 389 |
+
</port>
|
| 390 |
+
</output>
|
| 391 |
+
</layer>
|
| 392 |
+
<layer id="36" name="Constant_121376" type="Const" version="opset1">
|
| 393 |
+
<data element_type="u8" shape="80" offset="9766930" size="80" />
|
| 394 |
+
<output>
|
| 395 |
+
<port id="0" precision="U8">
|
| 396 |
+
<dim>80</dim>
|
| 397 |
+
</port>
|
| 398 |
+
</output>
|
| 399 |
+
</layer>
|
| 400 |
+
<layer id="37" name="Constant_121389" type="Const" version="opset1">
|
| 401 |
+
<data element_type="i32" shape="9" offset="9767010" size="36" />
|
| 402 |
+
<output>
|
| 403 |
+
<port id="0" precision="I32">
|
| 404 |
+
<dim>9</dim>
|
| 405 |
+
</port>
|
| 406 |
+
</output>
|
| 407 |
+
</layer>
|
| 408 |
+
<layer id="38" name="BPETokenizer_121390" type="BPETokenizer" version="extension">
|
| 409 |
+
<data unk_token="<unk>" fuse_unk="true" suffix_indicator="" end_suffix="" byte_fallback="true" cache_capacity="33220" />
|
| 410 |
+
<input>
|
| 411 |
+
<port id="0" precision="I32">
|
| 412 |
+
<dim>-1</dim>
|
| 413 |
+
</port>
|
| 414 |
+
<port id="1" precision="I32">
|
| 415 |
+
<dim>-1</dim>
|
| 416 |
+
</port>
|
| 417 |
+
<port id="2" precision="I32">
|
| 418 |
+
<dim>-1</dim>
|
| 419 |
+
</port>
|
| 420 |
+
<port id="3" precision="I32">
|
| 421 |
+
<dim>-1</dim>
|
| 422 |
+
</port>
|
| 423 |
+
<port id="4" precision="U8">
|
| 424 |
+
<dim>-1</dim>
|
| 425 |
+
</port>
|
| 426 |
+
<port id="5" precision="I32">
|
| 427 |
+
<dim>166107</dim>
|
| 428 |
+
</port>
|
| 429 |
+
<port id="6" precision="I32">
|
| 430 |
+
<dim>166107</dim>
|
| 431 |
+
</port>
|
| 432 |
+
<port id="7" precision="U8">
|
| 433 |
+
<dim>1286755</dim>
|
| 434 |
+
</port>
|
| 435 |
+
<port id="8" precision="I32">
|
| 436 |
+
<dim>296888</dim>
|
| 437 |
+
</port>
|
| 438 |
+
<port id="9" precision="I32">
|
| 439 |
+
<dim>296888</dim>
|
| 440 |
+
</port>
|
| 441 |
+
<port id="10" precision="U8">
|
| 442 |
+
<dim>1363596</dim>
|
| 443 |
+
</port>
|
| 444 |
+
<port id="11" precision="I32">
|
| 445 |
+
<dim>296888</dim>
|
| 446 |
+
</port>
|
| 447 |
+
<port id="12" precision="I32">
|
| 448 |
+
<dim>296888</dim>
|
| 449 |
+
</port>
|
| 450 |
+
<port id="13" precision="U8">
|
| 451 |
+
<dim>1037128</dim>
|
| 452 |
+
</port>
|
| 453 |
+
<port id="14" precision="I32">
|
| 454 |
+
<dim>9</dim>
|
| 455 |
+
</port>
|
| 456 |
+
<port id="15" precision="I32">
|
| 457 |
+
<dim>9</dim>
|
| 458 |
+
</port>
|
| 459 |
+
<port id="16" precision="U8">
|
| 460 |
+
<dim>80</dim>
|
| 461 |
+
</port>
|
| 462 |
+
<port id="17" precision="I32">
|
| 463 |
+
<dim>9</dim>
|
| 464 |
+
</port>
|
| 465 |
+
</input>
|
| 466 |
+
<output>
|
| 467 |
+
<port id="18" precision="I32">
|
| 468 |
+
<dim>-1</dim>
|
| 469 |
+
</port>
|
| 470 |
+
<port id="19" precision="I32">
|
| 471 |
+
<dim>-1</dim>
|
| 472 |
+
</port>
|
| 473 |
+
<port id="20" precision="I32">
|
| 474 |
+
<dim>-1</dim>
|
| 475 |
+
</port>
|
| 476 |
+
</output>
|
| 477 |
+
</layer>
|
| 478 |
+
<layer id="39" name="Constant_121391" type="Const" version="opset1">
|
| 479 |
+
<data element_type="i32" shape="" offset="9767046" size="4" />
|
| 480 |
+
<output>
|
| 481 |
+
<port id="0" precision="I32" />
|
| 482 |
+
</output>
|
| 483 |
+
</layer>
|
| 484 |
+
<layer id="40" name="Constant_121393" type="Const" version="opset1">
|
| 485 |
+
<data element_type="u8" shape="5" offset="9767050" size="5" />
|
| 486 |
+
<output>
|
| 487 |
+
<port id="0" precision="U8">
|
| 488 |
+
<dim>5</dim>
|
| 489 |
+
</port>
|
| 490 |
+
</output>
|
| 491 |
+
</layer>
|
| 492 |
+
<layer id="41" name="Constant_121395" type="Const" version="opset1">
|
| 493 |
+
<data element_type="u8" shape="13" offset="9767055" size="13" />
|
| 494 |
+
<output>
|
| 495 |
+
<port id="0" precision="U8">
|
| 496 |
+
<dim>13</dim>
|
| 497 |
+
</port>
|
| 498 |
+
</output>
|
| 499 |
+
</layer>
|
| 500 |
+
<layer id="42" name="Truncate_121396" type="Truncate" version="extension">
|
| 501 |
+
<data m_num_inputs="1" />
|
| 502 |
+
<input>
|
| 503 |
+
<port id="0" precision="I32">
|
| 504 |
+
<dim>-1</dim>
|
| 505 |
+
</port>
|
| 506 |
+
<port id="1" precision="I32">
|
| 507 |
+
<dim>-1</dim>
|
| 508 |
+
</port>
|
| 509 |
+
<port id="2" precision="I32">
|
| 510 |
+
<dim>-1</dim>
|
| 511 |
+
</port>
|
| 512 |
+
<port id="3" precision="I32" />
|
| 513 |
+
<port id="4" precision="U8">
|
| 514 |
+
<dim>5</dim>
|
| 515 |
+
</port>
|
| 516 |
+
<port id="5" precision="U8">
|
| 517 |
+
<dim>13</dim>
|
| 518 |
+
</port>
|
| 519 |
+
</input>
|
| 520 |
+
<output>
|
| 521 |
+
<port id="6" precision="I32">
|
| 522 |
+
<dim>-1</dim>
|
| 523 |
+
</port>
|
| 524 |
+
<port id="7" precision="I32">
|
| 525 |
+
<dim>-1</dim>
|
| 526 |
+
</port>
|
| 527 |
+
<port id="8" precision="I32">
|
| 528 |
+
<dim>-1</dim>
|
| 529 |
+
</port>
|
| 530 |
+
</output>
|
| 531 |
+
</layer>
|
| 532 |
+
<layer id="43" name="Constant_121400" type="Const" version="opset1">
|
| 533 |
+
<data element_type="i32" shape="2" offset="12" size="8" />
|
| 534 |
+
<output>
|
| 535 |
+
<port id="0" precision="I32">
|
| 536 |
+
<dim>2</dim>
|
| 537 |
+
</port>
|
| 538 |
+
</output>
|
| 539 |
+
</layer>
|
| 540 |
+
<layer id="44" name="CombineSegments_121401" type="CombineSegments" version="extension">
|
| 541 |
+
<input>
|
| 542 |
+
<port id="0" precision="I32" />
|
| 543 |
+
<port id="1" precision="I32" />
|
| 544 |
+
<port id="2" precision="I32">
|
| 545 |
+
<dim>1</dim>
|
| 546 |
+
</port>
|
| 547 |
+
<port id="3" precision="I32">
|
| 548 |
+
<dim>-1</dim>
|
| 549 |
+
</port>
|
| 550 |
+
<port id="4" precision="I32">
|
| 551 |
+
<dim>-1</dim>
|
| 552 |
+
</port>
|
| 553 |
+
<port id="5" precision="I32">
|
| 554 |
+
<dim>-1</dim>
|
| 555 |
+
</port>
|
| 556 |
+
<port id="6" precision="I32">
|
| 557 |
+
<dim>2</dim>
|
| 558 |
+
</port>
|
| 559 |
+
</input>
|
| 560 |
+
<output>
|
| 561 |
+
<port id="7" precision="I32">
|
| 562 |
+
<dim>-1</dim>
|
| 563 |
+
</port>
|
| 564 |
+
<port id="8" precision="I32">
|
| 565 |
+
<dim>-1</dim>
|
| 566 |
+
</port>
|
| 567 |
+
<port id="9" precision="I32">
|
| 568 |
+
<dim>-1</dim>
|
| 569 |
+
</port>
|
| 570 |
+
<port id="10" precision="I32">
|
| 571 |
+
<dim>-1</dim>
|
| 572 |
+
</port>
|
| 573 |
+
<port id="11" precision="I32">
|
| 574 |
+
<dim>-1</dim>
|
| 575 |
+
</port>
|
| 576 |
+
<port id="12" precision="I32">
|
| 577 |
+
<dim>-1</dim>
|
| 578 |
+
</port>
|
| 579 |
+
</output>
|
| 580 |
+
</layer>
|
| 581 |
+
<layer id="45" name="Subtract_121402" type="Subtract" version="opset1">
|
| 582 |
+
<data auto_broadcast="numpy" />
|
| 583 |
+
<input>
|
| 584 |
+
<port id="0" precision="I32">
|
| 585 |
+
<dim>-1</dim>
|
| 586 |
+
</port>
|
| 587 |
+
<port id="1" precision="I32">
|
| 588 |
+
<dim>-1</dim>
|
| 589 |
+
</port>
|
| 590 |
+
</input>
|
| 591 |
+
<output>
|
| 592 |
+
<port id="2" precision="I32">
|
| 593 |
+
<dim>-1</dim>
|
| 594 |
+
</port>
|
| 595 |
+
</output>
|
| 596 |
+
</layer>
|
| 597 |
+
<layer id="46" name="Constant_121403" type="Const" version="opset1">
|
| 598 |
+
<data element_type="i32" shape="" offset="0" size="4" />
|
| 599 |
+
<output>
|
| 600 |
+
<port id="0" precision="I32" />
|
| 601 |
+
</output>
|
| 602 |
+
</layer>
|
| 603 |
+
<layer id="47" name="ReduceMax_121404" type="ReduceMax" version="opset1">
|
| 604 |
+
<data keep_dims="false" />
|
| 605 |
+
<input>
|
| 606 |
+
<port id="0" precision="I32">
|
| 607 |
+
<dim>-1</dim>
|
| 608 |
+
</port>
|
| 609 |
+
<port id="1" precision="I32" />
|
| 610 |
+
</input>
|
| 611 |
+
<output>
|
| 612 |
+
<port id="2" precision="I32" />
|
| 613 |
+
</output>
|
| 614 |
+
</layer>
|
| 615 |
+
<layer id="48" name="Constant_121405" type="Const" version="opset1">
|
| 616 |
+
<data element_type="i32" shape="" offset="0" size="4" />
|
| 617 |
+
<output>
|
| 618 |
+
<port id="0" precision="I32" />
|
| 619 |
+
</output>
|
| 620 |
+
</layer>
|
| 621 |
+
<layer id="49" name="RaggedToDense_121406" type="RaggedToDense" version="extension">
|
| 622 |
+
<data pad_right="false" m_pad_max_length="false" />
|
| 623 |
+
<input>
|
| 624 |
+
<port id="0" precision="I32">
|
| 625 |
+
<dim>-1</dim>
|
| 626 |
+
</port>
|
| 627 |
+
<port id="1" precision="I32">
|
| 628 |
+
<dim>-1</dim>
|
| 629 |
+
</port>
|
| 630 |
+
<port id="2" precision="I32">
|
| 631 |
+
<dim>-1</dim>
|
| 632 |
+
</port>
|
| 633 |
+
<port id="3" precision="I32" />
|
| 634 |
+
<port id="4" precision="I32" />
|
| 635 |
+
</input>
|
| 636 |
+
<output>
|
| 637 |
+
<port id="5" precision="I32">
|
| 638 |
+
<dim>-1</dim>
|
| 639 |
+
<dim>-1</dim>
|
| 640 |
+
</port>
|
| 641 |
+
<port id="6" precision="BOOL">
|
| 642 |
+
<dim>-1</dim>
|
| 643 |
+
<dim>-1</dim>
|
| 644 |
+
</port>
|
| 645 |
+
</output>
|
| 646 |
+
</layer>
|
| 647 |
+
<layer id="50" name="Convert_121407" type="Convert" version="opset1">
|
| 648 |
+
<data destination_type="i32" />
|
| 649 |
+
<input>
|
| 650 |
+
<port id="0" precision="BOOL">
|
| 651 |
+
<dim>-1</dim>
|
| 652 |
+
<dim>-1</dim>
|
| 653 |
+
</port>
|
| 654 |
+
</input>
|
| 655 |
+
<output>
|
| 656 |
+
<port id="1" precision="I32">
|
| 657 |
+
<dim>-1</dim>
|
| 658 |
+
<dim>-1</dim>
|
| 659 |
+
</port>
|
| 660 |
+
</output>
|
| 661 |
+
</layer>
|
| 662 |
+
<layer id="51" name="Convert_121407.0" type="Convert" version="opset1">
|
| 663 |
+
<data destination_type="i64" />
|
| 664 |
+
<input>
|
| 665 |
+
<port id="0" precision="I32">
|
| 666 |
+
<dim>-1</dim>
|
| 667 |
+
<dim>-1</dim>
|
| 668 |
+
</port>
|
| 669 |
+
</input>
|
| 670 |
+
<output>
|
| 671 |
+
<port id="1" precision="I64" names="attention_mask">
|
| 672 |
+
<dim>-1</dim>
|
| 673 |
+
<dim>-1</dim>
|
| 674 |
+
</port>
|
| 675 |
+
</output>
|
| 676 |
+
</layer>
|
| 677 |
+
<layer id="52" name="RaggedToDense_121406.0" type="Convert" version="opset1">
|
| 678 |
+
<data destination_type="i64" />
|
| 679 |
+
<input>
|
| 680 |
+
<port id="0" precision="I32">
|
| 681 |
+
<dim>-1</dim>
|
| 682 |
+
<dim>-1</dim>
|
| 683 |
+
</port>
|
| 684 |
+
</input>
|
| 685 |
+
<output>
|
| 686 |
+
<port id="1" precision="I64" names="input_ids">
|
| 687 |
+
<dim>-1</dim>
|
| 688 |
+
<dim>-1</dim>
|
| 689 |
+
</port>
|
| 690 |
+
</output>
|
| 691 |
+
</layer>
|
| 692 |
+
<layer id="53" name="Result_121410" type="Result" version="opset1" output_names="input_ids">
|
| 693 |
+
<input>
|
| 694 |
+
<port id="0" precision="I64">
|
| 695 |
+
<dim>-1</dim>
|
| 696 |
+
<dim>-1</dim>
|
| 697 |
+
</port>
|
| 698 |
+
</input>
|
| 699 |
+
</layer>
|
| 700 |
+
<layer id="54" name="Result_121412" type="Result" version="opset1" output_names="attention_mask">
|
| 701 |
+
<input>
|
| 702 |
+
<port id="0" precision="I64">
|
| 703 |
+
<dim>-1</dim>
|
| 704 |
+
<dim>-1</dim>
|
| 705 |
+
</port>
|
| 706 |
+
</input>
|
| 707 |
+
</layer>
|
| 708 |
+
</layers>
|
| 709 |
+
<edges>
|
| 710 |
+
<edge from-layer="0" from-port="0" to-layer="5" to-port="0" />
|
| 711 |
+
<edge from-layer="1" from-port="0" to-layer="44" to-port="0" />
|
| 712 |
+
<edge from-layer="2" from-port="0" to-layer="44" to-port="1" />
|
| 713 |
+
<edge from-layer="3" from-port="0" to-layer="44" to-port="2" />
|
| 714 |
+
<edge from-layer="4" from-port="0" to-layer="14" to-port="0" />
|
| 715 |
+
<edge from-layer="5" from-port="1" to-layer="8" to-port="0" />
|
| 716 |
+
<edge from-layer="5" from-port="2" to-layer="8" to-port="1" />
|
| 717 |
+
<edge from-layer="5" from-port="3" to-layer="8" to-port="2" />
|
| 718 |
+
<edge from-layer="6" from-port="0" to-layer="8" to-port="3" />
|
| 719 |
+
<edge from-layer="7" from-port="0" to-layer="8" to-port="4" />
|
| 720 |
+
<edge from-layer="8" from-port="5" to-layer="9" to-port="0" />
|
| 721 |
+
<edge from-layer="8" from-port="5" to-layer="21" to-port="2" />
|
| 722 |
+
<edge from-layer="8" from-port="6" to-layer="21" to-port="3" />
|
| 723 |
+
<edge from-layer="8" from-port="7" to-layer="21" to-port="4" />
|
| 724 |
+
<edge from-layer="9" from-port="1" to-layer="12" to-port="0" />
|
| 725 |
+
<edge from-layer="10" from-port="0" to-layer="12" to-port="1" />
|
| 726 |
+
<edge from-layer="11" from-port="0" to-layer="12" to-port="2" />
|
| 727 |
+
<edge from-layer="12" from-port="3" to-layer="14" to-port="1" />
|
| 728 |
+
<edge from-layer="12" from-port="3" to-layer="17" to-port="0" />
|
| 729 |
+
<edge from-layer="13" from-port="0" to-layer="14" to-port="2" />
|
| 730 |
+
<edge from-layer="14" from-port="3" to-layer="21" to-port="0" />
|
| 731 |
+
<edge from-layer="15" from-port="0" to-layer="19" to-port="0" />
|
| 732 |
+
<edge from-layer="16" from-port="0" to-layer="17" to-port="1" />
|
| 733 |
+
<edge from-layer="17" from-port="2" to-layer="19" to-port="1" />
|
| 734 |
+
<edge from-layer="18" from-port="0" to-layer="19" to-port="2" />
|
| 735 |
+
<edge from-layer="19" from-port="3" to-layer="21" to-port="1" />
|
| 736 |
+
<edge from-layer="20" from-port="0" to-layer="21" to-port="5" />
|
| 737 |
+
<edge from-layer="21" from-port="8" to-layer="24" to-port="0" />
|
| 738 |
+
<edge from-layer="21" from-port="9" to-layer="24" to-port="1" />
|
| 739 |
+
<edge from-layer="21" from-port="10" to-layer="24" to-port="2" />
|
| 740 |
+
<edge from-layer="21" from-port="11" to-layer="24" to-port="3" />
|
| 741 |
+
<edge from-layer="21" from-port="6" to-layer="38" to-port="0" />
|
| 742 |
+
<edge from-layer="21" from-port="7" to-layer="38" to-port="1" />
|
| 743 |
+
<edge from-layer="22" from-port="0" to-layer="24" to-port="4" />
|
| 744 |
+
<edge from-layer="23" from-port="0" to-layer="24" to-port="5" />
|
| 745 |
+
<edge from-layer="24" from-port="6" to-layer="38" to-port="2" />
|
| 746 |
+
<edge from-layer="24" from-port="7" to-layer="38" to-port="3" />
|
| 747 |
+
<edge from-layer="24" from-port="8" to-layer="38" to-port="4" />
|
| 748 |
+
<edge from-layer="25" from-port="0" to-layer="38" to-port="5" />
|
| 749 |
+
<edge from-layer="26" from-port="0" to-layer="38" to-port="6" />
|
| 750 |
+
<edge from-layer="27" from-port="0" to-layer="38" to-port="7" />
|
| 751 |
+
<edge from-layer="28" from-port="0" to-layer="38" to-port="8" />
|
| 752 |
+
<edge from-layer="29" from-port="0" to-layer="38" to-port="9" />
|
| 753 |
+
<edge from-layer="30" from-port="0" to-layer="38" to-port="10" />
|
| 754 |
+
<edge from-layer="31" from-port="0" to-layer="38" to-port="11" />
|
| 755 |
+
<edge from-layer="32" from-port="0" to-layer="38" to-port="12" />
|
| 756 |
+
<edge from-layer="33" from-port="0" to-layer="38" to-port="13" />
|
| 757 |
+
<edge from-layer="34" from-port="0" to-layer="38" to-port="14" />
|
| 758 |
+
<edge from-layer="35" from-port="0" to-layer="38" to-port="15" />
|
| 759 |
+
<edge from-layer="36" from-port="0" to-layer="38" to-port="16" />
|
| 760 |
+
<edge from-layer="37" from-port="0" to-layer="38" to-port="17" />
|
| 761 |
+
<edge from-layer="38" from-port="18" to-layer="42" to-port="0" />
|
| 762 |
+
<edge from-layer="38" from-port="19" to-layer="42" to-port="1" />
|
| 763 |
+
<edge from-layer="38" from-port="20" to-layer="42" to-port="2" />
|
| 764 |
+
<edge from-layer="39" from-port="0" to-layer="42" to-port="3" />
|
| 765 |
+
<edge from-layer="40" from-port="0" to-layer="42" to-port="4" />
|
| 766 |
+
<edge from-layer="41" from-port="0" to-layer="42" to-port="5" />
|
| 767 |
+
<edge from-layer="42" from-port="6" to-layer="44" to-port="3" />
|
| 768 |
+
<edge from-layer="42" from-port="7" to-layer="44" to-port="4" />
|
| 769 |
+
<edge from-layer="42" from-port="8" to-layer="44" to-port="5" />
|
| 770 |
+
<edge from-layer="43" from-port="0" to-layer="44" to-port="6" />
|
| 771 |
+
<edge from-layer="44" from-port="8" to-layer="45" to-port="0" />
|
| 772 |
+
<edge from-layer="44" from-port="7" to-layer="45" to-port="1" />
|
| 773 |
+
<edge from-layer="44" from-port="7" to-layer="49" to-port="0" />
|
| 774 |
+
<edge from-layer="44" from-port="8" to-layer="49" to-port="1" />
|
| 775 |
+
<edge from-layer="44" from-port="9" to-layer="49" to-port="2" />
|
| 776 |
+
<edge from-layer="45" from-port="2" to-layer="47" to-port="0" />
|
| 777 |
+
<edge from-layer="46" from-port="0" to-layer="47" to-port="1" />
|
| 778 |
+
<edge from-layer="47" from-port="2" to-layer="49" to-port="3" />
|
| 779 |
+
<edge from-layer="48" from-port="0" to-layer="49" to-port="4" />
|
| 780 |
+
<edge from-layer="49" from-port="6" to-layer="50" to-port="0" />
|
| 781 |
+
<edge from-layer="49" from-port="5" to-layer="52" to-port="0" />
|
| 782 |
+
<edge from-layer="50" from-port="1" to-layer="51" to-port="0" />
|
| 783 |
+
<edge from-layer="51" from-port="1" to-layer="54" to-port="0" />
|
| 784 |
+
<edge from-layer="52" from-port="1" to-layer="53" to-port="0" />
|
| 785 |
+
</edges>
|
| 786 |
+
<rt_info>
|
| 787 |
+
<info name="OpenVINO Runtime" value="2026.3.1-22476-759c5a6ab8c-releases/2026/3" />
|
| 788 |
+
<add_attention_mask value="True" />
|
| 789 |
+
<add_prefix_space />
|
| 790 |
+
<add_special_tokens value="True" />
|
| 791 |
+
<bos_token_id value="166100" />
|
| 792 |
+
<chat_template value=" {%- macro visible_text(content) -%} {%- if content is string -%} {{- content }} {%- elif content is iterable and content is not mapping -%} {%- for item in content -%} {%- if item is mapping and item.type == 'text' -%} {{- item.text }} {%- elif item is string -%} {{- item }} {%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%} {%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%} {{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }} {%- endif -%} {%- endfor -%} {%- else -%} {{- content }} {%- endif -%} {%- endmacro -%} {%- set tool_call_format = tool_call_format if tool_call_format is defined else 'xml' %} {%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages|length > 0 and messages[0].get('role', '') == 'system' %} {{- visible_text(messages[0].content) + '\n\n' }} {%- else %} {{- '你是一位工具函数调用专家,你会得到一个问题和一组可能的工具函数。根据问题,你需要进行一个或多个函数/工具调用以实现目的,请尽量尝试探索通过工具解决问题。\n如果没有一个函数可以使用,请直接使用自然语言回复用户。\n如果给定的问题缺少函数所需的参数,请使用自然语言进行提问,向用户询问必要信息。\n如果调用结果已经足够回答用户问题,请对历史结果进行总结,使用自然语言回复用户。' }} {%- endif %} {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {%- if tool_call_format == 'json' %} {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n" }} {{- '<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n' }} {%- else %} {{- "\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n" }} {{- '<tool_call> <function=example_function_name> <parameter=example_parameter_1> value_1 </parameter> <parameter=example_parameter_2> This is the value for the second parameter that can span multiple lines </parameter> </function> </tool_call><|im_end|>\n' }} {%- endif %} {%- else %} {%- if messages|length > 0 and messages[0].get('role', '') == 'system' %} {{- '<|im_start|>system\n' + visible_text(messages[0].content) + '<|im_end|>\n' }} {%- else %} {{- '<|im_start|>system\n你是南北阁,一款由BOSS直聘自主研发并训练的专业大语言模型。<|im_end|>\n' }} {%- endif %} {%- endif %} {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %} {%- for message in messages[::-1] %} {%- set index = (messages|length - 1) - loop.index0 %} {%- if ns.multi_step_tool and message.get('role', '') == "user" and visible_text(message.content) is string and not(visible_text(message.content).startswith('<tool_response>') and visible_text(message.content).endswith('</tool_response>')) %} {%- set ns.multi_step_tool = false %} {%- set ns.last_query_index = index %} {%- endif %} {%- endfor %} {%- for message in messages %} {%- if visible_text(message.content) is string %} {%- set content = visible_text(message.content) %} {%- else %} {%- set content = '' %} {%- endif %} {%- if message.get('role', '') == "system" %} {%- if not loop.first %} {{- raise_exception('System message must be at the beginning.') }} {%- endif %} {%- elif message.get('role', '') == "assistant" %} {%- set reasoning_content = '' %} {%- if message.reasoning_content is string %} {%- set reasoning_content = message.reasoning_content %} {%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n').rstrip('\n') %} {%- endif %} {%- endif %} {%- set reasoning_content = reasoning_content|trim %} {%- if (preserve_thinking is defined and preserve_thinking is false) and (loop.index0 < ns.last_query_index) %} {{- '<|im_start|>' + message.get('role', '') + '\n<think>\n\n</think>\n\n' + content }} {%- else %} {{- '<|im_start|>' + message.get('role', '') + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }} {%- endif %} {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %} {%- if tool_call_format == 'json' %} {%- for tool_call in message.tool_calls %} {%- if (loop.first and content) or (not loop.first) %} {{- '\n' }} {%- endif %} {%- if tool_call.function %} {%- set tool_call = tool_call.function %} {%- endif %} {{- '<tool_call>\n{"name": "' }} {{- tool_call.name }} {{- '", "arguments": ' }} {%- if tool_call.arguments is string %} {{- tool_call.arguments }} {%- else %} {{- tool_call.arguments | tojson }} {%- endif %} {{- '}\n</tool_call>' }} {%- endfor %} {%- else %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {%- if loop.first %} {%- if content|trim %} {{- ' <tool_call> <function=' + tool_call.name + '> ' }} {%- else %} {{- '<tool_call> <function=' + tool_call.name + '> ' }} {%- endif %} {%- else %} {{- ' <tool_call> <function=' + tool_call.name + '> ' }} {%- endif %} {%- if tool_call.arguments is defined %} {%- for args_name, args_value in tool_call.arguments|items %} {{- '<parameter=' + args_name + '> ' }} {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %} {{- args_value }} {{- ' </parameter> ' }} {%- endfor %} {%- endif %} {{- '</function> </tool_call>' }} {%- endfor %} {%- endif %} {%- endif %} {{- '<|im_end|>\n' }} {%- elif message.get('role', '') == "tool" %} {%- if loop.previtem and loop.previtem.get('role', '') != "tool" %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- content }} {{- '\n</tool_response>' }} {%- if loop.last or loop.nextitem.get('role', '') != "tool" %} {{- '<|im_end|>\n' }} {%- endif %} {%- elif message.get('role', '') != '' %} {{- '<|im_start|>' + message.get('role', '') + '\n' + content + '<|im_end|>' + '\n' }} {%- endif %} {%- endfor %} {%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- if enable_thinking is defined and enable_thinking is false %} {{- '<think> </think> ' }} {%- else %} {{- '<think> ' }} {%- endif %} {%- endif %} " />
|
| 793 |
+
<clean_up_tokenization_spaces />
|
| 794 |
+
<detokenizer_input_type value="i64" />
|
| 795 |
+
<eos_token_id value="166101" />
|
| 796 |
+
<handle_special_tokens_with_re />
|
| 797 |
+
<max_length />
|
| 798 |
+
<number_of_inputs value="1" />
|
| 799 |
+
<openvino_tokenizers_version value="2026.3.1.0-705-77e4637387c" />
|
| 800 |
+
<openvino_version value="2026.3.1-22476-759c5a6ab8c-releases/2026/3" />
|
| 801 |
+
<original_post_processor_template value="{"type": "TemplateProcessing", "single": [{"SpecialToken": {"id": "<|im_start|>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}], "pair": [{"SpecialToken": {"id": "<|im_start|>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}, {"SpecialToken": {"id": "<|im_start|>", "type_id": 1}}, {"Sequence": {"id": "B", "type_id": 1}}], "special_tokens": {"<|im_start|>": {"id": "<|im_start|>", "ids": [166100], "tokens": ["<|im_start|>"]}}}" />
|
| 802 |
+
<original_tokenizer_class value="<class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>" />
|
| 803 |
+
<pad_token_id value="0" />
|
| 804 |
+
<processed_post_processor_template value="{"single": {"ids": [166100, -1], "type_ids": [0, 0]}, "pair": {"ids": [166100, -1, 166100, -2], "type_ids": [0, 0, 1, 1]}}" />
|
| 805 |
+
<sentencepiece_version value="0.2.2" />
|
| 806 |
+
<skip_special_tokens value="True" />
|
| 807 |
+
<streaming_detokenizer value="False" />
|
| 808 |
+
<tokenizer_output_type value="i64" />
|
| 809 |
+
<tokenizers_version value="0.22.2" />
|
| 810 |
+
<transformers_version value="4.57.6" />
|
| 811 |
+
<use_max_padding value="False" />
|
| 812 |
+
<use_sentencepiece_backend value="False" />
|
| 813 |
+
<utf8_replace_mode value="replace" />
|
| 814 |
+
<with_detokenizer value="True" />
|
| 815 |
+
</rt_info>
|
| 816 |
+
</net>
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|endoftext|>"
|
| 4 |
+
],
|
| 5 |
+
"bos_token": {
|
| 6 |
+
"content": "<|im_start|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false
|
| 11 |
+
},
|
| 12 |
+
"eos_token": {
|
| 13 |
+
"content": "<|im_end|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false
|
| 18 |
+
},
|
| 19 |
+
"pad_token": {
|
| 20 |
+
"content": "<unk>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": true,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false
|
| 25 |
+
},
|
| 26 |
+
"unk_token": {
|
| 27 |
+
"content": "<unk>",
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"normalized": true,
|
| 30 |
+
"rstrip": false,
|
| 31 |
+
"single_word": false
|
| 32 |
+
}
|
| 33 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d858a0fc007f22af6ae18bfa1ae52d30e398aa9cd1ea06e7777176869346a3f
|
| 3 |
+
size 18450979
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb41d04798b714520a9b075727b0226538b7330254299062742c50ec8374bc36
|
| 3 |
+
size 2782298
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": true,
|
| 5 |
+
"added_tokens_decoder": {
|
| 6 |
+
"0": {
|
| 7 |
+
"content": "<unk>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": true,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false,
|
| 12 |
+
"special": true
|
| 13 |
+
},
|
| 14 |
+
"1": {
|
| 15 |
+
"content": "<s>",
|
| 16 |
+
"lstrip": false,
|
| 17 |
+
"normalized": true,
|
| 18 |
+
"rstrip": false,
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"special": true
|
| 21 |
+
},
|
| 22 |
+
"2": {
|
| 23 |
+
"content": "</s>",
|
| 24 |
+
"lstrip": false,
|
| 25 |
+
"normalized": true,
|
| 26 |
+
"rstrip": false,
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"special": true
|
| 29 |
+
},
|
| 30 |
+
"166100": {
|
| 31 |
+
"content": "<|im_start|>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"special": true
|
| 37 |
+
},
|
| 38 |
+
"166101": {
|
| 39 |
+
"content": "<|im_end|>",
|
| 40 |
+
"lstrip": false,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false,
|
| 44 |
+
"special": true
|
| 45 |
+
},
|
| 46 |
+
"166102": {
|
| 47 |
+
"content": "<|endoftext|>",
|
| 48 |
+
"lstrip": false,
|
| 49 |
+
"normalized": false,
|
| 50 |
+
"rstrip": false,
|
| 51 |
+
"single_word": false,
|
| 52 |
+
"special": true
|
| 53 |
+
},
|
| 54 |
+
"166103": {
|
| 55 |
+
"content": "<think>",
|
| 56 |
+
"lstrip": false,
|
| 57 |
+
"normalized": true,
|
| 58 |
+
"rstrip": false,
|
| 59 |
+
"single_word": false,
|
| 60 |
+
"special": false
|
| 61 |
+
},
|
| 62 |
+
"166104": {
|
| 63 |
+
"content": "</think>",
|
| 64 |
+
"lstrip": false,
|
| 65 |
+
"normalized": true,
|
| 66 |
+
"rstrip": false,
|
| 67 |
+
"single_word": false,
|
| 68 |
+
"special": false
|
| 69 |
+
},
|
| 70 |
+
"166105": {
|
| 71 |
+
"content": "<tool_call>",
|
| 72 |
+
"lstrip": false,
|
| 73 |
+
"normalized": true,
|
| 74 |
+
"rstrip": false,
|
| 75 |
+
"single_word": false,
|
| 76 |
+
"special": false
|
| 77 |
+
},
|
| 78 |
+
"166106": {
|
| 79 |
+
"content": "</tool_call>",
|
| 80 |
+
"lstrip": false,
|
| 81 |
+
"normalized": true,
|
| 82 |
+
"rstrip": false,
|
| 83 |
+
"single_word": false,
|
| 84 |
+
"special": false
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"additional_special_tokens": [
|
| 88 |
+
"<|endoftext|>"
|
| 89 |
+
],
|
| 90 |
+
"bos_token": "<|im_start|>",
|
| 91 |
+
"clean_up_tokenization_spaces": false,
|
| 92 |
+
"eos_token": "<|im_end|>",
|
| 93 |
+
"extra_special_tokens": {},
|
| 94 |
+
"legacy": false,
|
| 95 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 96 |
+
"pad_token": "<unk>",
|
| 97 |
+
"sp_model_kwargs": {},
|
| 98 |
+
"spaces_between_special_tokens": false,
|
| 99 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 100 |
+
"unk_token": "<unk>",
|
| 101 |
+
"use_default_system_prompt": false
|
| 102 |
+
}
|