Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
image-to-code
video-to-code
agentic-reinforcement-learning
conversational
Instructions to use Skywalker0410/CodingDINO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Skywalker0410/CodingDINO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Skywalker0410/CodingDINO") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Skywalker0410/CodingDINO") model = AutoModelForMultimodalLM.from_pretrained("Skywalker0410/CodingDINO", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Skywalker0410/CodingDINO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Skywalker0410/CodingDINO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skywalker0410/CodingDINO", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Skywalker0410/CodingDINO
- SGLang
How to use Skywalker0410/CodingDINO with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Skywalker0410/CodingDINO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skywalker0410/CodingDINO", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Skywalker0410/CodingDINO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skywalker0410/CodingDINO", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Skywalker0410/CodingDINO with Docker Model Runner:
docker model run hf.co/Skywalker0410/CodingDINO
Publish reviewed release files
Browse files- LICENSE +201 -0
- LICENSE.base-model +202 -0
- NOTICE.md +5 -0
- README.md +509 -0
- SHA256SUMS +36 -0
- assets/modelscope-logo.svg +17 -0
- chat_template.jinja +170 -0
- config.json +140 -0
- generation_config.json +14 -0
- model.safetensors.index.json +0 -0
- native-gdn/README.md +13 -0
- native-gdn/export_completed.json +4 -0
- native-gdn/gdn_worker_checks/README.md +5 -0
- native-gdn/gdn_worker_checks/rank_000.json +340 -0
- native-gdn/native_gdn_norm_delta.safetensors +3 -0
- preprocessor_config.json +26 -0
- processor_config.json +60 -0
- tokenizer_config.json +305 -0
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
LICENSE.base-model
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright 2026 Alibaba Cloud
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
NOTICE.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Attribution
|
| 2 |
+
|
| 3 |
+
CodingDINO is a post-trained version of [Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B). The CodingDINO authors adapted the model weights for visual reconstruction as executable code. The checkpoint is distributed under the [Apache License 2.0](LICENSE).
|
| 4 |
+
|
| 5 |
+
The base model copyright notice is **Copyright 2026 Alibaba Cloud**. The original license is included in [LICENSE.base-model](LICENSE.base-model). The visual reward uses the frozen [DINOv2](https://github.com/facebookresearch/dinov2) and [DINOv3](https://github.com/facebookresearch/dinov3) encoders from Meta. Third-party material appearing in the paper illustrations or demo remains the property of its respective rights holders.
|
README.md
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.8-27B
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
- zh
|
| 9 |
+
tags:
|
| 10 |
+
- image-to-code
|
| 11 |
+
- video-to-code
|
| 12 |
+
- agentic-reinforcement-learning
|
| 13 |
+
- safetensors
|
| 14 |
+
inference: false
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
<!-- model-card-language: en -->
|
| 18 |
+
|
| 19 |
+
<a id="english"></a>
|
| 20 |
+
|
| 21 |
+
# <img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/logo.png" width="40" style="display: inline-block; vertical-align: middle; margin: 0;" alt="CodingDINO" /> CodingDINO: Learning to Represent What We See as Code with Agentic Reinforcement Learning
|
| 22 |
+
|
| 23 |
+
**English** | [简体中文](#chinese)
|
| 24 |
+
|
| 25 |
+
<p align="center" style="margin: 0;"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/teaser.png" width="100%" alt="Image and video targets alongside their program renders" style="display: block; margin: 0;" /></p>
|
| 26 |
+
|
| 27 |
+
## 🔗 Quick Links
|
| 28 |
+
|
| 29 |
+
- 🤗 **Hugging Face** · [CodingDINO](https://huggingface.co/Skywalker0410/CodingDINO)
|
| 30 |
+
- <img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/modelscope-logo.svg" width="22" height="20" style="display: inline-block; vertical-align: middle; margin: 0;" alt="ModelScope" /> **ModelScope** · [CodingDINO](https://www.modelscope.ai/models/Skywalker0410/CodingDINO)
|
| 31 |
+
- 🌐 **Project Page** · [CodingDINO](https://skywalker-yqz.github.io/CodingDINO/)
|
| 32 |
+
- 💻 **GitHub Code** · [Skywalker-yqz/CodingDINO](https://github.com/Skywalker-yqz/CodingDINO)
|
| 33 |
+
- 📄 **Paper** · [CodingDINO](https://skywalker-yqz.github.io/CodingDINO/)
|
| 34 |
+
- 📊 **Evaluation Logs** · [Hugging Face](https://huggingface.co/Skywalker0410/CodingDINO-evallog) · [ModelScope](https://www.modelscope.ai/models/Skywalker0410/CodingDINO-evallog)
|
| 35 |
+
- 🛠️ **Usage** · [Quick start](#start-en) · [Evaluation worker](#worker-en) · [Benchmarks](#bench-en)
|
| 36 |
+
|
| 37 |
+
# Model Overview
|
| 38 |
+
|
| 39 |
+
### Description
|
| 40 |
+
|
| 41 |
+
CodingDINO is a 27B vision-language model that reconstructs an image or video as an executable program. Give it a diagram and it can draw an editable SVG. Give it a video and it can write a single program that describes the objects and their motion across frames. In the paper, changing one line of a generated Three.js scene raises the camera over a freeway while the vehicles continue along their paths.
|
| 42 |
+
|
| 43 |
+
The same checkpoint supports two ways of generating code. **CodingDINO-Single** writes a first draft directly from the input. **CodingDINO** can run that draft, inspect the render and revise it. Across six benchmarks, the interactive model ranks first on **10 of 12** headline metrics. Averaged over those metrics, the first draft retains **85.4%** of the interactive score.
|
| 44 |
+
|
| 45 |
+
### Demo Videos
|
| 46 |
+
|
| 47 |
+
<video controls playsinline preload="none" width="100%" poster="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/demo-poster.jpg" src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/demo.mp4"></video>
|
| 48 |
+
|
| 49 |
+
### License/Terms of Use
|
| 50 |
+
|
| 51 |
+
CodingDINO is released under [Apache 2.0](LICENSE). The [original base-model license](LICENSE.base-model) and [attributions](NOTICE.md) accompany the checkpoint. Third-party materials retain their respective rights and terms.
|
| 52 |
+
|
| 53 |
+
<details>
|
| 54 |
+
<summary>Citation</summary>
|
| 55 |
+
|
| 56 |
+
```bibtex
|
| 57 |
+
@misc{yu2026codingdino,
|
| 58 |
+
title={{CodingDINO}: Learning to Represent What We See as Code with Agentic Reinforcement Learning},
|
| 59 |
+
author={Yu, Qize and Zhang, Hanzhen and Chen, Yue and Lu, Jiarui and Chen, Tianxing and Huang, Siqiao and Song, Wenxuan and He, Minghua and Wang, Yuran and Niu, Junbo and Jia, Zhengyu and Shang, Zhihui and Ping, Bowen and Liu, Xianming and Li, Haoang and Luo, Ping and Zhou, Shuchang and Wang, Zijian},
|
| 60 |
+
year={2026},
|
| 61 |
+
url={https://skywalker-yqz.github.io/CodingDINO/}
|
| 62 |
+
}
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
</details>
|
| 66 |
+
|
| 67 |
+
## Model Architecture
|
| 68 |
+
|
| 69 |
+
This release contains the Qwen3.8-27B policy after 65 steps of agentic RL. The checkpoint uses the Transformers class `Qwen3_5ForConditionalGeneration`. After supervised fine-tuning on verified programs, the model trains with GRPO inside a visual coding environment. A submitted program earns a reward from how closely its rendered views match the target, using DINO features. Three.js and Blender tasks also use relative depth. For video, the comparison spans matched timestamps.
|
| 70 |
+
|
| 71 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/framework.png" width="100%" alt="Visual coding environment and agentic reinforcement learning" /></p>
|
| 72 |
+
|
| 73 |
+
## Inputs and Outputs
|
| 74 |
+
|
| 75 |
+
| Input | What you receive |
|
| 76 |
+
| --- | --- |
|
| 77 |
+
| Image and a request for an output format | Editable source, such as an SVG diagram, HTML page, Three.js scene or Blender script. A single chat request returns the proposed source in the assistant message. |
|
| 78 |
+
| Image or video passed to the harness | A validated entry file and any supporting source under `submitted/` on successful submission. The run also writes `result.json` and the interaction history in `episode/`. |
|
| 79 |
+
|
| 80 |
+
<a id="start-en"></a>
|
| 81 |
+
|
| 82 |
+
## Inference
|
| 83 |
+
|
| 84 |
+
### Environment
|
| 85 |
+
|
| 86 |
+
| Component | Reference setup |
|
| 87 |
+
| --- | --- |
|
| 88 |
+
| Model server | Linux, Python 3.13, vLLM 0.29.0, Transformers 5.12.1 |
|
| 89 |
+
| Evaluation replica | 4 × NVIDIA H800, tensor parallelism 4, BF16. PyTorch 2.13.0+cu130 and Triton 3.7.1 |
|
| 90 |
+
| Evaluation worker | Hopper (SM 9.x), Flash Linear Attention and fla-core 0.5.2, Transformer Engine 2.18.0 with CUDA 13, matching learner environment |
|
| 91 |
+
| Rendering client | Python 3.12+, OpenHands, NeMo Gym and the renderer for the output format. Video also uses FFmpeg and ffprobe |
|
| 92 |
+
|
| 93 |
+
### Start a model server
|
| 94 |
+
|
| 95 |
+
Download the full checkpoint. Keep the tokenizer, weight shards and `native-gdn/` together. On a Linux GPU host with a CUDA 13-compatible driver, the following starts a local OpenAI-compatible server with a 32,768-token window.
|
| 96 |
+
|
| 97 |
+
```bash
|
| 98 |
+
python3.13 -m venv .venv-codingdino
|
| 99 |
+
source .venv-codingdino/bin/activate
|
| 100 |
+
python -m pip install 'vllm==0.29.0' huggingface_hub
|
| 101 |
+
hf download Skywalker0410/CodingDINO --local-dir ./CodingDINO-model
|
| 102 |
+
export MODEL_DIR="$(realpath ./CodingDINO-model)"
|
| 103 |
+
vllm serve "$MODEL_DIR" --served-model-name CodingDINO \
|
| 104 |
+
--host 127.0.0.1 --port 8000 --tensor-parallel-size 4 --dtype bfloat16 \
|
| 105 |
+
--max-model-len 32768 --enable-prefix-caching --reasoning-parser qwen3 \
|
| 106 |
+
--enable-auto-tool-choice --tool-call-parser qwen3_coder
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
In a second terminal, check that the service lists `CodingDINO`. Put an image named `target.png` in the current directory, then run the Python example to print the SVG response.
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
curl -fsS http://127.0.0.1:8000/v1/models
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
<details>
|
| 116 |
+
<summary>PNG → SVG · Python example</summary>
|
| 117 |
+
|
| 118 |
+
```python
|
| 119 |
+
import base64
|
| 120 |
+
import json
|
| 121 |
+
from pathlib import Path
|
| 122 |
+
from urllib.request import Request, urlopen
|
| 123 |
+
|
| 124 |
+
image = base64.b64encode(Path("target.png").read_bytes()).decode("ascii")
|
| 125 |
+
body = {
|
| 126 |
+
"model": "CodingDINO",
|
| 127 |
+
"messages": [{
|
| 128 |
+
"role": "user",
|
| 129 |
+
"content": [
|
| 130 |
+
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
|
| 131 |
+
{"type": "text", "text": "Reconstruct this image as editable SVG. Return the SVG source."},
|
| 132 |
+
],
|
| 133 |
+
}],
|
| 134 |
+
"chat_template_kwargs": {
|
| 135 |
+
"enable_thinking": True, "preserve_thinking": True, "reasoning_effort": "xhigh",
|
| 136 |
+
},
|
| 137 |
+
"thinking_token_budget": 4096,
|
| 138 |
+
"max_tokens": 20480,
|
| 139 |
+
"temperature": 0.6,
|
| 140 |
+
"top_p": 0.95,
|
| 141 |
+
}
|
| 142 |
+
request = Request("http://127.0.0.1:8000/v1/chat/completions",
|
| 143 |
+
data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
|
| 144 |
+
with urlopen(request, timeout=600) as response:
|
| 145 |
+
print(json.load(response)["choices"][0]["message"]["content"])
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
</details>
|
| 149 |
+
|
| 150 |
+
## Inference Infrastructure
|
| 151 |
+
|
| 152 |
+
<a id="worker-en"></a>
|
| 153 |
+
|
| 154 |
+
### Serve the evaluation worker
|
| 155 |
+
|
| 156 |
+
The index maps the model parameters to 18 weight shards and one frozen MTP file. The additional tensor file in `native-gdn/` supplies the evaluated worker with the native normalization weights. Serve the directory containing `config.json`.
|
| 157 |
+
|
| 158 |
+
The published run used a 262,144-token context and a dedicated vLLM worker on four H800s per replica. The worker restores 48 native BF16 Gated DeltaNet normalization tensors from `native-gdn/` and checks their fingerprints. The frozen MTP weights provide three speculative tokens. To use the same configuration, stop the standard server, activate the matching vLLM environment and set the three local paths below.
|
| 159 |
+
|
| 160 |
+
Set `MODEL_DIR` to the downloaded checkpoint, `CODE_REPO` to the code checkout that provides `Mix60BenchWorker`, and `LEARNER_PYTHON` to the interpreter containing the matching FLA and Transformer Engine kernels. The launcher points `V2C_MIX60_EXPORT_ROOT` at the native tensors and explicitly selects checkpoint step `65`.
|
| 161 |
+
|
| 162 |
+
<details>
|
| 163 |
+
<summary>Launch one evaluation replica · Bash</summary>
|
| 164 |
+
|
| 165 |
+
```bash
|
| 166 |
+
export MODEL_DIR=/absolute/path/to/Model
|
| 167 |
+
export CODE_REPO=/absolute/path/to/CodingDINO
|
| 168 |
+
LEARNER_PYTHON=/absolute/path/to/learner-env/bin/python
|
| 169 |
+
|
| 170 |
+
export SVG_INFERENCE_PACKAGES="$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
| 171 |
+
export SVG_LEARNER_PACKAGES="$("$LEARNER_PYTHON" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
| 172 |
+
export CUDNN_HOME="$SVG_LEARNER_PACKAGES/nvidia/cudnn"
|
| 173 |
+
export CUDNN_PATH="$CUDNN_HOME"
|
| 174 |
+
export LD_LIBRARY_PATH="$CUDNN_HOME/lib:$SVG_LEARNER_PACKAGES/z3/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
| 175 |
+
export PYTHONPATH="$CODE_REPO/research/vision2code_bench:$CODE_REPO/research/vision2code_agentic_rl/src:$CODE_REPO${PYTHONPATH:+:$PYTHONPATH}"
|
| 176 |
+
|
| 177 |
+
export V2C_MIX60_EXPORT_ROOT="$MODEL_DIR/native-gdn"
|
| 178 |
+
export V2C_EXPECTED_CHECKPOINT_STEP=65
|
| 179 |
+
export V2C_EVALUATION_ROOT="$(mktemp -d)"
|
| 180 |
+
export V2C_REPLICA_NAME=local
|
| 181 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3
|
| 182 |
+
export VLLM_USE_V2_MODEL_RUNNER=0 VLLM_GDN_DECODE_KERNEL=triton
|
| 183 |
+
export VLLM_ALLREDUCE_USE_SYMM_MEM=0 VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
|
| 184 |
+
export SVG_VLLM_PRESERVE_MM_PREFIX_PAYLOAD=1 SVG_VLLM_MM_PREFIX_REPLAY_WORKAROUND=1
|
| 185 |
+
|
| 186 |
+
python -m vllm.entrypoints.openai.api_server \
|
| 187 |
+
--model "$MODEL_DIR" --served-model-name CodingDINO --host 127.0.0.1 --port 8000 \
|
| 188 |
+
--tensor-parallel-size 4 --dtype bfloat16 --kv-cache-dtype auto \
|
| 189 |
+
--max-model-len 262144 --gpu-memory-utilization 0.88 \
|
| 190 |
+
--max-num-seqs 16 --max-num-batched-tokens 8192 \
|
| 191 |
+
--worker-cls harness_v1_eval.mix60_worker.Mix60BenchWorker \
|
| 192 |
+
--mamba-cache-mode align --mamba-ssm-cache-dtype float32 --block-size 1600 \
|
| 193 |
+
--gdn-prefill-backend triton --enable-prefix-caching --async-scheduling \
|
| 194 |
+
--attention-config '{"flash_attn_version":4,"flash_attn_max_num_splits_for_cuda_graph":16}' \
|
| 195 |
+
--compilation-config '{"pass_config":{"fuse_allreduce_rms":false}}' \
|
| 196 |
+
--hf-overrides '{"head_dtype":"bfloat16"}' --logprobs-mode raw_logprobs \
|
| 197 |
+
--mm-processor-cache-gb 0 --skip-mm-profiling --limit-mm-per-prompt '{"image":512}' \
|
| 198 |
+
--enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3 \
|
| 199 |
+
--default-chat-template-kwargs '{"enable_thinking":false,"preserve_thinking":true,"reasoning_effort":"medium"}' \
|
| 200 |
+
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"rejection_sample_method":"standard"}' \
|
| 201 |
+
--trust-remote-code --seed 20261116
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
</details>
|
| 205 |
+
|
| 206 |
+
Each GPU worker writes a load receipt under `V2C_EVALUATION_ROOT`. [Native tensor checks](native-gdn/README.md) · [Distributed evaluation](https://github.com/Skywalker-yqz/CodingDINO/tree/HEAD/research/vision2code_bench/harness_v1_eval)
|
| 207 |
+
|
| 208 |
+
### Run the rendering harness
|
| 209 |
+
|
| 210 |
+
With the 262,144-token endpoint running, use the client environment in a second terminal. Set `CODE_REPO` to the code checkout. Copy `vision2code_harness_v1.yaml`, point `context_tokenizer` at the checkpoint and set `shell_base` and the renderer paths for your output format. The examples reconstruct a PNG as SVG and a video as a Three.js scene. [Harness configuration](https://github.com/Skywalker-yqz/CodingDINO/tree/HEAD/research/vision2code_agentic_rl/configs/harness)
|
| 211 |
+
|
| 212 |
+
<details>
|
| 213 |
+
<summary>Run image and video examples · Bash</summary>
|
| 214 |
+
|
| 215 |
+
```bash
|
| 216 |
+
export CODE_REPO=/absolute/path/to/CodingDINO
|
| 217 |
+
export V2C_AGENT_PYTHON=/absolute/path/to/agent-env/bin/python
|
| 218 |
+
export V2C_AGENT_RUNTIME=/absolute/path/to/agent-runtime
|
| 219 |
+
export V2C_RL_DEPENDENCIES=/absolute/path/to/rl-dependencies
|
| 220 |
+
export NEMO_RL_UID_GID_POOL_CONFIG=/absolute/path/to/identity-pool.yaml
|
| 221 |
+
cd "$CODE_REPO"
|
| 222 |
+
HARNESS_CONFIG=/absolute/path/to/your-harness.yaml
|
| 223 |
+
./v2c infer --input /absolute/path/to/target.png --task svg \
|
| 224 |
+
--config "$HARNESS_CONFIG" --thinking xhigh --context-tokens 262144 \
|
| 225 |
+
--endpoint http://127.0.0.1:8000/v1/chat/completions --model CodingDINO \
|
| 226 |
+
--output ./outputs/codingdino-svg
|
| 227 |
+
|
| 228 |
+
./v2c infer --input /absolute/path/to/motion.mp4 --task threejs \
|
| 229 |
+
--config "$HARNESS_CONFIG" --thinking xhigh --context-tokens 262144 \
|
| 230 |
+
--endpoint http://127.0.0.1:8000/v1/chat/completions --model CodingDINO \
|
| 231 |
+
--output ./outputs/codingdino-threejs
|
| 232 |
+
```
|
| 233 |
+
|
| 234 |
+
</details>
|
| 235 |
+
|
| 236 |
+
<a id="bench-en"></a>
|
| 237 |
+
|
| 238 |
+
## Evaluation
|
| 239 |
+
|
| 240 |
+
The six-benchmark logs record the step-65 checkpoint running interactively with Vision2Code Harness v1.1 at `xhigh` reasoning effort. It produced 1,550 submissions for 1,555 available inputs. The standalone examples above use the public v1 client. The published run used v1.1 rendering, context compaction and submission rules, with up to 12 renders per task.
|
| 241 |
+
|
| 242 |
+
The evaluation client allowed 20,480 output tokens per turn, including a 4,096-token thinking budget. Sampling used temperature 0.6 and top-p 0.95. Inspect an individual submission by matching its `sample_id` in the sample scores and event logs.
|
| 243 |
+
|
| 244 |
+
| Benchmark | Reconstruction task |
|
| 245 |
+
| --- | --- |
|
| 246 |
+
| [3DHarnessBench](https://huggingface.co/datasets/lingada/3DHarnessBench) | Single view → Blender scene |
|
| 247 |
+
| [CC-HARD](https://huggingface.co/datasets/xcodemind/CC-HARD) | Web screenshot → HTML |
|
| 248 |
+
| [VFIG-Bench](https://huggingface.co/datasets/QijiaHe/VFIG-Bench) | Scientific figure → SVG |
|
| 249 |
+
| [DrawAI-Bench Lite](https://huggingface.co/datasets/caopu/DrawAI-Bench-Lite) | Diagram → editable SVG |
|
| 250 |
+
| [AnimWeb-Bench](https://github.com/starry1001/AnimWeb) | Reference animation → animated web page |
|
| 251 |
+
| [Code2Video-Compass (V2V)](https://github.com/code2video-compass/Code2Video-Compass) | Video → animation code |
|
| 252 |
+
|
| 253 |
+
Per-sample scores and event logs: [Hugging Face](https://huggingface.co/Skywalker0410/CodingDINO-evallog) · [ModelScope](https://www.modelscope.ai/models/Skywalker0410/CodingDINO-evallog).
|
| 254 |
+
|
| 255 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/benchmark-results.png" width="100%" alt="Reconstruction performance across six benchmarks" /></p>
|
| 256 |
+
|
| 257 |
+
### Editable Scenes
|
| 258 |
+
|
| 259 |
+
The paper changes one line in each reconstructed scene to move the camera, widen a carton or keep one horse in a field. In the carton example, the robot continues along its original path as it carries the wider box.
|
| 260 |
+
|
| 261 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/editable-scenes.png" width="100%" alt="Original and edited Three.js renders at matching timestamps" /></p>
|
| 262 |
+
|
| 263 |
+
---
|
| 264 |
+
|
| 265 |
+
<!-- model-card-language: zh-CN -->
|
| 266 |
+
|
| 267 |
+
<a id="chinese"></a>
|
| 268 |
+
|
| 269 |
+
# <img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/logo.png" width="40" style="display: inline-block; vertical-align: middle; margin: 0;" alt="CodingDINO" /> CodingDINO:通过智能体强化学习,将所见表示为代码
|
| 270 |
+
|
| 271 |
+
[English](#english) | **简体中文**
|
| 272 |
+
|
| 273 |
+
<p align="center" style="margin: 0;"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/teaser.png" width="100%" alt="输入图像、视频与相应程序的渲染结果" style="display: block; margin: 0;" /></p>
|
| 274 |
+
|
| 275 |
+
## 🔗 快速链接
|
| 276 |
+
|
| 277 |
+
- 🤗 **Hugging Face** · [CodingDINO](https://huggingface.co/Skywalker0410/CodingDINO)
|
| 278 |
+
- <img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/modelscope-logo.svg" width="22" height="20" style="display: inline-block; vertical-align: middle; margin: 0;" alt="ModelScope" /> **ModelScope** · [CodingDINO](https://www.modelscope.ai/models/Skywalker0410/CodingDINO)
|
| 279 |
+
- 🌐 **项目主页** · [CodingDINO](https://skywalker-yqz.github.io/CodingDINO/)
|
| 280 |
+
- 💻 **GitHub 代码** · [Skywalker-yqz/CodingDINO](https://github.com/Skywalker-yqz/CodingDINO)
|
| 281 |
+
- 📄 **论文** · [CodingDINO](https://skywalker-yqz.github.io/CodingDINO/)
|
| 282 |
+
- 📊 **评测日志** · [Hugging Face](https://huggingface.co/Skywalker0410/CodingDINO-evallog) · [ModelScope](https://www.modelscope.ai/models/Skywalker0410/CodingDINO-evallog)
|
| 283 |
+
- 🛠️ **使用指南** · [快速开始](#start-zh) · [评测 worker](#worker-zh) · [评测基准](#bench-zh)
|
| 284 |
+
|
| 285 |
+
# 模型概述
|
| 286 |
+
|
| 287 |
+
### 模型介绍
|
| 288 |
+
|
| 289 |
+
CodingDINO 是一个 27B 视觉语言模型,能把图像或视频重建为可执行程序。输入一张示意图,它可以画出可编辑的 SVG;输入一段视频,它可以用同一份程序描述各帧中的物体及其运动。论文中有一个例子:只改生成的 Three.js 程序里的一行代码,就能升高高速公路上方的摄像机,同时保留车辆原有的运动轨迹。
|
| 290 |
+
|
| 291 |
+
同一份权重支持两种推理方式。**CodingDINO-Single** 直接根据输入写出初稿。**CodingDINO** 可以运行初稿、查看渲染结果,再修改程序。在六个基准上,交互式推理在 12 项主要指标中有 **10 项排名第一**。按指标分别计算再取平均,单轮初稿保留了多轮成绩的 **85.4%**。
|
| 292 |
+
|
| 293 |
+
### 演示视频
|
| 294 |
+
|
| 295 |
+
<video controls playsinline preload="none" width="100%" poster="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/demo-poster.jpg" src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/demo.mp4"></video>
|
| 296 |
+
|
| 297 |
+
### 许可证与使用条款
|
| 298 |
+
|
| 299 |
+
CodingDINO 以 [Apache 2.0](LICENSE) 发布。仓库随附[底座模型的原始许可证](LICENSE.base-model)和[版权归属说明](NOTICE.md)。第三方材料保留各自的权利和许可条款。
|
| 300 |
+
|
| 301 |
+
<details>
|
| 302 |
+
<summary>引用</summary>
|
| 303 |
+
|
| 304 |
+
```bibtex
|
| 305 |
+
@misc{yu2026codingdino,
|
| 306 |
+
title={{CodingDINO}: Learning to Represent What We See as Code with Agentic Reinforcement Learning},
|
| 307 |
+
author={Yu, Qize and Zhang, Hanzhen and Chen, Yue and Lu, Jiarui and Chen, Tianxing and Huang, Siqiao and Song, Wenxuan and He, Minghua and Wang, Yuran and Niu, Junbo and Jia, Zhengyu and Shang, Zhihui and Ping, Bowen and Liu, Xianming and Li, Haoang and Luo, Ping and Zhou, Shuchang and Wang, Zijian},
|
| 308 |
+
year={2026},
|
| 309 |
+
url={https://skywalker-yqz.github.io/CodingDINO/}
|
| 310 |
+
}
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
</details>
|
| 314 |
+
|
| 315 |
+
## 模型架构
|
| 316 |
+
|
| 317 |
+
本仓库提供以 Qwen3.8-27B 为底座、经过 65 步智能体强化学习的权重,使用 Transformers 的 `Qwen3_5ForConditionalGeneration` 类加载。模型先在经过验证的程序上做监督微调,再在视觉编程环境中通过 GRPO 学习。提交的程序经过渲染后,系统比较渲染视图与目标的 DINO 特征,Three.js 和 Blender 任务还会比较相对深度。对视频,奖励取各对应时间点得分的均值。
|
| 318 |
+
|
| 319 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/framework.png" width="100%" alt="视觉编程环境与智能体强化学习" /></p>
|
| 320 |
+
|
| 321 |
+
## 输入与输出
|
| 322 |
+
|
| 323 |
+
| 输入 | 输出 |
|
| 324 |
+
| --- | --- |
|
| 325 |
+
| 图像和指定输出格式的指令 | 可编辑源码,例如 SVG 图表、HTML 网页、Three.js 场景或 Blender 脚本。单次请求返回的候选源码可从助手回复中读取。 |
|
| 326 |
+
| 传给交互环境的图像或视频 | 成功提交后,可在 `submitted/` 下找到已验证的入口文件及配套源码。运行结果写入 `result.json`,交互记录在 `episode/`。 |
|
| 327 |
+
|
| 328 |
+
<a id="start-zh"></a>
|
| 329 |
+
|
| 330 |
+
## 推理部署
|
| 331 |
+
|
| 332 |
+
### 环境
|
| 333 |
+
|
| 334 |
+
| 组件 | 参考环境 |
|
| 335 |
+
| --- | --- |
|
| 336 |
+
| 模型服务 | Linux、Python 3.13、vLLM 0.29.0、Transformers 5.12.1 |
|
| 337 |
+
| 评测副本 | 4 × NVIDIA H800,张量并行度 4,BF16。PyTorch 2.13.0+cu130、Triton 3.7.1 |
|
| 338 |
+
| 评测 worker | Hopper(SM 9.x)、Flash Linear Attention 与 fla-core 0.5.2、带 CUDA 13 扩展的 Transformer Engine 2.18.0,以及版本匹配的训练环境 |
|
| 339 |
+
| 渲染客户端 | Python 3.12+、OpenHands、NeMo Gym,以及目标格式对应的渲染器。视频还需 FFmpeg 和 ffprobe |
|
| 340 |
+
|
| 341 |
+
### 启动模型服务
|
| 342 |
+
|
| 343 |
+
下载完整模型,让分片权重、分词器和 `native-gdn/` 保持��同一目录。以下命令适用于驱动兼容 CUDA 13 的 Linux GPU 主机,会启动一个上下文窗口为 32,768 token 的本地 OpenAI 兼容服务。
|
| 344 |
+
|
| 345 |
+
```bash
|
| 346 |
+
python3.13 -m venv .venv-codingdino
|
| 347 |
+
source .venv-codingdino/bin/activate
|
| 348 |
+
python -m pip install 'vllm==0.29.0' huggingface_hub
|
| 349 |
+
hf download Skywalker0410/CodingDINO --local-dir ./CodingDINO-model
|
| 350 |
+
export MODEL_DIR="$(realpath ./CodingDINO-model)"
|
| 351 |
+
vllm serve "$MODEL_DIR" --served-model-name CodingDINO \
|
| 352 |
+
--host 127.0.0.1 --port 8000 --tensor-parallel-size 4 --dtype bfloat16 \
|
| 353 |
+
--max-model-len 32768 --enable-prefix-caching --reasoning-parser qwen3 \
|
| 354 |
+
--enable-auto-tool-choice --tool-call-parser qwen3_coder
|
| 355 |
+
```
|
| 356 |
+
|
| 357 |
+
在另一个终端确认模型列表里出现 `CodingDINO`。将一张名为 `target.png` 的图像放在当前目录,运行下方 Python 示例即可打印模型返回的 SVG。
|
| 358 |
+
|
| 359 |
+
```bash
|
| 360 |
+
curl -fsS http://127.0.0.1:8000/v1/models
|
| 361 |
+
```
|
| 362 |
+
|
| 363 |
+
<details>
|
| 364 |
+
<summary>PNG → SVG · Python 示例</summary>
|
| 365 |
+
|
| 366 |
+
```python
|
| 367 |
+
import base64
|
| 368 |
+
import json
|
| 369 |
+
from pathlib import Path
|
| 370 |
+
from urllib.request import Request, urlopen
|
| 371 |
+
|
| 372 |
+
image = base64.b64encode(Path("target.png").read_bytes()).decode("ascii")
|
| 373 |
+
body = {
|
| 374 |
+
"model": "CodingDINO",
|
| 375 |
+
"messages": [{
|
| 376 |
+
"role": "user",
|
| 377 |
+
"content": [
|
| 378 |
+
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
|
| 379 |
+
{"type": "text", "text": "Reconstruct this image as editable SVG. Return the SVG source."},
|
| 380 |
+
],
|
| 381 |
+
}],
|
| 382 |
+
"chat_template_kwargs": {
|
| 383 |
+
"enable_thinking": True, "preserve_thinking": True, "reasoning_effort": "xhigh",
|
| 384 |
+
},
|
| 385 |
+
"thinking_token_budget": 4096,
|
| 386 |
+
"max_tokens": 20480,
|
| 387 |
+
"temperature": 0.6,
|
| 388 |
+
"top_p": 0.95,
|
| 389 |
+
}
|
| 390 |
+
request = Request("http://127.0.0.1:8000/v1/chat/completions",
|
| 391 |
+
data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
|
| 392 |
+
with urlopen(request, timeout=600) as response:
|
| 393 |
+
print(json.load(response)["choices"][0]["message"]["content"])
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
</details>
|
| 397 |
+
|
| 398 |
+
## 推理基础设施
|
| 399 |
+
|
| 400 |
+
<a id="worker-zh"></a>
|
| 401 |
+
|
| 402 |
+
### 启动评测 worker
|
| 403 |
+
|
| 404 |
+
索引将模型参数映射到 18 个权重分片和 1 个冻结的 MTP 文件。`native-gdn/` 单独提供评测 worker 所需的原生归一化权重。启动时,模型路径应指向含 `config.json` 的目录。
|
| 405 |
+
|
| 406 |
+
论文评测每个服务副本使用四张 H800、262,144 token 上下文和专用的 vLLM worker。worker 从 `native-gdn/` 恢复 48 个 BF16 Gated DeltaNet 归一化张量,并逐个核对指纹。冻结的 MTP 权重用于每步提出三个推测 token。要使用相同配置,先停止上面的标准服务,激活匹配的 vLLM 环境,再填写下方三个本地路径。
|
| 407 |
+
|
| 408 |
+
将 `MODEL_DIR` 设为下载的权重目录,`CODE_REPO` 设为提供 `Mix60BenchWorker` 的代码仓库,`LEARNER_PYTHON` 设为含匹配版本 FLA 和 Transformer Engine 的 Python 解释器。启动命令将 `V2C_MIX60_EXPORT_ROOT` 指向原生张量目录,并显式指定检查点步数 `65`。
|
| 409 |
+
|
| 410 |
+
<details>
|
| 411 |
+
<summary>启动一个评测副本 · Bash</summary>
|
| 412 |
+
|
| 413 |
+
```bash
|
| 414 |
+
export MODEL_DIR=/absolute/path/to/Model
|
| 415 |
+
export CODE_REPO=/absolute/path/to/CodingDINO
|
| 416 |
+
LEARNER_PYTHON=/absolute/path/to/learner-env/bin/python
|
| 417 |
+
|
| 418 |
+
export SVG_INFERENCE_PACKAGES="$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
| 419 |
+
export SVG_LEARNER_PACKAGES="$("$LEARNER_PYTHON" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
| 420 |
+
export CUDNN_HOME="$SVG_LEARNER_PACKAGES/nvidia/cudnn"
|
| 421 |
+
export CUDNN_PATH="$CUDNN_HOME"
|
| 422 |
+
export LD_LIBRARY_PATH="$CUDNN_HOME/lib:$SVG_LEARNER_PACKAGES/z3/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
| 423 |
+
export PYTHONPATH="$CODE_REPO/research/vision2code_bench:$CODE_REPO/research/vision2code_agentic_rl/src:$CODE_REPO${PYTHONPATH:+:$PYTHONPATH}"
|
| 424 |
+
|
| 425 |
+
export V2C_MIX60_EXPORT_ROOT="$MODEL_DIR/native-gdn"
|
| 426 |
+
export V2C_EXPECTED_CHECKPOINT_STEP=65
|
| 427 |
+
export V2C_EVALUATION_ROOT="$(mktemp -d)"
|
| 428 |
+
export V2C_REPLICA_NAME=local
|
| 429 |
+
export CUDA_VISIBLE_DEVICES=0,1,2,3
|
| 430 |
+
export VLLM_USE_V2_MODEL_RUNNER=0 VLLM_GDN_DECODE_KERNEL=triton
|
| 431 |
+
export VLLM_ALLREDUCE_USE_SYMM_MEM=0 VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
|
| 432 |
+
export SVG_VLLM_PRESERVE_MM_PREFIX_PAYLOAD=1 SVG_VLLM_MM_PREFIX_REPLAY_WORKAROUND=1
|
| 433 |
+
|
| 434 |
+
python -m vllm.entrypoints.openai.api_server \
|
| 435 |
+
--model "$MODEL_DIR" --served-model-name CodingDINO --host 127.0.0.1 --port 8000 \
|
| 436 |
+
--tensor-parallel-size 4 --dtype bfloat16 --kv-cache-dtype auto \
|
| 437 |
+
--max-model-len 262144 --gpu-memory-utilization 0.88 \
|
| 438 |
+
--max-num-seqs 16 --max-num-batched-tokens 8192 \
|
| 439 |
+
--worker-cls harness_v1_eval.mix60_worker.Mix60BenchWorker \
|
| 440 |
+
--mamba-cache-mode align --mamba-ssm-cache-dtype float32 --block-size 1600 \
|
| 441 |
+
--gdn-prefill-backend triton --enable-prefix-caching --async-scheduling \
|
| 442 |
+
--attention-config '{"flash_attn_version":4,"flash_attn_max_num_splits_for_cuda_graph":16}' \
|
| 443 |
+
--compilation-config '{"pass_config":{"fuse_allreduce_rms":false}}' \
|
| 444 |
+
--hf-overrides '{"head_dtype":"bfloat16"}' --logprobs-mode raw_logprobs \
|
| 445 |
+
--mm-processor-cache-gb 0 --skip-mm-profiling --limit-mm-per-prompt '{"image":512}' \
|
| 446 |
+
--enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3 \
|
| 447 |
+
--default-chat-template-kwargs '{"enable_thinking":false,"preserve_thinking":true,"reasoning_effort":"medium"}' \
|
| 448 |
+
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"rejection_sample_method":"standard"}' \
|
| 449 |
+
--trust-remote-code --seed 20261116
|
| 450 |
+
```
|
| 451 |
+
|
| 452 |
+
</details>
|
| 453 |
+
|
| 454 |
+
每个 GPU worker 会在 `V2C_EVALUATION_ROOT` 下写入加载记录。[原生张量校验](native-gdn/README.md) · [分布式评测](https://github.com/Skywalker-yqz/CodingDINO/tree/HEAD/research/vision2code_bench/harness_v1_eval)
|
| 455 |
+
|
| 456 |
+
### 运行交互式渲染
|
| 457 |
+
|
| 458 |
+
保持 262,144 token 服务运行,在另一终端进入客户端环境,将 `CODE_REPO` 指向代码仓库。复制 `vision2code_harness_v1.yaml`,将 `context_tokenizer` 指向权重目录,再配置 `shell_base` 和对应输出格式的渲染器路径。下面两个例子分别把 PNG 重建为 SVG,把视频重建为 Three.js 场景。[交互环境配置](https://github.com/Skywalker-yqz/CodingDINO/tree/HEAD/research/vision2code_agentic_rl/configs/harness)
|
| 459 |
+
|
| 460 |
+
<details>
|
| 461 |
+
<summary>运行图像和视频示例 · Bash</summary>
|
| 462 |
+
|
| 463 |
+
```bash
|
| 464 |
+
export CODE_REPO=/absolute/path/to/CodingDINO
|
| 465 |
+
export V2C_AGENT_PYTHON=/absolute/path/to/agent-env/bin/python
|
| 466 |
+
export V2C_AGENT_RUNTIME=/absolute/path/to/agent-runtime
|
| 467 |
+
export V2C_RL_DEPENDENCIES=/absolute/path/to/rl-dependencies
|
| 468 |
+
export NEMO_RL_UID_GID_POOL_CONFIG=/absolute/path/to/identity-pool.yaml
|
| 469 |
+
cd "$CODE_REPO"
|
| 470 |
+
HARNESS_CONFIG=/absolute/path/to/your-harness.yaml
|
| 471 |
+
./v2c infer --input /absolute/path/to/target.png --task svg \
|
| 472 |
+
--config "$HARNESS_CONFIG" --thinking xhigh --context-tokens 262144 \
|
| 473 |
+
--endpoint http://127.0.0.1:8000/v1/chat/completions --model CodingDINO \
|
| 474 |
+
--output ./outputs/codingdino-svg
|
| 475 |
+
|
| 476 |
+
./v2c infer --input /absolute/path/to/motion.mp4 --task threejs \
|
| 477 |
+
--config "$HARNESS_CONFIG" --thinking xhigh --context-tokens 262144 \
|
| 478 |
+
--endpoint http://127.0.0.1:8000/v1/chat/completions --model CodingDINO \
|
| 479 |
+
--output ./outputs/codingdino-threejs
|
| 480 |
+
```
|
| 481 |
+
|
| 482 |
+
</details>
|
| 483 |
+
|
| 484 |
+
<a id="bench-zh"></a>
|
| 485 |
+
|
| 486 |
+
## 评测
|
| 487 |
+
|
| 488 |
+
六项基准的日志记录了第 65 步权重在 Vision2Code Harness v1.1 下的交互式评测,推理强度为 `xhigh`。1,555 个有输入的任务中,模型提交了 1,550 份结果。上方独立推理示例使用公开的 v1 客户端;论文评测采用 v1.1 的渲染、上下文压缩与提交规则,每个任务最多渲染 12 次。
|
| 489 |
+
|
| 490 |
+
评测客户端每轮最多输出 20,480 token,其中思考预算为 4,096 token。采样温度为 0.6,top-p 为 0.95。要查看某次提交,可用同一个 `sample_id` 对照样本分数和交互记录。
|
| 491 |
+
|
| 492 |
+
| 基准 | 重建任务 |
|
| 493 |
+
| --- | --- |
|
| 494 |
+
| [3DHarnessBench](https://huggingface.co/datasets/lingada/3DHarnessBench) | 单视图 → Blender 场景 |
|
| 495 |
+
| [CC-HARD](https://huggingface.co/datasets/xcodemind/CC-HARD) | 网页截图 → HTML |
|
| 496 |
+
| [VFIG-Bench](https://huggingface.co/datasets/QijiaHe/VFIG-Bench) | 科研图表 → SVG |
|
| 497 |
+
| [DrawAI-Bench Lite](https://huggingface.co/datasets/caopu/DrawAI-Bench-Lite) | 示意图 → 可编辑 SVG |
|
| 498 |
+
| [AnimWeb-Bench](https://github.com/starry1001/AnimWeb) | 参考动画 → 网页动画 |
|
| 499 |
+
| [Code2Video-Compass (V2V)](https://github.com/code2video-compass/Code2Video-Compass) | 视频 → 动画代码 |
|
| 500 |
+
|
| 501 |
+
逐样本分数与运行日志:[Hugging Face](https://huggingface.co/Skywalker0410/CodingDINO-evallog) · [ModelScope](https://www.modelscope.ai/models/Skywalker0410/CodingDINO-evallog)。
|
| 502 |
+
|
| 503 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/benchmark-results.png" width="100%" alt="六个基准上的重建表现" /></p>
|
| 504 |
+
|
| 505 |
+
### 可编辑场景
|
| 506 |
+
|
| 507 |
+
论文在三个重建场景中各修改一行代码,分别改变相机高度、加宽纸箱,或只保留马群中的一匹马。例如,纸箱变宽后,机器人仍沿原路径搬运它。
|
| 508 |
+
|
| 509 |
+
<p align="center"><img src="https://huggingface.co/Skywalker0410/CodingDINO/resolve/main/assets/editable-scenes.png" width="100%" alt="同一时间点的 Three.js 原始渲染与编辑结果" /></p>
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
bbedc3fda3305820b977265f01b8619d87570a6739de3a5582c3464840f1e57a LICENSE.base-model
|
| 2 |
+
15e1e30a890814b95ae55d161336ce1c2e9899fd6ac009f1e46e4f98fdaec59e README.md
|
| 3 |
+
c3cf9e34abf4f9e36c2d72165aa9c132d3e2a725b6c2586aaa3a8af9d7a81041 chat_template.jinja
|
| 4 |
+
191e0af232104ed8b65258cf3fb2b842e288008baca7633c11b82a1ac7203aab config.json
|
| 5 |
+
83b4128c88020c23babd90e84e6490f0e45fbd18b8645bb09946ffe606f2a257 generation_config.json
|
| 6 |
+
a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
|
| 7 |
+
89a84a69a625502c80ba3656e95cd59dd2ea14ec17757503a388bade6ee8be2f model-00001-of-00018.safetensors
|
| 8 |
+
bcefa93e1c6584068a43e8e845045a84f2a35c65e93ab9a5311998cdbc9b432e model-00002-of-00018.safetensors
|
| 9 |
+
e97f7370a38345087b2d164842af0bd932c98aeee9377ff2d5f3b6d2f5de7ce4 model-00003-of-00018.safetensors
|
| 10 |
+
242455b2301caa23b1719411859fb1554bb67fafa4a4bfbc3bb8297166f07b1a model-00004-of-00018.safetensors
|
| 11 |
+
b5fc8a59272c5d556d0935debf14c68faf4e7c9774282f1b88c9e46c1651e376 model-00005-of-00018.safetensors
|
| 12 |
+
9593e8d8b26b3c44ec91f489987985cf81f4bc66bf887925161baf240482c4da model-00006-of-00018.safetensors
|
| 13 |
+
cec6bc50285aa94ec3dceb170034aa0013e83755b1b4a57773e0eee6798571ad model-00007-of-00018.safetensors
|
| 14 |
+
5b3cfa91687d935e08b3af3fbfa0523705383052a3679468394064e7b7422708 model-00008-of-00018.safetensors
|
| 15 |
+
3b38d26077bd5cfbc0a6145ed442a30f89d04e009ccfd6930f4e81d27d4dccc7 model-00009-of-00018.safetensors
|
| 16 |
+
5f1e0d6d6d5d3aa4c81ecae6f68af9e273dd4df96cc270d4e842cb85357e1cd5 model-00010-of-00018.safetensors
|
| 17 |
+
1e726b798f5c20d6da6ce3168811f81fd853a80b084b519f81b6efb1c70f8cbb model-00011-of-00018.safetensors
|
| 18 |
+
071c9fd109b25e8d2cb26ab87f6925408f3ccd0bdea106ccd5eff6e2c5863251 model-00012-of-00018.safetensors
|
| 19 |
+
83668bc5659cb5e27935eb4eab4c6f8989d929ed1a431fac66d52509c0d57f1c model-00013-of-00018.safetensors
|
| 20 |
+
f89feda3b7b64fa32a1578d9e0816b9d6f3341dba3a79dce7d07bf85dab211e8 model-00014-of-00018.safetensors
|
| 21 |
+
fd72e7c24cd25b19c0054e15d3cb0969a15bcfcc21e4f0e55c96310343cca5c2 model-00015-of-00018.safetensors
|
| 22 |
+
10a7adb9eb00f5539ef16df1e7625bf64fa56a52dba70479e50a13da1d82fd96 model-00016-of-00018.safetensors
|
| 23 |
+
17a33b980f2145ba6f0686bd3698a514704937c6882babfa6740d76b84eeb22f model-00017-of-00018.safetensors
|
| 24 |
+
959c408808104913d1a3a2263b924f37a79a955addf2f2faf19dd3df702056cf model-00018-of-00018.safetensors
|
| 25 |
+
90fa0e3eed5a647c035c6df9ecabc416c0f8d573ff84ac12485b085f00a7cdf2 model-frozen-mtp.safetensors
|
| 26 |
+
eb4eccff1aabd0f2fade6ac88c39f6d7b45c321b2940fdf303fd66738f9b19e2 model.safetensors.index.json
|
| 27 |
+
531bfaeca4aabe0979a533d8e02c10a4b527168f7d4f0fb3fa48db6998f3b945 native-gdn/README.md
|
| 28 |
+
9d2bc261ba1fb61b493e27f6fdbfa67afcde4b9501382c1250bde674ee4c4d77 native-gdn/export_completed.json
|
| 29 |
+
d36636f199b4e85c05eaa6b7aa3f85ad93d4229f5522afad548f66c3ca458fcd native-gdn/gdn_worker_checks/README.md
|
| 30 |
+
e7d35230cafb20242a0eb55dcb96270f25b1c934fa62d102023ca1bd78487455 native-gdn/gdn_worker_checks/rank_000.json
|
| 31 |
+
8c9b8a455d091ac7ba5d3b10f03154c4673152025de321c4cf0f6c73dde85331 native-gdn/native_gdn_norm_delta.safetensors
|
| 32 |
+
3a159dfec9978a186a72ba085e0ad6a050f3968d8b364218d7bd13f5c89381f2 preprocessor_config.json
|
| 33 |
+
d89ef49ce9cd37fbf510158e13c1ef063d9286411c1ec9049932dbe0487143b1 processor_config.json
|
| 34 |
+
0997f410c57a1f4e53b09e4be8f4a172d90edd9564368fb0847030937229b9f3 tokenizer.json
|
| 35 |
+
b11349aafa7cdc6a320767cf7ceb29ed82f7eda5d65e8e0819e76f0ce947bf27 tokenizer_config.json
|
| 36 |
+
ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json
|
assets/modelscope-logo.svg
ADDED
|
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- set reasoning_instructions = '' %}
|
| 46 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 47 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 48 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
|
| 49 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- if resolved_reasoning_effort == 'xhigh' %}
|
| 52 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 53 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 54 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 58 |
+
{{- '<|im_start|>system\n' }}
|
| 59 |
+
{%- if reasoning_instructions %}
|
| 60 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 63 |
+
{%- for tool in tools %}
|
| 64 |
+
{{- "\n" }}
|
| 65 |
+
{{- tool | tojson }}
|
| 66 |
+
{%- endfor %}
|
| 67 |
+
{{- "\n</tools>" }}
|
| 68 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 69 |
+
{%- if messages[0].role == 'system' %}
|
| 70 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 71 |
+
{%- if content %}
|
| 72 |
+
{{- '\n\n' + content }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{{- '<|im_end|>\n' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{%- if messages[0].role == 'system' %}
|
| 78 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 79 |
+
{%- if content %}
|
| 80 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 81 |
+
{%- elif reasoning_instructions %}
|
| 82 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{%- elif reasoning_instructions %}
|
| 85 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- endif %}
|
| 88 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 89 |
+
{%- for message in messages[::-1] %}
|
| 90 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 91 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 92 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 93 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 94 |
+
{%- set ns.multi_step_tool = false %}
|
| 95 |
+
{%- set ns.last_query_index = index %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endfor %}
|
| 99 |
+
{%- if ns.multi_step_tool %}
|
| 100 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 101 |
+
{%- endif %}
|
| 102 |
+
{%- for message in messages %}
|
| 103 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 104 |
+
{%- if message.role == "system" %}
|
| 105 |
+
{%- if not loop.first %}
|
| 106 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- elif message.role == "user" %}
|
| 109 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 110 |
+
{%- elif message.role == "assistant" %}
|
| 111 |
+
{%- set reasoning_content = '' %}
|
| 112 |
+
{%- if message.reasoning_content is string %}
|
| 113 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 116 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 117 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 122 |
+
{%- for tool_call in message.tool_calls %}
|
| 123 |
+
{%- if tool_call.function is defined %}
|
| 124 |
+
{%- set tool_call = tool_call.function %}
|
| 125 |
+
{%- endif %}
|
| 126 |
+
{%- if loop.first %}
|
| 127 |
+
{%- if content|trim %}
|
| 128 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 129 |
+
{%- else %}
|
| 130 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 131 |
+
{%- endif %}
|
| 132 |
+
{%- else %}
|
| 133 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 136 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 137 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 138 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 139 |
+
{{- args_value }}
|
| 140 |
+
{{- '\n</parameter>\n' }}
|
| 141 |
+
{%- endfor %}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{{- '</function>\n</tool_call>' }}
|
| 144 |
+
{%- endfor %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{{- '<|im_end|>\n' }}
|
| 147 |
+
{%- elif message.role == "tool" %}
|
| 148 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 149 |
+
{{- '<|im_start|>user' }}
|
| 150 |
+
{%- endif %}
|
| 151 |
+
{{- '\n<tool_response>\n' }}
|
| 152 |
+
{{- content }}
|
| 153 |
+
{{- '\n</tool_response>' }}
|
| 154 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 155 |
+
{{- '<|im_end|>\n' }}
|
| 156 |
+
{%- elif loop.last %}
|
| 157 |
+
{{- '<|im_end|>\n' }}
|
| 158 |
+
{%- endif %}
|
| 159 |
+
{%- else %}
|
| 160 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 161 |
+
{%- endif %}
|
| 162 |
+
{%- endfor %}
|
| 163 |
+
{%- if add_generation_prompt %}
|
| 164 |
+
{{- '<|im_start|>assistant\n' }}
|
| 165 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 166 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 167 |
+
{%- else %}
|
| 168 |
+
{{- '<think>\n' }}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_id": 248056,
|
| 6 |
+
"language_model_only": false,
|
| 7 |
+
"model_type": "qwen3_5",
|
| 8 |
+
"text_config": {
|
| 9 |
+
"attention_bias": false,
|
| 10 |
+
"attention_dropout": 0.0,
|
| 11 |
+
"attn_output_gate": true,
|
| 12 |
+
"bos_token_id": 248044,
|
| 13 |
+
"dtype": "bfloat16",
|
| 14 |
+
"eos_token_id": 248044,
|
| 15 |
+
"full_attention_interval": 4,
|
| 16 |
+
"head_dim": 256,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 5120,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 17408,
|
| 21 |
+
"layer_types": [
|
| 22 |
+
"linear_attention",
|
| 23 |
+
"linear_attention",
|
| 24 |
+
"linear_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"linear_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"linear_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"linear_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"linear_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"linear_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"linear_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"linear_attention",
|
| 51 |
+
"linear_attention",
|
| 52 |
+
"linear_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"linear_attention",
|
| 55 |
+
"linear_attention",
|
| 56 |
+
"linear_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"linear_attention",
|
| 59 |
+
"linear_attention",
|
| 60 |
+
"linear_attention",
|
| 61 |
+
"full_attention",
|
| 62 |
+
"linear_attention",
|
| 63 |
+
"linear_attention",
|
| 64 |
+
"linear_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"linear_attention",
|
| 67 |
+
"linear_attention",
|
| 68 |
+
"linear_attention",
|
| 69 |
+
"full_attention",
|
| 70 |
+
"linear_attention",
|
| 71 |
+
"linear_attention",
|
| 72 |
+
"linear_attention",
|
| 73 |
+
"full_attention",
|
| 74 |
+
"linear_attention",
|
| 75 |
+
"linear_attention",
|
| 76 |
+
"linear_attention",
|
| 77 |
+
"full_attention",
|
| 78 |
+
"linear_attention",
|
| 79 |
+
"linear_attention",
|
| 80 |
+
"linear_attention",
|
| 81 |
+
"full_attention",
|
| 82 |
+
"linear_attention",
|
| 83 |
+
"linear_attention",
|
| 84 |
+
"linear_attention",
|
| 85 |
+
"full_attention"
|
| 86 |
+
],
|
| 87 |
+
"linear_conv_kernel_dim": 4,
|
| 88 |
+
"linear_key_head_dim": 128,
|
| 89 |
+
"linear_num_key_heads": 16,
|
| 90 |
+
"linear_num_value_heads": 48,
|
| 91 |
+
"linear_value_head_dim": 128,
|
| 92 |
+
"mamba_ssm_dtype": "float32",
|
| 93 |
+
"max_position_embeddings": 262144,
|
| 94 |
+
"model_type": "qwen3_5_text",
|
| 95 |
+
"mtp_num_hidden_layers": 1,
|
| 96 |
+
"mtp_use_dedicated_embeddings": false,
|
| 97 |
+
"num_attention_heads": 24,
|
| 98 |
+
"num_hidden_layers": 64,
|
| 99 |
+
"num_key_value_heads": 4,
|
| 100 |
+
"output_gate_type": "swish",
|
| 101 |
+
"pad_token_id": null,
|
| 102 |
+
"partial_rotary_factor": 0.25,
|
| 103 |
+
"rms_norm_eps": 1e-06,
|
| 104 |
+
"rope_parameters": {
|
| 105 |
+
"mrope_interleaved": true,
|
| 106 |
+
"mrope_section": [
|
| 107 |
+
11,
|
| 108 |
+
11,
|
| 109 |
+
10
|
| 110 |
+
],
|
| 111 |
+
"partial_rotary_factor": 0.25,
|
| 112 |
+
"rope_theta": 10000000,
|
| 113 |
+
"rope_type": "default"
|
| 114 |
+
},
|
| 115 |
+
"tie_word_embeddings": false,
|
| 116 |
+
"use_cache": true,
|
| 117 |
+
"vocab_size": 248320
|
| 118 |
+
},
|
| 119 |
+
"tie_word_embeddings": false,
|
| 120 |
+
"transformers_version": "5.8.0.dev0",
|
| 121 |
+
"video_token_id": 248057,
|
| 122 |
+
"vision_config": {
|
| 123 |
+
"deepstack_visual_indexes": [],
|
| 124 |
+
"depth": 27,
|
| 125 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 126 |
+
"hidden_size": 1152,
|
| 127 |
+
"in_channels": 3,
|
| 128 |
+
"initializer_range": 0.02,
|
| 129 |
+
"intermediate_size": 4304,
|
| 130 |
+
"model_type": "qwen3_5",
|
| 131 |
+
"num_heads": 16,
|
| 132 |
+
"num_position_embeddings": 2304,
|
| 133 |
+
"out_hidden_size": 5120,
|
| 134 |
+
"patch_size": 16,
|
| 135 |
+
"spatial_merge_size": 2,
|
| 136 |
+
"temporal_patch_size": 2
|
| 137 |
+
},
|
| 138 |
+
"vision_end_token_id": 248054,
|
| 139 |
+
"vision_start_token_id": 248053
|
| 140 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 248044,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
248046,
|
| 6 |
+
248044
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 248044,
|
| 9 |
+
"temperature": 1.0,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "5.12.1",
|
| 13 |
+
"trust_remote_code": true
|
| 14 |
+
}
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
native-gdn/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Native Gated DeltaNet tensors
|
| 2 |
+
|
| 3 |
+
This directory restores the step-65 Gated DeltaNet (GDN) RMSNorm parameters used during evaluation. The checkpoint shards store the Hugging Face parameterization. The aligned worker consumes the original zero-centered BF16 values and checks every loaded tensor against its training-export fingerprint.
|
| 4 |
+
|
| 5 |
+
| File | Purpose |
|
| 6 |
+
| --- | --- |
|
| 7 |
+
| `native_gdn_norm_delta.safetensors` | Forty-eight BF16 tensors, one for each GDN layer. The worker copies each one directly into its native normalization parameter. |
|
| 8 |
+
| `export_completed.json` | Identifies checkpoint step 65 and records zero optimizer updates during export. |
|
| 9 |
+
| `gdn_worker_checks/rank_000.json` | Records the expected shape, dtype, and SHA-256 digest for each tensor. |
|
| 10 |
+
|
| 11 |
+
Set `V2C_MIX60_EXPORT_ROOT` to this directory and `V2C_EXPECTED_CHECKPOINT_STEP` to `65` when launching `harness_v1_eval.mix60_worker.Mix60BenchWorker`. Use the file through this worker to preserve the normalization convention. [Launch instructions](../README.md)
|
| 12 |
+
|
| 13 |
+
After startup, inspect the JSON receipts under `$V2C_EVALUATION_ROOT/inference_weight_checks/$V2C_REPLICA_NAME/` on the server. Each tensor-parallel worker should report `checkpoint_step: 65`, `exact_native_gdn_delta: true`, and `matched_layers: 48`. Keep this writable runtime directory outside the model snapshot. [Fingerprint format](gdn_worker_checks/README.md)
|
native-gdn/export_completed.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"checkpoint_step": 65,
|
| 3 |
+
"optimizer_updates": 0
|
| 4 |
+
}
|
native-gdn/gdn_worker_checks/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GDN tensor fingerprints
|
| 2 |
+
|
| 3 |
+
`rank_000.json` contains the reference fingerprints recorded on export rank zero for the 48 replicated Gated DeltaNet normalization weights. Each key under `fingerprints` is a fully qualified tensor name. Its record contains a shape of `[128]`, the dtype `torch.bfloat16`, and the SHA-256 digest of the contiguous tensor bytes.
|
| 4 |
+
|
| 5 |
+
During startup each tensor-parallel worker loads the native values, copies them into the module, and verifies the bytes read back from that module. Retain this filename and directory when moving the checkpoint. [Native weight verification](../README.md)
|
native-gdn/gdn_worker_checks/rank_000.json
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fingerprints": {
|
| 3 |
+
"model.language_model.layers.0.linear_attn.norm.weight": {
|
| 4 |
+
"shape": [
|
| 5 |
+
128
|
| 6 |
+
],
|
| 7 |
+
"dtype": "torch.bfloat16",
|
| 8 |
+
"sha256": "1de4ca3b137db8d8df289d84f83bf4a6666da8bc4ebd269b00a0011b3d058b00"
|
| 9 |
+
},
|
| 10 |
+
"model.language_model.layers.1.linear_attn.norm.weight": {
|
| 11 |
+
"shape": [
|
| 12 |
+
128
|
| 13 |
+
],
|
| 14 |
+
"dtype": "torch.bfloat16",
|
| 15 |
+
"sha256": "b11e71e457df2da4ee226f718d5f1cfef237097f2bb0070e998a7d52ff5019bb"
|
| 16 |
+
},
|
| 17 |
+
"model.language_model.layers.2.linear_attn.norm.weight": {
|
| 18 |
+
"shape": [
|
| 19 |
+
128
|
| 20 |
+
],
|
| 21 |
+
"dtype": "torch.bfloat16",
|
| 22 |
+
"sha256": "78cd7ff91de0458f005d11ec455e065e01d9e33278fca5f788718b7c6dc78dd4"
|
| 23 |
+
},
|
| 24 |
+
"model.language_model.layers.4.linear_attn.norm.weight": {
|
| 25 |
+
"shape": [
|
| 26 |
+
128
|
| 27 |
+
],
|
| 28 |
+
"dtype": "torch.bfloat16",
|
| 29 |
+
"sha256": "06f5e645430e90df99866955a12c99c62733cd1150457a7a0493c1e49a84ceb5"
|
| 30 |
+
},
|
| 31 |
+
"model.language_model.layers.5.linear_attn.norm.weight": {
|
| 32 |
+
"shape": [
|
| 33 |
+
128
|
| 34 |
+
],
|
| 35 |
+
"dtype": "torch.bfloat16",
|
| 36 |
+
"sha256": "8c5b851bc9f42328d5e602c420f7893e1a79a352ec849f4782705e643f7a5a63"
|
| 37 |
+
},
|
| 38 |
+
"model.language_model.layers.6.linear_attn.norm.weight": {
|
| 39 |
+
"shape": [
|
| 40 |
+
128
|
| 41 |
+
],
|
| 42 |
+
"dtype": "torch.bfloat16",
|
| 43 |
+
"sha256": "1c8aeb2cb2e4c70546a5c51e758c129b839222aa5f119c4a8a8b34b202f6b396"
|
| 44 |
+
},
|
| 45 |
+
"model.language_model.layers.8.linear_attn.norm.weight": {
|
| 46 |
+
"shape": [
|
| 47 |
+
128
|
| 48 |
+
],
|
| 49 |
+
"dtype": "torch.bfloat16",
|
| 50 |
+
"sha256": "9234ecbe28da31cb0e835dd764a0c4c5ce42b2bbab5b5e6dd7c4b2028733ab44"
|
| 51 |
+
},
|
| 52 |
+
"model.language_model.layers.9.linear_attn.norm.weight": {
|
| 53 |
+
"shape": [
|
| 54 |
+
128
|
| 55 |
+
],
|
| 56 |
+
"dtype": "torch.bfloat16",
|
| 57 |
+
"sha256": "d6c97fadc4881c94b731a06e029e122c86fd6e64d32be72418646494844e8768"
|
| 58 |
+
},
|
| 59 |
+
"model.language_model.layers.10.linear_attn.norm.weight": {
|
| 60 |
+
"shape": [
|
| 61 |
+
128
|
| 62 |
+
],
|
| 63 |
+
"dtype": "torch.bfloat16",
|
| 64 |
+
"sha256": "a74612c48e8537808d2a034d59e4d2d0db60c216a4052b2cf8647014299f9992"
|
| 65 |
+
},
|
| 66 |
+
"model.language_model.layers.12.linear_attn.norm.weight": {
|
| 67 |
+
"shape": [
|
| 68 |
+
128
|
| 69 |
+
],
|
| 70 |
+
"dtype": "torch.bfloat16",
|
| 71 |
+
"sha256": "db6d0351b32b0cf2572d80d563773f7673f66a635eb04f451f087fb73cd33d5d"
|
| 72 |
+
},
|
| 73 |
+
"model.language_model.layers.13.linear_attn.norm.weight": {
|
| 74 |
+
"shape": [
|
| 75 |
+
128
|
| 76 |
+
],
|
| 77 |
+
"dtype": "torch.bfloat16",
|
| 78 |
+
"sha256": "098e12a781d1b9322d667baa4040f4241149e1aa1ff040e3692b613994072449"
|
| 79 |
+
},
|
| 80 |
+
"model.language_model.layers.14.linear_attn.norm.weight": {
|
| 81 |
+
"shape": [
|
| 82 |
+
128
|
| 83 |
+
],
|
| 84 |
+
"dtype": "torch.bfloat16",
|
| 85 |
+
"sha256": "58e44c64ae664bf859829382af46e9bd9d41af7d52f1222c45ce14d0ffff1d69"
|
| 86 |
+
},
|
| 87 |
+
"model.language_model.layers.16.linear_attn.norm.weight": {
|
| 88 |
+
"shape": [
|
| 89 |
+
128
|
| 90 |
+
],
|
| 91 |
+
"dtype": "torch.bfloat16",
|
| 92 |
+
"sha256": "ef08dcf8fa4f72c3b64239177cb12112889bdb381f2e408da3d60d45ba2582ce"
|
| 93 |
+
},
|
| 94 |
+
"model.language_model.layers.17.linear_attn.norm.weight": {
|
| 95 |
+
"shape": [
|
| 96 |
+
128
|
| 97 |
+
],
|
| 98 |
+
"dtype": "torch.bfloat16",
|
| 99 |
+
"sha256": "1b3e16a8f86d5f3878b442af5d08b7a4426484f69a9e8c85e72ed2c20a55e1b2"
|
| 100 |
+
},
|
| 101 |
+
"model.language_model.layers.18.linear_attn.norm.weight": {
|
| 102 |
+
"shape": [
|
| 103 |
+
128
|
| 104 |
+
],
|
| 105 |
+
"dtype": "torch.bfloat16",
|
| 106 |
+
"sha256": "2487c2270672175628244a349940005f84e5f12d8c821a6f91bd9008cb5fd3f7"
|
| 107 |
+
},
|
| 108 |
+
"model.language_model.layers.20.linear_attn.norm.weight": {
|
| 109 |
+
"shape": [
|
| 110 |
+
128
|
| 111 |
+
],
|
| 112 |
+
"dtype": "torch.bfloat16",
|
| 113 |
+
"sha256": "b2f0ff18e9f3d9cfa6770c8a47660464ddca059c243c3ea8688a31113c45a00f"
|
| 114 |
+
},
|
| 115 |
+
"model.language_model.layers.21.linear_attn.norm.weight": {
|
| 116 |
+
"shape": [
|
| 117 |
+
128
|
| 118 |
+
],
|
| 119 |
+
"dtype": "torch.bfloat16",
|
| 120 |
+
"sha256": "b5834fe5b037d2282821f0bb012433ac94ef6e2415f5760c7851ddec05e11b49"
|
| 121 |
+
},
|
| 122 |
+
"model.language_model.layers.22.linear_attn.norm.weight": {
|
| 123 |
+
"shape": [
|
| 124 |
+
128
|
| 125 |
+
],
|
| 126 |
+
"dtype": "torch.bfloat16",
|
| 127 |
+
"sha256": "2d4a88735c2aa9d6388ca222c85f00c8b775c8cfdabb294c010f38807d81f552"
|
| 128 |
+
},
|
| 129 |
+
"model.language_model.layers.24.linear_attn.norm.weight": {
|
| 130 |
+
"shape": [
|
| 131 |
+
128
|
| 132 |
+
],
|
| 133 |
+
"dtype": "torch.bfloat16",
|
| 134 |
+
"sha256": "5ccc0784104fd97d96e29fe10618ee070a483d9a3b1dec252f7734d8edeebfd1"
|
| 135 |
+
},
|
| 136 |
+
"model.language_model.layers.25.linear_attn.norm.weight": {
|
| 137 |
+
"shape": [
|
| 138 |
+
128
|
| 139 |
+
],
|
| 140 |
+
"dtype": "torch.bfloat16",
|
| 141 |
+
"sha256": "5a2f136c51b23d94c2e1fbf50144b52464313e1a6cd48903ec27e93df8f1b56e"
|
| 142 |
+
},
|
| 143 |
+
"model.language_model.layers.26.linear_attn.norm.weight": {
|
| 144 |
+
"shape": [
|
| 145 |
+
128
|
| 146 |
+
],
|
| 147 |
+
"dtype": "torch.bfloat16",
|
| 148 |
+
"sha256": "90f0d984dd7a3ebb0a0a0934b928cf12159636fc323c1fd85ad63aea4dc27056"
|
| 149 |
+
},
|
| 150 |
+
"model.language_model.layers.28.linear_attn.norm.weight": {
|
| 151 |
+
"shape": [
|
| 152 |
+
128
|
| 153 |
+
],
|
| 154 |
+
"dtype": "torch.bfloat16",
|
| 155 |
+
"sha256": "142aaa4032bdcc26abf0d6075d43dbb1b9d5464da8ae8acadbaacc52d0e3b432"
|
| 156 |
+
},
|
| 157 |
+
"model.language_model.layers.29.linear_attn.norm.weight": {
|
| 158 |
+
"shape": [
|
| 159 |
+
128
|
| 160 |
+
],
|
| 161 |
+
"dtype": "torch.bfloat16",
|
| 162 |
+
"sha256": "bde5fb0c8dcf91b33322e9acb5fbb3817a078a704caf93d44d6a1e0c09096516"
|
| 163 |
+
},
|
| 164 |
+
"model.language_model.layers.30.linear_attn.norm.weight": {
|
| 165 |
+
"shape": [
|
| 166 |
+
128
|
| 167 |
+
],
|
| 168 |
+
"dtype": "torch.bfloat16",
|
| 169 |
+
"sha256": "c736555811fb8586f8eda94feb198841e761882c693aed631fd394ac99c78227"
|
| 170 |
+
},
|
| 171 |
+
"model.language_model.layers.32.linear_attn.norm.weight": {
|
| 172 |
+
"shape": [
|
| 173 |
+
128
|
| 174 |
+
],
|
| 175 |
+
"dtype": "torch.bfloat16",
|
| 176 |
+
"sha256": "45d02941a0fccbfcdbeb20703724bb00e62c6ae0132416c16af22891cb6219b3"
|
| 177 |
+
},
|
| 178 |
+
"model.language_model.layers.33.linear_attn.norm.weight": {
|
| 179 |
+
"shape": [
|
| 180 |
+
128
|
| 181 |
+
],
|
| 182 |
+
"dtype": "torch.bfloat16",
|
| 183 |
+
"sha256": "657125188930ff7f1a564a2dec9ba39a4ec627ee272880fcbc62b38f5e7d16ef"
|
| 184 |
+
},
|
| 185 |
+
"model.language_model.layers.34.linear_attn.norm.weight": {
|
| 186 |
+
"shape": [
|
| 187 |
+
128
|
| 188 |
+
],
|
| 189 |
+
"dtype": "torch.bfloat16",
|
| 190 |
+
"sha256": "d60c836291c17875dc8415f7c88a3f08e64135b25fd7c2d356d82ec20c5c179f"
|
| 191 |
+
},
|
| 192 |
+
"model.language_model.layers.36.linear_attn.norm.weight": {
|
| 193 |
+
"shape": [
|
| 194 |
+
128
|
| 195 |
+
],
|
| 196 |
+
"dtype": "torch.bfloat16",
|
| 197 |
+
"sha256": "cd19580d07b0ee6ba8bf1e7e4287e1e6160b95e9890ff73f47415caf123c01d8"
|
| 198 |
+
},
|
| 199 |
+
"model.language_model.layers.37.linear_attn.norm.weight": {
|
| 200 |
+
"shape": [
|
| 201 |
+
128
|
| 202 |
+
],
|
| 203 |
+
"dtype": "torch.bfloat16",
|
| 204 |
+
"sha256": "0ac2482afc3e0a8cd6f7e25a8e468609456dffe74258bcf697b73434c4062f34"
|
| 205 |
+
},
|
| 206 |
+
"model.language_model.layers.38.linear_attn.norm.weight": {
|
| 207 |
+
"shape": [
|
| 208 |
+
128
|
| 209 |
+
],
|
| 210 |
+
"dtype": "torch.bfloat16",
|
| 211 |
+
"sha256": "1e35c37aae606f8020ab31d8d9382260174f73fafa0e5eeceee3bc551a25ebf6"
|
| 212 |
+
},
|
| 213 |
+
"model.language_model.layers.40.linear_attn.norm.weight": {
|
| 214 |
+
"shape": [
|
| 215 |
+
128
|
| 216 |
+
],
|
| 217 |
+
"dtype": "torch.bfloat16",
|
| 218 |
+
"sha256": "946f9f547ee6bb3b4aca77972942061f42de96de968064d99299f70c1629c025"
|
| 219 |
+
},
|
| 220 |
+
"model.language_model.layers.41.linear_attn.norm.weight": {
|
| 221 |
+
"shape": [
|
| 222 |
+
128
|
| 223 |
+
],
|
| 224 |
+
"dtype": "torch.bfloat16",
|
| 225 |
+
"sha256": "85b100dbeb603cc64ddcb83b62232d8c6d29eb125f5ec287c9d608733960ee01"
|
| 226 |
+
},
|
| 227 |
+
"model.language_model.layers.42.linear_attn.norm.weight": {
|
| 228 |
+
"shape": [
|
| 229 |
+
128
|
| 230 |
+
],
|
| 231 |
+
"dtype": "torch.bfloat16",
|
| 232 |
+
"sha256": "80f2f7eaf69d991b8e78e6141297c9545cc342a580db6a646a2b5ec134dbf927"
|
| 233 |
+
},
|
| 234 |
+
"model.language_model.layers.44.linear_attn.norm.weight": {
|
| 235 |
+
"shape": [
|
| 236 |
+
128
|
| 237 |
+
],
|
| 238 |
+
"dtype": "torch.bfloat16",
|
| 239 |
+
"sha256": "227089881bfc51cda9148ca54dc8c698c6eba36e87b87b1359af78fd28aaf25d"
|
| 240 |
+
},
|
| 241 |
+
"model.language_model.layers.45.linear_attn.norm.weight": {
|
| 242 |
+
"shape": [
|
| 243 |
+
128
|
| 244 |
+
],
|
| 245 |
+
"dtype": "torch.bfloat16",
|
| 246 |
+
"sha256": "5bbb0575d19c0c4d46f3de8dd7ab5a2d377678165f2abb7fa4a8e0006f43eb3c"
|
| 247 |
+
},
|
| 248 |
+
"model.language_model.layers.46.linear_attn.norm.weight": {
|
| 249 |
+
"shape": [
|
| 250 |
+
128
|
| 251 |
+
],
|
| 252 |
+
"dtype": "torch.bfloat16",
|
| 253 |
+
"sha256": "abc7d3229ec5758c89b6ce19c6688e3cc2d71f0fe89571a311041794dbdb1758"
|
| 254 |
+
},
|
| 255 |
+
"model.language_model.layers.48.linear_attn.norm.weight": {
|
| 256 |
+
"shape": [
|
| 257 |
+
128
|
| 258 |
+
],
|
| 259 |
+
"dtype": "torch.bfloat16",
|
| 260 |
+
"sha256": "50db0d157907958a6998fb4dfb91cae3a077a10a893af7b0fdb64b006490d19a"
|
| 261 |
+
},
|
| 262 |
+
"model.language_model.layers.49.linear_attn.norm.weight": {
|
| 263 |
+
"shape": [
|
| 264 |
+
128
|
| 265 |
+
],
|
| 266 |
+
"dtype": "torch.bfloat16",
|
| 267 |
+
"sha256": "71bc28bc98bd93f0e6eedcf84b7c65ec6e69c239ae8f3f085adddec16a8b4406"
|
| 268 |
+
},
|
| 269 |
+
"model.language_model.layers.50.linear_attn.norm.weight": {
|
| 270 |
+
"shape": [
|
| 271 |
+
128
|
| 272 |
+
],
|
| 273 |
+
"dtype": "torch.bfloat16",
|
| 274 |
+
"sha256": "41c8f8ae93934d922b53413f50481402c55c89fe9495e71d5c25cd306f190de2"
|
| 275 |
+
},
|
| 276 |
+
"model.language_model.layers.52.linear_attn.norm.weight": {
|
| 277 |
+
"shape": [
|
| 278 |
+
128
|
| 279 |
+
],
|
| 280 |
+
"dtype": "torch.bfloat16",
|
| 281 |
+
"sha256": "78011770bab9b02e655ed0611eb2a9cda2d5f0ec5383042675fc8691ba6dd520"
|
| 282 |
+
},
|
| 283 |
+
"model.language_model.layers.53.linear_attn.norm.weight": {
|
| 284 |
+
"shape": [
|
| 285 |
+
128
|
| 286 |
+
],
|
| 287 |
+
"dtype": "torch.bfloat16",
|
| 288 |
+
"sha256": "5cfdfcc68256271408afb0b495b9644fd3ea1e2902c93be21d6d50f1136fd21a"
|
| 289 |
+
},
|
| 290 |
+
"model.language_model.layers.54.linear_attn.norm.weight": {
|
| 291 |
+
"shape": [
|
| 292 |
+
128
|
| 293 |
+
],
|
| 294 |
+
"dtype": "torch.bfloat16",
|
| 295 |
+
"sha256": "5395e932a7c17e1fd5cc2dbaafbbebc47c89cbb62483491258e3326ba5cb03db"
|
| 296 |
+
},
|
| 297 |
+
"model.language_model.layers.56.linear_attn.norm.weight": {
|
| 298 |
+
"shape": [
|
| 299 |
+
128
|
| 300 |
+
],
|
| 301 |
+
"dtype": "torch.bfloat16",
|
| 302 |
+
"sha256": "4c60671ae4a110cab562a6818fe090818e93789225d81772d057583f1f569535"
|
| 303 |
+
},
|
| 304 |
+
"model.language_model.layers.57.linear_attn.norm.weight": {
|
| 305 |
+
"shape": [
|
| 306 |
+
128
|
| 307 |
+
],
|
| 308 |
+
"dtype": "torch.bfloat16",
|
| 309 |
+
"sha256": "50de304d91fdc95aaa01e97332e50003948fb613899e4e449891a0f1c065ccdf"
|
| 310 |
+
},
|
| 311 |
+
"model.language_model.layers.58.linear_attn.norm.weight": {
|
| 312 |
+
"shape": [
|
| 313 |
+
128
|
| 314 |
+
],
|
| 315 |
+
"dtype": "torch.bfloat16",
|
| 316 |
+
"sha256": "5617f844342db28fb30ea83246067b58b9704e3ef8733d2cb9e8ec43f4ea6f08"
|
| 317 |
+
},
|
| 318 |
+
"model.language_model.layers.60.linear_attn.norm.weight": {
|
| 319 |
+
"shape": [
|
| 320 |
+
128
|
| 321 |
+
],
|
| 322 |
+
"dtype": "torch.bfloat16",
|
| 323 |
+
"sha256": "86a7cb9a76db504e7f7bd6dc82e2f33bee43498f269f28199a6d2777d5db3c58"
|
| 324 |
+
},
|
| 325 |
+
"model.language_model.layers.61.linear_attn.norm.weight": {
|
| 326 |
+
"shape": [
|
| 327 |
+
128
|
| 328 |
+
],
|
| 329 |
+
"dtype": "torch.bfloat16",
|
| 330 |
+
"sha256": "520b52a593785f38cc98f58ef5064170f894701052d2531799778240dc0e12a5"
|
| 331 |
+
},
|
| 332 |
+
"model.language_model.layers.62.linear_attn.norm.weight": {
|
| 333 |
+
"shape": [
|
| 334 |
+
128
|
| 335 |
+
],
|
| 336 |
+
"dtype": "torch.bfloat16",
|
| 337 |
+
"sha256": "2e457dffaba24603a856d276bd1ae0ba3b4bb0efd66fe99bb9b73f713c86b055"
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
}
|
native-gdn/native_gdn_norm_delta.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8c9b8a455d091ac7ba5d3b10f03154c4673152025de321c4cf0f6c73dde85331
|
| 3 |
+
size 17824
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": true,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"merge_size": 2,
|
| 18 |
+
"patch_size": 16,
|
| 19 |
+
"resample": 3,
|
| 20 |
+
"rescale_factor": 0.00392156862745098,
|
| 21 |
+
"size": {
|
| 22 |
+
"longest_edge": 16777216,
|
| 23 |
+
"shortest_edge": 65536
|
| 24 |
+
},
|
| 25 |
+
"temporal_patch_size": 2
|
| 26 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"do_convert_rgb": true,
|
| 4 |
+
"do_normalize": true,
|
| 5 |
+
"do_rescale": true,
|
| 6 |
+
"do_resize": true,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.5,
|
| 10 |
+
0.5
|
| 11 |
+
],
|
| 12 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 13 |
+
"image_std": [
|
| 14 |
+
0.5,
|
| 15 |
+
0.5,
|
| 16 |
+
0.5
|
| 17 |
+
],
|
| 18 |
+
"merge_size": 2,
|
| 19 |
+
"patch_size": 16,
|
| 20 |
+
"resample": 3,
|
| 21 |
+
"rescale_factor": 0.00392156862745098,
|
| 22 |
+
"size": {
|
| 23 |
+
"longest_edge": 16777216,
|
| 24 |
+
"shortest_edge": 65536
|
| 25 |
+
},
|
| 26 |
+
"temporal_patch_size": 2
|
| 27 |
+
},
|
| 28 |
+
"processor_class": "Qwen3VLProcessor",
|
| 29 |
+
"video_processor": {
|
| 30 |
+
"do_convert_rgb": true,
|
| 31 |
+
"do_normalize": true,
|
| 32 |
+
"do_rescale": true,
|
| 33 |
+
"do_resize": true,
|
| 34 |
+
"do_sample_frames": true,
|
| 35 |
+
"fps": 2,
|
| 36 |
+
"image_mean": [
|
| 37 |
+
0.5,
|
| 38 |
+
0.5,
|
| 39 |
+
0.5
|
| 40 |
+
],
|
| 41 |
+
"image_std": [
|
| 42 |
+
0.5,
|
| 43 |
+
0.5,
|
| 44 |
+
0.5
|
| 45 |
+
],
|
| 46 |
+
"max_frames": 768,
|
| 47 |
+
"merge_size": 2,
|
| 48 |
+
"min_frames": 4,
|
| 49 |
+
"patch_size": 16,
|
| 50 |
+
"resample": 3,
|
| 51 |
+
"rescale_factor": 0.00392156862745098,
|
| 52 |
+
"return_metadata": false,
|
| 53 |
+
"size": {
|
| 54 |
+
"longest_edge": 25165824,
|
| 55 |
+
"shortest_edge": 4096
|
| 56 |
+
},
|
| 57 |
+
"temporal_patch_size": 2,
|
| 58 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 59 |
+
}
|
| 60 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"248044": {
|
| 5 |
+
"content": "<|endoftext|>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"248045": {
|
| 13 |
+
"content": "<|im_start|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"248046": {
|
| 21 |
+
"content": "<|im_end|>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
},
|
| 28 |
+
"248047": {
|
| 29 |
+
"content": "<|object_ref_start|>",
|
| 30 |
+
"lstrip": false,
|
| 31 |
+
"normalized": false,
|
| 32 |
+
"rstrip": false,
|
| 33 |
+
"single_word": false,
|
| 34 |
+
"special": true
|
| 35 |
+
},
|
| 36 |
+
"248048": {
|
| 37 |
+
"content": "<|object_ref_end|>",
|
| 38 |
+
"lstrip": false,
|
| 39 |
+
"normalized": false,
|
| 40 |
+
"rstrip": false,
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"special": true
|
| 43 |
+
},
|
| 44 |
+
"248049": {
|
| 45 |
+
"content": "<|box_start|>",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": false,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false,
|
| 50 |
+
"special": true
|
| 51 |
+
},
|
| 52 |
+
"248050": {
|
| 53 |
+
"content": "<|box_end|>",
|
| 54 |
+
"lstrip": false,
|
| 55 |
+
"normalized": false,
|
| 56 |
+
"rstrip": false,
|
| 57 |
+
"single_word": false,
|
| 58 |
+
"special": true
|
| 59 |
+
},
|
| 60 |
+
"248051": {
|
| 61 |
+
"content": "<|quad_start|>",
|
| 62 |
+
"lstrip": false,
|
| 63 |
+
"normalized": false,
|
| 64 |
+
"rstrip": false,
|
| 65 |
+
"single_word": false,
|
| 66 |
+
"special": true
|
| 67 |
+
},
|
| 68 |
+
"248052": {
|
| 69 |
+
"content": "<|quad_end|>",
|
| 70 |
+
"lstrip": false,
|
| 71 |
+
"normalized": false,
|
| 72 |
+
"rstrip": false,
|
| 73 |
+
"single_word": false,
|
| 74 |
+
"special": true
|
| 75 |
+
},
|
| 76 |
+
"248053": {
|
| 77 |
+
"content": "<|vision_start|>",
|
| 78 |
+
"lstrip": false,
|
| 79 |
+
"normalized": false,
|
| 80 |
+
"rstrip": false,
|
| 81 |
+
"single_word": false,
|
| 82 |
+
"special": true
|
| 83 |
+
},
|
| 84 |
+
"248054": {
|
| 85 |
+
"content": "<|vision_end|>",
|
| 86 |
+
"lstrip": false,
|
| 87 |
+
"normalized": false,
|
| 88 |
+
"rstrip": false,
|
| 89 |
+
"single_word": false,
|
| 90 |
+
"special": true
|
| 91 |
+
},
|
| 92 |
+
"248055": {
|
| 93 |
+
"content": "<|vision_pad|>",
|
| 94 |
+
"lstrip": false,
|
| 95 |
+
"normalized": false,
|
| 96 |
+
"rstrip": false,
|
| 97 |
+
"single_word": false,
|
| 98 |
+
"special": true
|
| 99 |
+
},
|
| 100 |
+
"248056": {
|
| 101 |
+
"content": "<|image_pad|>",
|
| 102 |
+
"lstrip": false,
|
| 103 |
+
"normalized": false,
|
| 104 |
+
"rstrip": false,
|
| 105 |
+
"single_word": false,
|
| 106 |
+
"special": true
|
| 107 |
+
},
|
| 108 |
+
"248057": {
|
| 109 |
+
"content": "<|video_pad|>",
|
| 110 |
+
"lstrip": false,
|
| 111 |
+
"normalized": false,
|
| 112 |
+
"rstrip": false,
|
| 113 |
+
"single_word": false,
|
| 114 |
+
"special": true
|
| 115 |
+
},
|
| 116 |
+
"248058": {
|
| 117 |
+
"content": "<tool_call>",
|
| 118 |
+
"lstrip": false,
|
| 119 |
+
"normalized": false,
|
| 120 |
+
"rstrip": false,
|
| 121 |
+
"single_word": false,
|
| 122 |
+
"special": false
|
| 123 |
+
},
|
| 124 |
+
"248059": {
|
| 125 |
+
"content": "</tool_call>",
|
| 126 |
+
"lstrip": false,
|
| 127 |
+
"normalized": false,
|
| 128 |
+
"rstrip": false,
|
| 129 |
+
"single_word": false,
|
| 130 |
+
"special": false
|
| 131 |
+
},
|
| 132 |
+
"248060": {
|
| 133 |
+
"content": "<|fim_prefix|>",
|
| 134 |
+
"lstrip": false,
|
| 135 |
+
"normalized": false,
|
| 136 |
+
"rstrip": false,
|
| 137 |
+
"single_word": false,
|
| 138 |
+
"special": false
|
| 139 |
+
},
|
| 140 |
+
"248061": {
|
| 141 |
+
"content": "<|fim_middle|>",
|
| 142 |
+
"lstrip": false,
|
| 143 |
+
"normalized": false,
|
| 144 |
+
"rstrip": false,
|
| 145 |
+
"single_word": false,
|
| 146 |
+
"special": false
|
| 147 |
+
},
|
| 148 |
+
"248062": {
|
| 149 |
+
"content": "<|fim_suffix|>",
|
| 150 |
+
"lstrip": false,
|
| 151 |
+
"normalized": false,
|
| 152 |
+
"rstrip": false,
|
| 153 |
+
"single_word": false,
|
| 154 |
+
"special": false
|
| 155 |
+
},
|
| 156 |
+
"248063": {
|
| 157 |
+
"content": "<|fim_pad|>",
|
| 158 |
+
"lstrip": false,
|
| 159 |
+
"normalized": false,
|
| 160 |
+
"rstrip": false,
|
| 161 |
+
"single_word": false,
|
| 162 |
+
"special": false
|
| 163 |
+
},
|
| 164 |
+
"248064": {
|
| 165 |
+
"content": "<|repo_name|>",
|
| 166 |
+
"lstrip": false,
|
| 167 |
+
"normalized": false,
|
| 168 |
+
"rstrip": false,
|
| 169 |
+
"single_word": false,
|
| 170 |
+
"special": false
|
| 171 |
+
},
|
| 172 |
+
"248065": {
|
| 173 |
+
"content": "<|file_sep|>",
|
| 174 |
+
"lstrip": false,
|
| 175 |
+
"normalized": false,
|
| 176 |
+
"rstrip": false,
|
| 177 |
+
"single_word": false,
|
| 178 |
+
"special": false
|
| 179 |
+
},
|
| 180 |
+
"248066": {
|
| 181 |
+
"content": "<tool_response>",
|
| 182 |
+
"lstrip": false,
|
| 183 |
+
"normalized": false,
|
| 184 |
+
"rstrip": false,
|
| 185 |
+
"single_word": false,
|
| 186 |
+
"special": false
|
| 187 |
+
},
|
| 188 |
+
"248067": {
|
| 189 |
+
"content": "</tool_response>",
|
| 190 |
+
"lstrip": false,
|
| 191 |
+
"normalized": false,
|
| 192 |
+
"rstrip": false,
|
| 193 |
+
"single_word": false,
|
| 194 |
+
"special": false
|
| 195 |
+
},
|
| 196 |
+
"248068": {
|
| 197 |
+
"content": "<think>",
|
| 198 |
+
"lstrip": false,
|
| 199 |
+
"normalized": false,
|
| 200 |
+
"rstrip": false,
|
| 201 |
+
"single_word": false,
|
| 202 |
+
"special": false
|
| 203 |
+
},
|
| 204 |
+
"248069": {
|
| 205 |
+
"content": "</think>",
|
| 206 |
+
"lstrip": false,
|
| 207 |
+
"normalized": false,
|
| 208 |
+
"rstrip": false,
|
| 209 |
+
"single_word": false,
|
| 210 |
+
"special": false
|
| 211 |
+
},
|
| 212 |
+
"248070": {
|
| 213 |
+
"content": "<|audio_start|>",
|
| 214 |
+
"lstrip": false,
|
| 215 |
+
"normalized": false,
|
| 216 |
+
"rstrip": false,
|
| 217 |
+
"single_word": false,
|
| 218 |
+
"special": true
|
| 219 |
+
},
|
| 220 |
+
"248071": {
|
| 221 |
+
"content": "<|audio_end|>",
|
| 222 |
+
"lstrip": false,
|
| 223 |
+
"normalized": false,
|
| 224 |
+
"rstrip": false,
|
| 225 |
+
"single_word": false,
|
| 226 |
+
"special": true
|
| 227 |
+
},
|
| 228 |
+
"248072": {
|
| 229 |
+
"content": "<tts_pad>",
|
| 230 |
+
"lstrip": false,
|
| 231 |
+
"normalized": false,
|
| 232 |
+
"rstrip": false,
|
| 233 |
+
"single_word": false,
|
| 234 |
+
"special": true
|
| 235 |
+
},
|
| 236 |
+
"248073": {
|
| 237 |
+
"content": "<tts_text_bos>",
|
| 238 |
+
"lstrip": false,
|
| 239 |
+
"normalized": false,
|
| 240 |
+
"rstrip": false,
|
| 241 |
+
"single_word": false,
|
| 242 |
+
"special": true
|
| 243 |
+
},
|
| 244 |
+
"248074": {
|
| 245 |
+
"content": "<tts_text_eod>",
|
| 246 |
+
"lstrip": false,
|
| 247 |
+
"normalized": false,
|
| 248 |
+
"rstrip": false,
|
| 249 |
+
"single_word": false,
|
| 250 |
+
"special": true
|
| 251 |
+
},
|
| 252 |
+
"248075": {
|
| 253 |
+
"content": "<tts_text_bos_single>",
|
| 254 |
+
"lstrip": false,
|
| 255 |
+
"normalized": false,
|
| 256 |
+
"rstrip": false,
|
| 257 |
+
"single_word": false,
|
| 258 |
+
"special": true
|
| 259 |
+
},
|
| 260 |
+
"248076": {
|
| 261 |
+
"content": "<|audio_pad|>",
|
| 262 |
+
"lstrip": false,
|
| 263 |
+
"normalized": false,
|
| 264 |
+
"rstrip": false,
|
| 265 |
+
"single_word": false,
|
| 266 |
+
"special": true
|
| 267 |
+
}
|
| 268 |
+
},
|
| 269 |
+
"additional_special_tokens": [
|
| 270 |
+
"<|im_start|>",
|
| 271 |
+
"<|im_end|>",
|
| 272 |
+
"<|object_ref_start|>",
|
| 273 |
+
"<|object_ref_end|>",
|
| 274 |
+
"<|box_start|>",
|
| 275 |
+
"<|box_end|>",
|
| 276 |
+
"<|quad_start|>",
|
| 277 |
+
"<|quad_end|>",
|
| 278 |
+
"<|vision_start|>",
|
| 279 |
+
"<|vision_end|>",
|
| 280 |
+
"<|vision_pad|>",
|
| 281 |
+
"<|image_pad|>",
|
| 282 |
+
"<|video_pad|>"
|
| 283 |
+
],
|
| 284 |
+
"bos_token": null,
|
| 285 |
+
"chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- set reasoning_instructions = '' %}\n{%- if enable_thinking is undefined or enable_thinking is true %}\n {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}\n {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}\n {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}\n {%- endif %}\n {%- if resolved_reasoning_effort == 'xhigh' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}\n {%- elif resolved_reasoning_effort == 'low' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}\n {%- endif %}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {%- if reasoning_instructions %}\n {{- reasoning_instructions + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '<|im_start|>system\\n' + (reasoning_instructions + '\\n\\n' if reasoning_instructions else '') + content + '<|im_end|>\\n' }}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' }}\n {%- endif %}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content, false)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {{- raise_exception('No user query found in messages.') }}\n{%- endif %}\n{%- for message in messages %}\n {%- set content = render_content(message.content, true)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- else %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is defined and tool_call.arguments != '' %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}",
|
| 286 |
+
"clean_up_tokenization_spaces": false,
|
| 287 |
+
"eos_token": "<|im_end|>",
|
| 288 |
+
"errors": "replace",
|
| 289 |
+
"model_max_length": 262144,
|
| 290 |
+
"pad_token": "<|endoftext|>",
|
| 291 |
+
"split_special_tokens": false,
|
| 292 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 293 |
+
"unk_token": null,
|
| 294 |
+
"add_bos_token": false,
|
| 295 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 296 |
+
"extra_special_tokens": {
|
| 297 |
+
"audio_bos_token": "<|audio_start|>",
|
| 298 |
+
"audio_eos_token": "<|audio_end|>",
|
| 299 |
+
"audio_token": "<|audio_pad|>",
|
| 300 |
+
"image_token": "<|image_pad|>",
|
| 301 |
+
"video_token": "<|video_pad|>",
|
| 302 |
+
"vision_bos_token": "<|vision_start|>",
|
| 303 |
+
"vision_eos_token": "<|vision_end|>"
|
| 304 |
+
}
|
| 305 |
+
}
|