reupload from modelscope cn
Browse files- .gitattributes +53 -35
- NOTICE +339 -0
- README.md +735 -0
- chat_template.json +3 -0
- config.json +51 -0
- configuration.json +1 -0
- configuration_dots.py +78 -0
- dots.ocr-1.5 LICENSE AGREEMENT +109 -0
- generation_config.json +8 -0
- merges.txt +3 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +651 -0
- modeling_dots_ocr.py +131 -0
- modeling_dots_vision.py +404 -0
- preprocessor_config.json +22 -0
- special_tokens_map.json +25 -0
- tokenizer.json +3 -0
- tokenizer_config.json +391 -0
- vocab.json +3 -0
.gitattributes
CHANGED
|
@@ -1,35 +1,53 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.
|
| 5 |
-
*.
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.
|
| 12 |
-
*.
|
| 13 |
-
*.
|
| 14 |
-
*.
|
| 15 |
-
*.
|
| 16 |
-
*.
|
| 17 |
-
*.
|
| 18 |
-
*.
|
| 19 |
-
*.
|
| 20 |
-
*
|
| 21 |
-
*.
|
| 22 |
-
*.
|
| 23 |
-
*.
|
| 24 |
-
*.
|
| 25 |
-
*.
|
| 26 |
-
|
| 27 |
-
*.
|
| 28 |
-
*.
|
| 29 |
-
*.
|
| 30 |
-
*
|
| 31 |
-
*.
|
| 32 |
-
*.
|
| 33 |
-
|
| 34 |
-
*.
|
| 35 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.db* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.ark* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
|
| 34 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.gguf* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.ggml filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.llamafile* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*.pt2 filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
|
| 49 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
vocab.json filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
model-00002-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
model-00001-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
merges.txt filter=lfs diff=lfs merge=lfs -text
|
NOTICE
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
==================================================================
|
| 2 |
+
=============== Copyright Notice and License Texts ===============
|
| 3 |
+
==================================================================
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
------------- LICENSE FOR gradio CODE --------------
|
| 7 |
+
|
| 8 |
+
Copyright notice:No copyright info provided
|
| 9 |
+
|
| 10 |
+
License:apache2.0
|
| 11 |
+
|
| 12 |
+
Apache License
|
| 13 |
+
Version 2.0, January 2004
|
| 14 |
+
http://www.apache.org/licenses/
|
| 15 |
+
|
| 16 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 17 |
+
|
| 18 |
+
1. Definitions.
|
| 19 |
+
|
| 20 |
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
| 21 |
+
|
| 22 |
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
| 23 |
+
|
| 24 |
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition,
|
| 25 |
+
|
| 26 |
+
"control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
| 27 |
+
|
| 28 |
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
| 29 |
+
|
| 30 |
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
| 31 |
+
|
| 32 |
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
| 33 |
+
|
| 34 |
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
| 35 |
+
|
| 36 |
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
| 37 |
+
|
| 38 |
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
| 39 |
+
|
| 40 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
| 41 |
+
|
| 42 |
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
| 43 |
+
|
| 44 |
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their
|
| 45 |
+
Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
| 46 |
+
|
| 47 |
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
| 48 |
+
|
| 49 |
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
| 50 |
+
|
| 51 |
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
| 52 |
+
|
| 53 |
+
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
| 54 |
+
|
| 55 |
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
| 56 |
+
|
| 57 |
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
| 58 |
+
|
| 59 |
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.Not withstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
| 60 |
+
|
| 61 |
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
| 62 |
+
|
| 63 |
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
| 64 |
+
|
| 65 |
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
| 66 |
+
|
| 67 |
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
| 68 |
+
|
| 69 |
+
END OF TERMS AND CONDITIONS
|
| 70 |
+
|
| 71 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 72 |
+
|
| 73 |
+
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
| 74 |
+
|
| 75 |
+
Copyright [yyyy] [name of copyright owner]
|
| 76 |
+
|
| 77 |
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
| 78 |
+
|
| 79 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 80 |
+
|
| 81 |
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
------------- LICENSE FOR gradio_image_annotation CODE --------------
|
| 86 |
+
|
| 87 |
+
Copyright notice:Copyright (c) 2024 Edgar Gracia
|
| 88 |
+
License :MIT
|
| 89 |
+
MIT License
|
| 90 |
+
|
| 91 |
+
Copyright (c) 2024 Edgar Gracia
|
| 92 |
+
|
| 93 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 94 |
+
|
| 95 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 96 |
+
|
| 97 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
------------- LICENSE FOR openai CODE --------------
|
| 102 |
+
|
| 103 |
+
Copyright notice:Copyright 2025 OpenAI
|
| 104 |
+
|
| 105 |
+
License:apache2.0
|
| 106 |
+
|
| 107 |
+
Please see above.
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
------------- LICENSE FOR qwen_vl_utils CODE --------------
|
| 112 |
+
|
| 113 |
+
Copyright notice:No copyright info provided
|
| 114 |
+
|
| 115 |
+
License:apache2.0
|
| 116 |
+
|
| 117 |
+
Please see above.
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
------------- LICENSE FOR transformers CODE --------------
|
| 122 |
+
|
| 123 |
+
Copyright notice:Copyright 2018- The Hugging Face team. All rights reserved.
|
| 124 |
+
|
| 125 |
+
License:apache2.0
|
| 126 |
+
|
| 127 |
+
Please see above.
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
------------- LICENSE FOR huggingface_hub CODE --------------
|
| 132 |
+
|
| 133 |
+
Copyright notice:No copyright info provided
|
| 134 |
+
|
| 135 |
+
License:apache2.0
|
| 136 |
+
|
| 137 |
+
Please see above.
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
------------- LICENSE FOR flash-attn CODE --------------
|
| 142 |
+
|
| 143 |
+
Copyright notice:Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file. All rights reserved.
|
| 144 |
+
|
| 145 |
+
License:BSD-3-Clause license
|
| 146 |
+
|
| 147 |
+
BSD 3-Clause License
|
| 148 |
+
|
| 149 |
+
Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file. All rights reserved.
|
| 150 |
+
|
| 151 |
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
| 152 |
+
|
| 153 |
+
* Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.
|
| 154 |
+
|
| 155 |
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
| 156 |
+
|
| 157 |
+
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
| 158 |
+
|
| 159 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 160 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISEDOF THE POSSIBILITY OF SUCH DAMAGE.
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
------------- LICENSE FOR accelerate CODE --------------
|
| 165 |
+
|
| 166 |
+
Copyright notice:No copyright info provided
|
| 167 |
+
|
| 168 |
+
License:apache2.0
|
| 169 |
+
|
| 170 |
+
Please see above.
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
------------- LICENSE FOR MonkeyOCR CODE --------------
|
| 175 |
+
|
| 176 |
+
Copyright notice:No copyright info provided
|
| 177 |
+
|
| 178 |
+
License:apache2.0
|
| 179 |
+
|
| 180 |
+
Please see above.
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
------------- LICENSE FOR OmniDocbench CODE --------------
|
| 185 |
+
|
| 186 |
+
Copyright notice:No copyright info provided
|
| 187 |
+
|
| 188 |
+
License:apache2.0
|
| 189 |
+
|
| 190 |
+
Please see above.
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
------------- LICENSE FOR Qwen2.5-VL CODE --------------
|
| 195 |
+
|
| 196 |
+
Copyright notice:No copyright info provided
|
| 197 |
+
|
| 198 |
+
License:apache2.0
|
| 199 |
+
|
| 200 |
+
Please see above.
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
------------- LICENSE FOR aimv2 CODE --------------
|
| 205 |
+
|
| 206 |
+
Copyright notice: Copyright (C) 2024 Apple Inc. All Rights Reserved.
|
| 207 |
+
|
| 208 |
+
License:
|
| 209 |
+
|
| 210 |
+
IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or
|
| 211 |
+
redistribute this Apple software.
|
| 212 |
+
|
| 213 |
+
In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. May be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated.
|
| 214 |
+
|
| 215 |
+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
| 216 |
+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
| 217 |
+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 218 |
+
|
| 219 |
+
SOFTWARE DISTRIBUTED WITH AUTOREGRESSIVE IMAGE MODELS:
|
| 220 |
+
|
| 221 |
+
The Autoregressive Image Models software includes a number of subcomponents with
|
| 222 |
+
separate copyright notices and license terms - please see the file ACKNOWLEDGEMENTS.
|
| 223 |
+
|
| 224 |
+
Acknowledgements:
|
| 225 |
+
|
| 226 |
+
Portions of the Autoregressive Image Models project may utilize the following copyrighted material, the use of which is hereby acknowledged.
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
------------- LICENSE FOR Hugging Face CODE --------------
|
| 230 |
+
|
| 231 |
+
Copyright notice:Copyright 2019 Ross Wightman
|
| 232 |
+
|
| 233 |
+
License:apache2.0
|
| 234 |
+
|
| 235 |
+
Please see above.
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
------------- LICENSE FOR vLLM CODE --------------
|
| 240 |
+
|
| 241 |
+
Copyright notice:No copyright info provided
|
| 242 |
+
|
| 243 |
+
License:apache2.0
|
| 244 |
+
|
| 245 |
+
Please see above.
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
------------- LICENSE FOR Doclaynet --------------
|
| 250 |
+
|
| 251 |
+
Copyright notice:No copyright info provided
|
| 252 |
+
|
| 253 |
+
License:Community Data License Agreement
|
| 254 |
+
|
| 255 |
+
Community Data License Agreement – Permissive – Version 1.0
|
| 256 |
+
|
| 257 |
+
This is the Community Data License Agreement – Permissive, Version 1.0 (“Agreement”). Data is provided to You under this Agreement by each of the Data Providers. Your exercise of any of the rights and permissions granted below constitutes your acceptance and agreement to be bound by the terms and conditions of this Agreement.
|
| 258 |
+
|
| 259 |
+
The benefits that each Data Provider receives from making Data available and that You receive from Data or otherwise under these terms and conditions shall be deemed sufficient consideration for the formation of this Agreement. Accordingly, Data Provider(s) and You (the "Parties") agree as follows:
|
| 260 |
+
|
| 261 |
+
Section 1. Definitions
|
| 262 |
+
|
| 263 |
+
1.1 "Add" means to supplement Data with Your own or someone else's Data, resulting in Your “Additions.” Additions do not include Results.
|
| 264 |
+
|
| 265 |
+
1.2 "Computational Use" means Your analysis (through the use of computational devices or otherwise) or other interpretation of Data. By way of example and not limitation, "Computational Use" includes the application of any computational analytical technique, the purpose of which is the analysis of any Data in digital form to generate information about Data such as patterns, trends, correlations, inferences, insights and attributes.
|
| 266 |
+
|
| 267 |
+
1.3 "Data" means the information (including copyrightable information, such as images or text), collectively or individually, whether created or gathered by a Data Provider or an Entity acting on its behalf, to which rights are granted under this Agreement.
|
| 268 |
+
|
| 269 |
+
1.4 "Data Provider" means any Entity (including any employee or contractor of such Entity authorized to Publish Data on behalf of such Entity) that Publishes Data under this Agreement prior to Your Receiving it.
|
| 270 |
+
|
| 271 |
+
1.5 "Enhanced Data" means the subset of Data that You Publish and that is composed of (a) Your Additions and/or (b) Modifications to Data You have received under this Agreement.
|
| 272 |
+
|
| 273 |
+
1.6 "Entity" means any natural person or organization that exists under the laws of the jurisdiction in which it is organized, together with all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (a) the power, directly or indirectly, to cause the direction or management of such entity, whether by contract or otherwise, (b) the ownership of more than fifty percent (50%) of the outstanding shares or securities, (c) the beneficial ownership of such entity or, (d) the ability to appoint, whether by agreement or right, the majority of directors of an Entity.
|
| 274 |
+
|
| 275 |
+
1.7 "Modify" means to delete, erase, correct or re-arrange Data, resulting in “Modifications.” Modifications do not include Results.
|
| 276 |
+
|
| 277 |
+
1.8 "Publish" means to make all or a subset of Data (including Your Enhanced Data) available in any manner which enables its use, including by providing a copy on physical media or remote access. For any form of Entity, that is to make the Data available to any individual who is not employed by that Entity or engaged as a contractor or agent to perform work on that Entity's behalf. A "Publication" occurs each time you Publish Data.
|
| 278 |
+
|
| 279 |
+
1.9 "Receive" or "Receives" means to have been given access to Data, locally or remotely.
|
| 280 |
+
|
| 281 |
+
1.10 "Results" means the outcomes or outputs that You obtain from Your Computational Use of Data. Results shall not include more than a de minimis portion of the Data on which the Computational Use is based.
|
| 282 |
+
|
| 283 |
+
1.11 "Sui Generis Database Rights" means rights, other than copyright, resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other equivalent rights anywhere in the world.
|
| 284 |
+
|
| 285 |
+
1.12 "Use" means using Data (including accessing, copying, studying, reviewing, adapting, analyzing, evaluating, or making Computational Use of it), either by machines or humans, or a combination of both.
|
| 286 |
+
|
| 287 |
+
1.13 "You" or "Your" means any Entity that Receives Data under this Agreement.
|
| 288 |
+
|
| 289 |
+
Section 2. Right and License to Use and to Publish
|
| 290 |
+
|
| 291 |
+
2.1 Subject to the conditions set forth in Section 3 of this Agreement, Data Provider(s) hereby grant(s) to You a worldwide, non-exclusive, irrevocable (except as provided in Section 5) right to: (a) Use Data; and (b) Publish Data.
|
| 292 |
+
|
| 293 |
+
2.2 To the extent that the Data or the coordination, selection or arrangement of Data is protected or protectable under copyright, Sui Generis Database Rights, or other law, Data Provider(s) further agree(s) that such Data or coordination, selection or arrangement is hereby licensed to You and to anyone else who Receives Data under this Agreement for Use and Publication, subject to the conditions set forth in Section 3 of this Agreement.
|
| 294 |
+
|
| 295 |
+
2.3 Except for these rights and licenses expressly granted, no other intellectual property rights are granted or should be implied.
|
| 296 |
+
|
| 297 |
+
Section 3. Conditions on Rights Granted
|
| 298 |
+
|
| 299 |
+
3.1 If You Publish Data You Receive or Enhanced Data:
|
| 300 |
+
|
| 301 |
+
(a) You may do so under a license of your choice provided that you give anyone who receives the data from you the text of this Agreement, the name of this Agreement and/or a hyperlink or other method reasonably likely to provide a copy of the text of this Agreement; and
|
| 302 |
+
|
| 303 |
+
(b) You must cause any Data files containing Enhanced Data to carry prominent notices that you have changed those files; and
|
| 304 |
+
|
| 305 |
+
(c) If You Publish Data You Receive, You must preserve all credit or attribution to the Data Provider(s). Such retained credit or attribution includes any of the following to the extent they exist in the Data as You have Received it: legal notices or metadata; identification of the Data Provider(s); or hyperlinks to Data to the extent it is practical to do so.
|
| 306 |
+
|
| 307 |
+
3.2 You may provide additional or different license terms and conditions for use, reproduction, or distribution of that Enhanced Data, or for any combination of Data and Enhanced Data as a whole, provided that Your Use and Publication of that combined Data otherwise complies with the conditions stated in this License.
|
| 308 |
+
|
| 309 |
+
3.3 You and each Data Provider agree that Enhanced Data shall not be considered a work of joint authorship by virtue of its relationship to Data licensed under this Agreement and shall not require either any obligation of accounting to or the consent of any Data Provider.
|
| 310 |
+
|
| 311 |
+
3.4 This Agreement imposes no obligations or restrictions on Your Use or Publication of Results.
|
| 312 |
+
|
| 313 |
+
Section 4. Data Provider(s)' Representations
|
| 314 |
+
|
| 315 |
+
4.1 Each Data Provider represents that the Data Provider has exercised reasonable care, to assure that: (a) the Data it Publishes was created or generated by it or was obtained from others with the right to Publish the Data under this Agreement; and (b) Publication of such Data does not violate any privacy or confidentiality obligation undertaken by the Data Provider.
|
| 316 |
+
|
| 317 |
+
Section 5. Termination
|
| 318 |
+
|
| 319 |
+
5.1 All of Your rights under this Agreement will terminate, and Your right to Receive, Use or Publish the Data will be revoked or modified if You materially fail to comply with the terms and conditions of this Agreement and You do not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If your rights under this Agreement terminate, you agree to cease Receipt, Use and Publication of Data. However, your obligations and any rights and permissions granted by you under this Agreement relating to Data that you published prior to such termination will continue and survive.
|
| 320 |
+
|
| 321 |
+
5.2 If you institute litigation against a Data Provider or anyone else who Receives the Data (including a cross-claim in a lawsuit) based on the Data, other than a claim asserting breach of this Agreement, then any rights previously granted to You to Receive, Use and Publish Data under this Agreement will terminate as of the date such litigation is filed.
|
| 322 |
+
|
| 323 |
+
Section 6. Disclaimer of Warranties and Limitation of Liability
|
| 324 |
+
|
| 325 |
+
6.1 EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE DATA (INCLUDING ENHANCED DATA) IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
| 326 |
+
|
| 327 |
+
6.2 NEITHER YOU NOR ANY DATA PROVIDERS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE DATA OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
| 328 |
+
|
| 329 |
+
Section 7. Miscellaneous
|
| 330 |
+
|
| 331 |
+
7.1 You agree that it is solely your responsibility to comply with all applicable laws with regard to Your Use or Publication of Data, including any applicable privacy, data protection, security and export laws. You agree to take reasonable steps to assist a Data Provider fulfilling responsibilities to comply with applicable laws with regard to Use or Publication of Data Received hereunder.
|
| 332 |
+
|
| 333 |
+
7.2 You and Data Provider(s), collectively and individually, waive and/or agree not to assert, to the extent permitted by law, any moral rights you or they hold in Data.
|
| 334 |
+
|
| 335 |
+
7.3 This Agreement confers no rights or remedies upon any person or entity other than the Parties and their respective heirs, executors, successors and assigns.
|
| 336 |
+
|
| 337 |
+
7.4 The Data Provider(s) reserve no right or expectation of privacy, data protection or confidentiality in any Data that they Publish under this Agreement. If you choose to Publish Data under this Agreement, you similarly do so with no reservation or expectation of any rights of privacy or confidentiality in that Data.
|
| 338 |
+
|
| 339 |
+
7.5 The Community Data License Agreement workgroup under The Linux Foundation is the steward of this Agreement (“Steward”). No one other than the Steward has the right to modify or publish new versions of this Agreement. Each version will be given a distinguishing version number. You may Use and Publish Data Received hereunder under the terms of the version of the Agreement under which You originally Received the Data, or under the terms of any subsequent version published by the Steward.
|
README.md
CHANGED
|
@@ -1,3 +1,738 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
library_name: dots_ocr_1_5
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- image-to-text
|
| 7 |
+
- ocr
|
| 8 |
+
- document-parse
|
| 9 |
+
- layout
|
| 10 |
+
- table
|
| 11 |
+
- formula
|
| 12 |
+
- transformers
|
| 13 |
+
- custom_code
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
- zh
|
| 17 |
+
- multilingual
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
<div align="center">
|
| 21 |
+
|
| 22 |
+
<p align="center">
|
| 23 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/logo.png" width="300"/>
|
| 24 |
+
<p>
|
| 25 |
+
|
| 26 |
+
<h1 align="center">
|
| 27 |
+
dots.ocr-1.5: Recognize Any Human Scripts and Symbols
|
| 28 |
+
</h1>
|
| 29 |
+
|
| 30 |
+
[](https://huggingface.co/rednote-hilab/dots.ocr-1.5)
|
| 31 |
+
[](https://github.com/rednote-hilab/dots.ocr)
|
| 32 |
+
|
| 33 |
+
<div align="center">
|
| 34 |
+
<a href="https://dotsocr.xiaohongshu.com" target="_blank" rel="noopener noreferrer"><strong>🖥️ Live Demo</strong></a> |
|
| 35 |
+
<a href="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/wechat.jpg" target="_blank" rel="noopener noreferrer"><strong>💬 WeChat</strong></a> |
|
| 36 |
+
<a href="https://www.xiaohongshu.com/user/profile/683ffe42000000001d021a4c" target="_blank" rel="noopener noreferrer"><strong>📕 rednote</strong></a>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## Introduction
|
| 44 |
+
|
| 45 |
+
We present **dots.ocr-1.5**, a 3B-parameter multimodal model composed of a 1.2B vision encoder and a 1.7B language model. Designed for universal accessibility, it possesses the capability to recognize virtually any human script. Beyond achieving state-of-the-art (SOTA) performance in standard multilingual document parsing among models of comparable size, dots.ocr-1.5 excels at converting structured graphics (e.g., charts and diagrams) directly into SVG code, parsing web screens and spotting scene text. Furthermore, the model demonstrates competitive performance in general OCR, object grounding & counting tasks.
|
| 46 |
+
|
| 47 |
+
1. **Stronger Document Parsing Performance:** dots.ocr-1.5 maintains SOTA performance among latest OCR models, particularly on **multilingual documents**. Addressing the significant bias inherent in the detection & matching rules of certain benchmarks —which often fail to accurately reflect a model's true capabilities—we adopted an **Elo score** evaluation system. Under this metric, the performance landscape shifts significantly, highlighting the superior robustness of our model compared to conventional rankings.
|
| 48 |
+
2. **Unified Vision-Language Parsing**: Visual languages (e.g., charts, graphics, chemical formulas, logos) encapsulate dense human knowledge, akin to natural language. dots.ocr-1.5 unifies the interpretation of these elements by parsing them directly into SVG code. We have validated the effectiveness of this approach, demonstrating impressive results in structural and semantic recognition.
|
| 49 |
+
3. **Broader and More General Capabilities**: Compared to dots.ocr, dots.ocr-1.5 supports a significantly wider array of tasks. It extends beyond standard OCR to handle web screen parsing, scene text spotting, object grounding & counting, and other general OCR QA tasks.
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
## Evaluation
|
| 53 |
+
|
| 54 |
+
### 1. Document Parsing
|
| 55 |
+
|
| 56 |
+
#### 1.1 Elo Score of different bench between latest models
|
| 57 |
+
<table>
|
| 58 |
+
<thead>
|
| 59 |
+
<tr>
|
| 60 |
+
<th>models</th>
|
| 61 |
+
<th>olmOCR-Bench</th>
|
| 62 |
+
<th>OmniDocBench (v1.5)</th>
|
| 63 |
+
<th>XDocParse</th>
|
| 64 |
+
</tr>
|
| 65 |
+
</thead>
|
| 66 |
+
<tbody>
|
| 67 |
+
<tr>
|
| 68 |
+
<td>GLM-OCR</td>
|
| 69 |
+
<td>859.9</td>
|
| 70 |
+
<td>937.5</td>
|
| 71 |
+
<td>742.1</td>
|
| 72 |
+
</tr>
|
| 73 |
+
<tr>
|
| 74 |
+
<td>PaddleOCR-VL-1.5</td>
|
| 75 |
+
<td>873.6</td>
|
| 76 |
+
<td>965.6</td>
|
| 77 |
+
<td>797.6</td>
|
| 78 |
+
</tr>
|
| 79 |
+
<tr>
|
| 80 |
+
<td>HuanyuanOCR</td>
|
| 81 |
+
<td>978.9</td>
|
| 82 |
+
<td>974.4</td>
|
| 83 |
+
<td>895.9</td>
|
| 84 |
+
</tr>
|
| 85 |
+
<tr>
|
| 86 |
+
<td>dots.ocr</td>
|
| 87 |
+
<td>1027.4</td>
|
| 88 |
+
<td>994.7</td>
|
| 89 |
+
<td>1133.4</td>
|
| 90 |
+
</tr>
|
| 91 |
+
<!-- Highlighting dots.ocr-1.5 row with bold tags -->
|
| 92 |
+
<tr>
|
| 93 |
+
<td><strong>dots.ocr-1.5</strong></td>
|
| 94 |
+
<td><strong>1089.0</strong></td>
|
| 95 |
+
<td><strong>1025.8</strong></td>
|
| 96 |
+
<td><strong>1157.1</strong></td>
|
| 97 |
+
</tr>
|
| 98 |
+
<tr>
|
| 99 |
+
<td>Gemini 3 Pro</td>
|
| 100 |
+
<td>1171.2</td>
|
| 101 |
+
<td>1102.1</td>
|
| 102 |
+
<td>1273.9</td>
|
| 103 |
+
</tr>
|
| 104 |
+
</tbody>
|
| 105 |
+
</table>
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
> **Notes:**
|
| 109 |
+
> - Results for Gemini 3 Pro, PaddleOCR-VL-1.5, and GLM-OCR were obtained via APIs, while HuanyuanOCR results were generated using local inference.
|
| 110 |
+
> - The Elo score evaluation was conducted using Gemini 3 Flash. The prompt can be found at: [Elo Score Prompt](https://github.com/rednote-hilab/dots.ocr/blob/master/tools/elo_score_prompt.py). These results are consistent with the findings on [ocrarena](https://www.ocrarena.ai/battle).
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
#### 1.2 olmOCR-bench
|
| 114 |
+
<table>
|
| 115 |
+
<thead>
|
| 116 |
+
<tr>
|
| 117 |
+
<th>Model</th>
|
| 118 |
+
<th>ArXiv</th>
|
| 119 |
+
<th>Old scans math</th>
|
| 120 |
+
<th>Tables</th>
|
| 121 |
+
<th>Old scans</th>
|
| 122 |
+
<th>Headers & footers</th>
|
| 123 |
+
<th>Multi column</th>
|
| 124 |
+
<th>Long tiny text</th>
|
| 125 |
+
<th>Base</th>
|
| 126 |
+
<th>Overall</th>
|
| 127 |
+
</tr>
|
| 128 |
+
</thead>
|
| 129 |
+
<tbody>
|
| 130 |
+
<tr>
|
| 131 |
+
<td>Mistral OCR API</td>
|
| 132 |
+
<td>77.2</td>
|
| 133 |
+
<td>67.5</td>
|
| 134 |
+
<td>60.6</td>
|
| 135 |
+
<td>29.3</td>
|
| 136 |
+
<td>93.6</td>
|
| 137 |
+
<td>71.3</td>
|
| 138 |
+
<td>77.1</td>
|
| 139 |
+
<td>99.4</td>
|
| 140 |
+
<td>72.0±1.1</td>
|
| 141 |
+
</tr>
|
| 142 |
+
<tr>
|
| 143 |
+
<td>Marker 1.10.1</td>
|
| 144 |
+
<td>83.8</td>
|
| 145 |
+
<td>66.8</td>
|
| 146 |
+
<td>72.9</td>
|
| 147 |
+
<td>33.5</td>
|
| 148 |
+
<td>86.6</td>
|
| 149 |
+
<td>80.0</td>
|
| 150 |
+
<td>85.7</td>
|
| 151 |
+
<td>99.3</td>
|
| 152 |
+
<td>76.1±1.1</td>
|
| 153 |
+
</tr>
|
| 154 |
+
<tr>
|
| 155 |
+
<td>MinerU 2.5.4*</td>
|
| 156 |
+
<td>76.6</td>
|
| 157 |
+
<td>54.6</td>
|
| 158 |
+
<td>84.9</td>
|
| 159 |
+
<td>33.7</td>
|
| 160 |
+
<td>96.6</td>
|
| 161 |
+
<td>78.2</td>
|
| 162 |
+
<td>83.5</td>
|
| 163 |
+
<td>93.7</td>
|
| 164 |
+
<td>75.2±1.1</td>
|
| 165 |
+
</tr>
|
| 166 |
+
<tr>
|
| 167 |
+
<td>DeepSeek-OCR</td>
|
| 168 |
+
<td>77.2</td>
|
| 169 |
+
<td>73.6</td>
|
| 170 |
+
<td>80.2</td>
|
| 171 |
+
<td>33.3</td>
|
| 172 |
+
<td>96.1</td>
|
| 173 |
+
<td>66.4</td>
|
| 174 |
+
<td>79.4</td>
|
| 175 |
+
<td>99.8</td>
|
| 176 |
+
<td>75.7±1.0</td>
|
| 177 |
+
</tr>
|
| 178 |
+
<tr>
|
| 179 |
+
<td>Nanonets-OCR2-3B</td>
|
| 180 |
+
<td>75.4</td>
|
| 181 |
+
<td>46.1</td>
|
| 182 |
+
<td>86.8</td>
|
| 183 |
+
<td>40.9</td>
|
| 184 |
+
<td>32.1</td>
|
| 185 |
+
<td>81.9</td>
|
| 186 |
+
<td>93.0</td>
|
| 187 |
+
<td>99.6</td>
|
| 188 |
+
<td>69.5±1.1</td>
|
| 189 |
+
</tr>
|
| 190 |
+
<tr>
|
| 191 |
+
<td>PaddleOCR-VL*</td>
|
| 192 |
+
<td>85.7</td>
|
| 193 |
+
<td>71.0</td>
|
| 194 |
+
<td>84.1</td>
|
| 195 |
+
<td>37.8</td>
|
| 196 |
+
<td>97.0</td>
|
| 197 |
+
<td>79.9</td>
|
| 198 |
+
<td>85.7</td>
|
| 199 |
+
<td>98.5</td>
|
| 200 |
+
<td>80.0±1.0</td>
|
| 201 |
+
</tr>
|
| 202 |
+
<tr>
|
| 203 |
+
<td>Infinity-Parser 7B*</td>
|
| 204 |
+
<td>84.4</td>
|
| 205 |
+
<td>83.8</td>
|
| 206 |
+
<td>85.0</td>
|
| 207 |
+
<td>47.9</td>
|
| 208 |
+
<td>88.7</td>
|
| 209 |
+
<td>84.2</td>
|
| 210 |
+
<td>86.4</td>
|
| 211 |
+
<td>99.8</td>
|
| 212 |
+
<td>82.5±?</td>
|
| 213 |
+
</tr>
|
| 214 |
+
<tr>
|
| 215 |
+
<td>olmOCR v0.4.0</td>
|
| 216 |
+
<td>83.0</td>
|
| 217 |
+
<td>82.3</td>
|
| 218 |
+
<td>84.9</td>
|
| 219 |
+
<td>47.7</td>
|
| 220 |
+
<td>96.1</td>
|
| 221 |
+
<td>83.7</td>
|
| 222 |
+
<td>81.9</td>
|
| 223 |
+
<td>99.7</td>
|
| 224 |
+
<td>82.4±1.1</td>
|
| 225 |
+
</tr>
|
| 226 |
+
<tr>
|
| 227 |
+
<td>Chandra OCR 0.1.0*</td>
|
| 228 |
+
<td>82.2</td>
|
| 229 |
+
<td>80.3</td>
|
| 230 |
+
<td>88.0</td>
|
| 231 |
+
<td>50.4</td>
|
| 232 |
+
<td>90.8</td>
|
| 233 |
+
<td>81.2</td>
|
| 234 |
+
<td>92.3</td>
|
| 235 |
+
<td>99.9</td>
|
| 236 |
+
<td>83.1±0.9</td>
|
| 237 |
+
</tr>
|
| 238 |
+
<tr>
|
| 239 |
+
<td>dots.ocr</td>
|
| 240 |
+
<td>82.1</td>
|
| 241 |
+
<td>64.2</td>
|
| 242 |
+
<td>88.3</td>
|
| 243 |
+
<td>40.9</td>
|
| 244 |
+
<td>94.1</td>
|
| 245 |
+
<td>82.4</td>
|
| 246 |
+
<td>81.2</td>
|
| 247 |
+
<td>99.5</td>
|
| 248 |
+
<td>79.1±1.0</td>
|
| 249 |
+
</tr>
|
| 250 |
+
<tr>
|
| 251 |
+
<td><strong>dots.ocr-1.5</strong></td>
|
| 252 |
+
<td><strong>85.9</strong></td>
|
| 253 |
+
<td><strong>85.5</strong></td>
|
| 254 |
+
<td><strong>90.7</strong></td>
|
| 255 |
+
<td>48.2</td>
|
| 256 |
+
<td>94.0</td>
|
| 257 |
+
<td><strong>85.3</strong></td>
|
| 258 |
+
<td>81.6</td>
|
| 259 |
+
<td>99.7</td>
|
| 260 |
+
<td><strong>83.9±0.9</strong></td>
|
| 261 |
+
</tr>
|
| 262 |
+
</tbody>
|
| 263 |
+
</table>
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
> **Note:**
|
| 267 |
+
> - The metrics are from [olmocr](https://github.com/allenai/olmocr), and our own internal evaluations.
|
| 268 |
+
> - We delete the Page-header and Page-footer cells in the result markdown.
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
#### 1.3 Other Benchmarks
|
| 272 |
+
|
| 273 |
+
<table>
|
| 274 |
+
<thead>
|
| 275 |
+
<tr>
|
| 276 |
+
<th>Model Type</th>
|
| 277 |
+
<th>Methods</th>
|
| 278 |
+
<th>Size</th>
|
| 279 |
+
<th>OmniDocBench(v1.5)<br>TextEdit↓</th>
|
| 280 |
+
<th>OmniDocBench(v1.5)<br>Read OrderEdit↓</th>
|
| 281 |
+
<th>pdf-parse-bench</th>
|
| 282 |
+
</tr>
|
| 283 |
+
</thead>
|
| 284 |
+
<tbody>
|
| 285 |
+
<!-- GeneralVLMs Group (Reversed Order, 3 rows) -->
|
| 286 |
+
<tr>
|
| 287 |
+
<td rowspan="3"><strong>GeneralVLMs</strong></td>
|
| 288 |
+
<td>Gemini-2.5 Pro</td>
|
| 289 |
+
<td>-</td>
|
| 290 |
+
<td>0.075</td>
|
| 291 |
+
<td>0.097</td>
|
| 292 |
+
<td>9.06</td>
|
| 293 |
+
</tr>
|
| 294 |
+
<tr>
|
| 295 |
+
<td>Qwen3-VL-235B-A22B-Instruct</td>
|
| 296 |
+
<td>235B</td>
|
| 297 |
+
<td>0.069</td>
|
| 298 |
+
<td>0.068</td>
|
| 299 |
+
<td><strong>9.71</strong></td>
|
| 300 |
+
</tr>
|
| 301 |
+
<tr>
|
| 302 |
+
<td>gemini3pro</td>
|
| 303 |
+
<td>-</td>
|
| 304 |
+
<td>0.066</td>
|
| 305 |
+
<td>0.079</td>
|
| 306 |
+
<td>9.68</td>
|
| 307 |
+
</tr>
|
| 308 |
+
<!-- SpecializedVLMs Group (Reversed Order, 12 rows) -->
|
| 309 |
+
<tr>
|
| 310 |
+
<td rowspan="12"><strong>SpecializedVLMs</strong></td>
|
| 311 |
+
<td>Mistral OCR</td>
|
| 312 |
+
<td>-</td>
|
| 313 |
+
<td>0.164</td>
|
| 314 |
+
<td>0.144</td>
|
| 315 |
+
<td>8.84</td>
|
| 316 |
+
</tr>
|
| 317 |
+
<tr>
|
| 318 |
+
<td>Deepseek-OCR</td>
|
| 319 |
+
<td>3B</td>
|
| 320 |
+
<td>0.073</td>
|
| 321 |
+
<td>0.086</td>
|
| 322 |
+
<td>8.26</td>
|
| 323 |
+
</tr>
|
| 324 |
+
<tr>
|
| 325 |
+
<td>MonkeyOCR-3B</td>
|
| 326 |
+
<td>3B</td>
|
| 327 |
+
<td>0.075</td>
|
| 328 |
+
<td>0.129</td>
|
| 329 |
+
<td>9.27</td>
|
| 330 |
+
</tr>
|
| 331 |
+
<tr>
|
| 332 |
+
<td>OCRVerse</td>
|
| 333 |
+
<td>4B</td>
|
| 334 |
+
<td>0.058</td>
|
| 335 |
+
<td>0.071</td>
|
| 336 |
+
<td>--</td>
|
| 337 |
+
</tr>
|
| 338 |
+
<tr>
|
| 339 |
+
<td>MonkeyOCR-pro-3B</td>
|
| 340 |
+
<td>3B</td>
|
| 341 |
+
<td>0.075</td>
|
| 342 |
+
<td>0.128</td>
|
| 343 |
+
<td>-</td>
|
| 344 |
+
</tr>
|
| 345 |
+
<tr>
|
| 346 |
+
<td>MinerU2.5</td>
|
| 347 |
+
<td>1.2B</td>
|
| 348 |
+
<td>0.047</td>
|
| 349 |
+
<td>0.044</td>
|
| 350 |
+
<td>-</td>
|
| 351 |
+
</tr>
|
| 352 |
+
<tr>
|
| 353 |
+
<td>PaddleOCR-VL</td>
|
| 354 |
+
<td>0.9B</td>
|
| 355 |
+
<td>0.035</td>
|
| 356 |
+
<td>0.043</td>
|
| 357 |
+
<td>9.51</td>
|
| 358 |
+
</tr>
|
| 359 |
+
<tr>
|
| 360 |
+
<td>HunyuanOCR</td>
|
| 361 |
+
<td>0.9B</td>
|
| 362 |
+
<td>0.042</td>
|
| 363 |
+
<td>-</td>
|
| 364 |
+
<td>-</td>
|
| 365 |
+
</tr>
|
| 366 |
+
<tr>
|
| 367 |
+
<td>PaddleOCR-VL1.5</td>
|
| 368 |
+
<td>0.9B</td>
|
| 369 |
+
<td>0.035</td>
|
| 370 |
+
<td>0.042</td>
|
| 371 |
+
<td>-</td>
|
| 372 |
+
</tr>
|
| 373 |
+
<tr>
|
| 374 |
+
<td>GLMOCR</td>
|
| 375 |
+
<td>0.9B</td>
|
| 376 |
+
<td>0.04</td>
|
| 377 |
+
<td>0.043</td>
|
| 378 |
+
<td>-</td>
|
| 379 |
+
</tr>
|
| 380 |
+
<tr>
|
| 381 |
+
<td>dots.ocr</td>
|
| 382 |
+
<td>3B</td>
|
| 383 |
+
<td>0.048</td>
|
| 384 |
+
<td>0.053</td>
|
| 385 |
+
<td>9.29</td>
|
| 386 |
+
</tr>
|
| 387 |
+
<tr>
|
| 388 |
+
<td><u><strong>dots.ocr-1.5</strong></u></td>
|
| 389 |
+
<td>3B</td>
|
| 390 |
+
<td><strong>0.031</strong></td>
|
| 391 |
+
<td><strong>0.029</strong></td>
|
| 392 |
+
<td>9.54</td>
|
| 393 |
+
</tr>
|
| 394 |
+
</tbody>
|
| 395 |
+
</table>
|
| 396 |
+
|
| 397 |
+
> **Note:**
|
| 398 |
+
> - Metrics are sourced from [OmniDocBench](https://github.com/opendatalab/OmniDocBench) and other model publications. [pdf-parse-bench](https://github.com/phorn1/pdf-parse-bench) results are reproduced by Qwen3-VL-235B-A22B-Instruct.
|
| 399 |
+
> - Formula and Table metrics for OmniDocBench1.5 are omitted due to their high sensitivity to detection and matching protocols.
|
| 400 |
+
|
| 401 |
+
|
| 402 |
+
### 2. Vision-Language Parsing
|
| 403 |
+
Visual languages (e.g., charts, graphics, chemical formulas, logos) encapsulate dense human knowledge. **dots.ocr-1.5** unifies the interpretation of these elements by parsing them directly into **SVG code**.
|
| 404 |
+
|
| 405 |
+
<table>
|
| 406 |
+
<thead>
|
| 407 |
+
<tr>
|
| 408 |
+
<th rowspan="2" style="text-align: left;">Methods</th>
|
| 409 |
+
<th colspan="3">Unisvg</th>
|
| 410 |
+
<th rowspan="2">Chartmimic</th>
|
| 411 |
+
<th rowspan="2">Design2Code</th>
|
| 412 |
+
<th rowspan="2">Genexam</th>
|
| 413 |
+
<th rowspan="2">SciGen</th>
|
| 414 |
+
<th rowspan="2">ChemDraw</th>
|
| 415 |
+
</tr>
|
| 416 |
+
<tr>
|
| 417 |
+
<th>Low-Level</th>
|
| 418 |
+
<th>High-Level</th>
|
| 419 |
+
<th>Score</th>
|
| 420 |
+
</tr>
|
| 421 |
+
</thead>
|
| 422 |
+
<tbody>
|
| 423 |
+
<tr>
|
| 424 |
+
<td style="text-align: left;">OCRVerse</td>
|
| 425 |
+
<td>0.632</td>
|
| 426 |
+
<td>0.852</td>
|
| 427 |
+
<td>0.763</td>
|
| 428 |
+
<td>0.799</td>
|
| 429 |
+
<td>-</td>
|
| 430 |
+
<td>-</td>
|
| 431 |
+
<td>-</td>
|
| 432 |
+
<td>0.881</td>
|
| 433 |
+
</tr>
|
| 434 |
+
<tr>
|
| 435 |
+
<td style="text-align: left;">Gemini 3 Pro</td>
|
| 436 |
+
<td>0.563</td>
|
| 437 |
+
<td>0.850</td>
|
| 438 |
+
<td>0.735</td>
|
| 439 |
+
<td>0.788</td>
|
| 440 |
+
<td>0.760</td>
|
| 441 |
+
<td>0.756</td>
|
| 442 |
+
<td>0.783</td>
|
| 443 |
+
<td>0.839</td>
|
| 444 |
+
</tr>
|
| 445 |
+
<tr>
|
| 446 |
+
<td style="text-align: left;">dots.ocr-1.5</td>
|
| 447 |
+
<td>0.850</td>
|
| 448 |
+
<td>0.923</td>
|
| 449 |
+
<td>0.894</td>
|
| 450 |
+
<td>0.772</td>
|
| 451 |
+
<td>0.801</td>
|
| 452 |
+
<td>0.664</td>
|
| 453 |
+
<td>0.660</td>
|
| 454 |
+
<td>0.790</td>
|
| 455 |
+
</tr>
|
| 456 |
+
<tr>
|
| 457 |
+
<td style="text-align: left;"><strong>dots.ocr-1.5-svg</strong></td>
|
| 458 |
+
<td><strong>0.860</strong></td>
|
| 459 |
+
<td><strong>0.931</strong></td>
|
| 460 |
+
<td><strong>0.902</strong></td>
|
| 461 |
+
<td><strong>0.905</strong></td>
|
| 462 |
+
<td><strong>0.834</strong></td>
|
| 463 |
+
<td><strong>0.8</strong></td>
|
| 464 |
+
<td><strong>0.797</strong></td>
|
| 465 |
+
<td><strong>0.901</strong></td>
|
| 466 |
+
</tr>
|
| 467 |
+
</tbody>
|
| 468 |
+
</table>
|
| 469 |
+
|
| 470 |
+
|
| 471 |
+
> **Note:**
|
| 472 |
+
> - We use the ISVGEN metric from [UniSVG](https://ryanlijinke.github.io/) to evaluate the parsing result. For benchmarks that do not natively support image parsing, we use the original images as input, and calculate the ISVGEN score between the rendered output and the original image.
|
| 473 |
+
> - [OCRVerse](https://github.com/DocTron-hub/OCRVerse) results are derived from various code formats (e.g., SVG, Python), whereas results for Gemini 3 Pro and dots.ocr-1.5 are based specifically on SVG code.
|
| 474 |
+
> - Due to the capacity constraints of a 3B-parameter VLM, dots.ocr-1.5 may not excel in all tasks yet like svg. To complement this, we are simultaneously releasing dots.ocr-1.5-svg. We plan to further address these limitations in future updates.
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
### 3. General Vision Tasks
|
| 478 |
+
|
| 479 |
+
<table>
|
| 480 |
+
<thead>
|
| 481 |
+
<tr>
|
| 482 |
+
<th>Model</th>
|
| 483 |
+
<th>CharXiv_descriptive</th>
|
| 484 |
+
<th>CharXiv_reasoning</th>
|
| 485 |
+
<th>OCR_Reasoning</th>
|
| 486 |
+
<th>infovqa</th>
|
| 487 |
+
<th>docvqa</th>
|
| 488 |
+
<th>ChartQA</th>
|
| 489 |
+
<th>OCRBench</th>
|
| 490 |
+
<th>AI2D</th>
|
| 491 |
+
<th>CountBenchQA</th>
|
| 492 |
+
<th>refcoco</th>
|
| 493 |
+
</tr>
|
| 494 |
+
</thead>
|
| 495 |
+
<tbody>
|
| 496 |
+
<tr>
|
| 497 |
+
<td>Qwen3vl-2b-instruct</td>
|
| 498 |
+
<td>62.3</td>
|
| 499 |
+
<td>26.8</td>
|
| 500 |
+
<td>-</td>
|
| 501 |
+
<td>72.4</td>
|
| 502 |
+
<td>93.3</td>
|
| 503 |
+
<td>-</td>
|
| 504 |
+
<td>85.8</td>
|
| 505 |
+
<td>76.9</td>
|
| 506 |
+
<td>88.4</td>
|
| 507 |
+
<td>-</td>
|
| 508 |
+
</tr>
|
| 509 |
+
<tr>
|
| 510 |
+
<td><strong>dots.ocr-1.5</strong></td>
|
| 511 |
+
<td>77.4</td>
|
| 512 |
+
<td>55.3</td>
|
| 513 |
+
<td>22.85</td>
|
| 514 |
+
<td>73.76</td>
|
| 515 |
+
<td>91.85</td>
|
| 516 |
+
<td>83.2</td>
|
| 517 |
+
<td>86.0</td>
|
| 518 |
+
<td>82.16</td>
|
| 519 |
+
<td>94.46</td>
|
| 520 |
+
<td>80.03</td>
|
| 521 |
+
</tr>
|
| 522 |
+
</tbody>
|
| 523 |
+
</table>
|
| 524 |
+
|
| 525 |
+
|
| 526 |
+
|
| 527 |
+
# Quick Start
|
| 528 |
+
## 1. Installation
|
| 529 |
+
### Install dots.ocr-1.5
|
| 530 |
+
```shell
|
| 531 |
+
conda create -n dots_ocr python=3.12
|
| 532 |
+
conda activate dots_ocr
|
| 533 |
+
|
| 534 |
+
git clone https://github.com/rednote-hilab/dots.ocr.git
|
| 535 |
+
cd dots.ocr
|
| 536 |
+
|
| 537 |
+
# Install pytorch, see https://pytorch.org/get-started/previous-versions/ for your cuda version
|
| 538 |
+
pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu128
|
| 539 |
+
pip install -e .
|
| 540 |
+
```
|
| 541 |
+
|
| 542 |
+
If you have trouble with the installation, try our [Docker Image](https://hub.docker.com/r/rednotehilab/dots.ocr) for an easier setup, and follow these steps:
|
| 543 |
+
```shell
|
| 544 |
+
git clone https://github.com/rednote-hilab/dots.ocr.git
|
| 545 |
+
cd dots.ocr
|
| 546 |
+
pip install -e .
|
| 547 |
+
```
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
### Download Model Weights
|
| 551 |
+
> 💡**Note:** Please use a directory name without periods (e.g., `DotsOCR_1_5` instead of `dots.ocr-1.5`) for the model save path. This is a temporary workaround pending our integration with Transformers.
|
| 552 |
+
```shell
|
| 553 |
+
python3 tools/download_model.py
|
| 554 |
+
```
|
| 555 |
+
|
| 556 |
+
|
| 557 |
+
## 2. Deployment
|
| 558 |
+
### vLLM inference
|
| 559 |
+
We highly recommend using vllm for deployment and inference.
|
| 560 |
+
|
| 561 |
+
```shell
|
| 562 |
+
# launch vllm server
|
| 563 |
+
## dots.ocr-1.5
|
| 564 |
+
CUDA_VISIBLE_DEVICES=0 vllm serve rednote-hilab/dots.ocr-1.5 --tensor-parallel-size 1 --gpu-memory-utilization 0.9 --chat-template-content-format string --served-model-name model --trust-remote-code
|
| 565 |
+
|
| 566 |
+
## dots.ocr-1.5-svg
|
| 567 |
+
CUDA_VISIBLE_DEVICES=0 vllm serve rednote-hilab/dots.ocr-1.5-svg --tensor-parallel-size 1 --gpu-memory-utilization 0.9 --chat-template-content-format string --served-model-name model --trust-remote-code
|
| 568 |
+
|
| 569 |
+
# vllm api demo
|
| 570 |
+
## document parsing
|
| 571 |
+
python3 ./demo/demo_vllm.py --prompt_mode prompt_layout_all_en
|
| 572 |
+
## web parsing
|
| 573 |
+
python3 ./demo/demo_vllm.py --prompt_mode prompt_web_parsing --image_path ./assets/showcase_dots_ocr_1_5/origin/webpage_1.png
|
| 574 |
+
## scene spoting
|
| 575 |
+
python3 ./demo/demo_vllm.py --prompt_mode prompt_scene_spotting --image_path ./assets/showcase_dots_ocr_1_5/origin/scene_1.jpg
|
| 576 |
+
## image parsing with svg code
|
| 577 |
+
python3 ./demo/demo_vllm_svg.py --prompt_mode prompt_image_to_svg
|
| 578 |
+
## general qa
|
| 579 |
+
python3 ./demo/demo_vllm_general.py
|
| 580 |
+
```
|
| 581 |
+
|
| 582 |
+
### Hugginface inference
|
| 583 |
+
```shell
|
| 584 |
+
python3 demo/demo_hf.py
|
| 585 |
+
```
|
| 586 |
+
|
| 587 |
+
<details>
|
| 588 |
+
<summary><b>Hugginface inference details</b></summary>
|
| 589 |
+
|
| 590 |
+
```python
|
| 591 |
+
import torch
|
| 592 |
+
from transformers import AutoModelForCausalLM, AutoProcessor, AutoTokenizer
|
| 593 |
+
from qwen_vl_utils import process_vision_info
|
| 594 |
+
from dots_ocr.utils import dict_promptmode_to_prompt
|
| 595 |
+
|
| 596 |
+
model_path = "./weights/DotsOCR_1_5"
|
| 597 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 598 |
+
model_path,
|
| 599 |
+
attn_implementation="flash_attention_2",
|
| 600 |
+
torch_dtype=torch.bfloat16,
|
| 601 |
+
device_map="auto",
|
| 602 |
+
trust_remote_code=True
|
| 603 |
+
)
|
| 604 |
+
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
|
| 605 |
+
|
| 606 |
+
image_path = "demo/demo_image1.jpg"
|
| 607 |
+
prompt = """Please output the layout information from the PDF image, including each layout element's bbox, its category, and the corresponding text content within the bbox.
|
| 608 |
+
|
| 609 |
+
1. Bbox format: [x1, y1, x2, y2]
|
| 610 |
+
|
| 611 |
+
2. Layout Categories: The possible categories are ['Caption', 'Footnote', 'Formula', 'List-item', 'Page-footer', 'Page-header', 'Picture', 'Section-header', 'Table', 'Text', 'Title'].
|
| 612 |
+
|
| 613 |
+
3. Text Extraction & Formatting Rules:
|
| 614 |
+
- Picture: For the 'Picture' category, the text field should be omitted.
|
| 615 |
+
- Formula: Format its text as LaTeX.
|
| 616 |
+
- Table: Format its text as HTML.
|
| 617 |
+
- All Others (Text, Title, etc.): Format their text as Markdown.
|
| 618 |
+
|
| 619 |
+
4. Constraints:
|
| 620 |
+
- The output text must be the original text from the image, with no translation.
|
| 621 |
+
- All layout elements must be sorted according to human reading order.
|
| 622 |
+
|
| 623 |
+
5. Final Output: The entire output must be a single JSON object.
|
| 624 |
+
"""
|
| 625 |
+
|
| 626 |
+
messages = [
|
| 627 |
+
{
|
| 628 |
+
"role": "user",
|
| 629 |
+
"content": [
|
| 630 |
+
{
|
| 631 |
+
"type": "image",
|
| 632 |
+
"image": image_path
|
| 633 |
+
},
|
| 634 |
+
{"type": "text", "text": prompt}
|
| 635 |
+
]
|
| 636 |
+
}
|
| 637 |
+
]
|
| 638 |
+
|
| 639 |
+
# Preparation for inference
|
| 640 |
+
text = processor.apply_chat_template(
|
| 641 |
+
messages,
|
| 642 |
+
tokenize=False,
|
| 643 |
+
add_generation_prompt=True
|
| 644 |
+
)
|
| 645 |
+
image_inputs, video_inputs = process_vision_info(messages)
|
| 646 |
+
inputs = processor(
|
| 647 |
+
text=[text],
|
| 648 |
+
images=image_inputs,
|
| 649 |
+
videos=video_inputs,
|
| 650 |
+
padding=True,
|
| 651 |
+
return_tensors="pt",
|
| 652 |
+
)
|
| 653 |
+
|
| 654 |
+
inputs = inputs.to("cuda")
|
| 655 |
+
|
| 656 |
+
# Inference: Generation of the output
|
| 657 |
+
generated_ids = model.generate(**inputs, max_new_tokens=24000)
|
| 658 |
+
generated_ids_trimmed = [
|
| 659 |
+
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
| 660 |
+
]
|
| 661 |
+
output_text = processor.batch_decode(
|
| 662 |
+
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
| 663 |
+
)
|
| 664 |
+
print(output_text)
|
| 665 |
+
|
| 666 |
+
```
|
| 667 |
+
|
| 668 |
+
</details>
|
| 669 |
+
|
| 670 |
+
## 3. Document Parse
|
| 671 |
+
**Based on vLLM server**, you can parse an image or a pdf file using the following commands:
|
| 672 |
+
```bash
|
| 673 |
+
|
| 674 |
+
# Parse all layout info, both detection and recognition
|
| 675 |
+
# Parse a single image
|
| 676 |
+
python3 dots_ocr/parser.py demo/demo_image1.jpg
|
| 677 |
+
# Parse a single PDF
|
| 678 |
+
python3 dots_ocr/parser.py demo/demo_pdf1.pdf --num_thread 64 # try bigger num_threads for pdf with a large number of pages
|
| 679 |
+
|
| 680 |
+
# Layout detection only
|
| 681 |
+
python3 dots_ocr/parser.py demo/demo_image1.jpg --prompt prompt_layout_only_en
|
| 682 |
+
|
| 683 |
+
# Parse text only, except Page-header and Page-footer
|
| 684 |
+
python3 dots_ocr/parser.py demo/demo_image1.jpg --prompt prompt_ocr
|
| 685 |
+
|
| 686 |
+
|
| 687 |
+
```
|
| 688 |
+
|
| 689 |
+
<details>
|
| 690 |
+
<summary><b>Output Results</b></summary>
|
| 691 |
+
|
| 692 |
+
1. **Structured Layout Data** (`demo_image1.json`): A JSON file containing the detected layout elements, including their bounding boxes, categories, and extracted text.
|
| 693 |
+
2. **Processed Markdown File** (`demo_image1.md`): A Markdown file generated from the concatenated text of all detected cells.
|
| 694 |
+
* An additional version, `demo_image1_nohf.md`, is also provided, which excludes page headers and footers for compatibility with benchmarks like Omnidocbench and olmOCR-bench.
|
| 695 |
+
3. **Layout Visualization** (`demo_image1.jpg`): The original image with the detected layout bounding boxes drawn on it.
|
| 696 |
+
|
| 697 |
+
</details>
|
| 698 |
+
|
| 699 |
+
## 4. Demo
|
| 700 |
+
Have fun with the [live demo](https://dotsocr.xiaohongshu.com/).
|
| 701 |
+
|
| 702 |
+
|
| 703 |
+
### Examples for document parsing
|
| 704 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/formula1.png" alt="formula1.png" border="0" />
|
| 705 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/table3.png" alt="table3.png" border="0" />
|
| 706 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/Tibetan.png" alt="Tibetan.png" border="0" />
|
| 707 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/tradition_zh.png" alt="tradition_zh.png" border="0" />
|
| 708 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/nl.png" alt="nl.png" border="0" />
|
| 709 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/kannada.png" alt="kannada.png" border="0" />
|
| 710 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase/russian.png" alt="russian.png" border="0" />
|
| 711 |
+
|
| 712 |
+
|
| 713 |
+
### Examples for image parsing
|
| 714 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/svg_1.png" alt="svg_1.png" border="0" />
|
| 715 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/svg_2.png" alt="svg_2.png" border="0" />
|
| 716 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/svg_4.png" alt="svg_4.png" border="0" />
|
| 717 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/svg_5.png" alt="svg_5.png" border="0" />
|
| 718 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/svg_6.png" alt="svg_6.png" border="0" />
|
| 719 |
+
|
| 720 |
+
> **Note:**
|
| 721 |
+
> - Inferenced by dots.ocr-1.5-svg
|
| 722 |
+
|
| 723 |
+
### Example for web parsing
|
| 724 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/webpage_1.png" alt="webpage_1.png" border="0" />
|
| 725 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/webpage_2.png" alt="webpage_2.png" border="0" />
|
| 726 |
+
|
| 727 |
+
### Examples for scene spotting
|
| 728 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/scene_1.png" alt="scene_1.png" border="0" />
|
| 729 |
+
<img src="https://raw.githubusercontent.com/rednote-hilab/dots.ocr/master/assets/showcase_dots_ocr_1_5/result/scene_2.png" alt="scene_2.png" border="0" />
|
| 730 |
+
|
| 731 |
+
|
| 732 |
+
## Limitation & Future Work
|
| 733 |
+
|
| 734 |
+
- **Complex Document Elements:**
|
| 735 |
+
- **Table&Formula**: The extraction of complex tables and mathematical formulas persists as a difficult task given the model's compact architecture.
|
| 736 |
+
- **Picture**: We have adopted an SVG code representation for parsing structured graphics; however, the performance has yet to achieve the desired level of robustness.
|
| 737 |
+
|
| 738 |
+
- **Parsing Failures:** While we have reduced the rate of parsing failures compared to the previous version, these issues may still occur occasionally. We remain committed to further resolving these edge cases in future updates.
|
chat_template.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"chat_template": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{%- for m in messages %}{%- if m.role == 'system' %}{{- '<|system|>' + m.content + '<|endofsystem|>\n' }}{%- elif m.role == 'user' %}{% if m.content is string %}{{- '<|user|>' + m.content + '<|endofuser|>' }}{% else %} {% for content in m.content %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|img|><|imgpad|><|endofimg|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|img|><|video_pad|><|endofimg|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}{%- endif %}{%- elif m.role == 'assistant' %}{{- '<|assistant|>' + m.content }}{%- if not loop.last %}{{- '<|endofassistant|>' }}{%- endif %}{%- endif %}{%- endfor %}{%- if messages[-1].role != 'assistant' %}{{- '<|assistant|>' }}{%- endif %}"
|
| 3 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DotsOCRForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "dots_ocr",
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_dots.DotsOCRConfig",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_dots_ocr.DotsOCRForCausalLM"
|
| 9 |
+
},
|
| 10 |
+
"attention_bias": true,
|
| 11 |
+
"attention_dropout": 0.0,
|
| 12 |
+
"hidden_act": "silu",
|
| 13 |
+
"hidden_size": 1536,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 8960,
|
| 16 |
+
"max_position_embeddings": 131072,
|
| 17 |
+
"max_window_layers": 28,
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 28,
|
| 20 |
+
"num_key_value_heads": 2,
|
| 21 |
+
"rms_norm_eps": 1e-06,
|
| 22 |
+
"rope_scaling": null,
|
| 23 |
+
"rope_theta": 1000000,
|
| 24 |
+
"sliding_window": 131072,
|
| 25 |
+
"tie_word_embeddings": false,
|
| 26 |
+
"torch_dtype": "bfloat16",
|
| 27 |
+
"transformers_version": "4.51.0",
|
| 28 |
+
"use_cache": true,
|
| 29 |
+
"use_sliding_window": false,
|
| 30 |
+
"vocab_size": 151936,
|
| 31 |
+
"image_token_id": 151665,
|
| 32 |
+
"video_token_id": 151656,
|
| 33 |
+
"vision_config": {
|
| 34 |
+
"embed_dim": 1536,
|
| 35 |
+
"hidden_size": 1536,
|
| 36 |
+
"intermediate_size": 4224,
|
| 37 |
+
"num_hidden_layers": 42,
|
| 38 |
+
"num_attention_heads": 12,
|
| 39 |
+
"num_channels": 3,
|
| 40 |
+
"patch_size": 14,
|
| 41 |
+
"post_norm": true,
|
| 42 |
+
"rms_norm_eps": 1e-05,
|
| 43 |
+
"spatial_merge_size": 2,
|
| 44 |
+
"temporal_patch_size": 1,
|
| 45 |
+
"use_bias": false,
|
| 46 |
+
"attn_implementation": "flash_attention_2",
|
| 47 |
+
"init_merger_std": 0.02,
|
| 48 |
+
"initializer_range": 0.02,
|
| 49 |
+
"is_causal": false
|
| 50 |
+
}
|
| 51 |
+
}
|
configuration.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"framework": "pytorch", "task": "image-text-to-text", "allow_remote": true}
|
configuration_dots.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Optional
|
| 2 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 3 |
+
from transformers.models.qwen2 import Qwen2Config
|
| 4 |
+
from transformers import Qwen2_5_VLProcessor, AutoProcessor
|
| 5 |
+
from transformers.models.auto.configuration_auto import CONFIG_MAPPING
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class DotsVisionConfig(PretrainedConfig):
|
| 9 |
+
model_type: str = "dots_vit"
|
| 10 |
+
|
| 11 |
+
def __init__(
|
| 12 |
+
self,
|
| 13 |
+
embed_dim: int = 1536, # vision encoder embed size
|
| 14 |
+
hidden_size: int = 1536, # after merger hidden size
|
| 15 |
+
intermediate_size: int = 4224,
|
| 16 |
+
num_hidden_layers: int = 42,
|
| 17 |
+
num_attention_heads: int = 12,
|
| 18 |
+
num_channels: int = 3,
|
| 19 |
+
patch_size: int = 14,
|
| 20 |
+
spatial_merge_size: int = 2,
|
| 21 |
+
temporal_patch_size: int = 1,
|
| 22 |
+
rms_norm_eps: float = 1e-5,
|
| 23 |
+
use_bias: bool = False,
|
| 24 |
+
attn_implementation="flash_attention_2", # "eager","sdpa","flash_attention_2"
|
| 25 |
+
initializer_range=0.02,
|
| 26 |
+
init_merger_std=0.02,
|
| 27 |
+
is_causal=False, # ve causal forward
|
| 28 |
+
post_norm=True,
|
| 29 |
+
gradient_checkpointing=False,
|
| 30 |
+
**kwargs: Any,
|
| 31 |
+
):
|
| 32 |
+
super().__init__(**kwargs)
|
| 33 |
+
self.embed_dim = embed_dim
|
| 34 |
+
self.hidden_size = hidden_size
|
| 35 |
+
self.intermediate_size = intermediate_size
|
| 36 |
+
self.num_hidden_layers = num_hidden_layers
|
| 37 |
+
self.num_attention_heads = num_attention_heads
|
| 38 |
+
self.num_channels = num_channels
|
| 39 |
+
self.patch_size = patch_size
|
| 40 |
+
self.spatial_merge_size = spatial_merge_size
|
| 41 |
+
self.temporal_patch_size = temporal_patch_size
|
| 42 |
+
self.rms_norm_eps = rms_norm_eps
|
| 43 |
+
self.use_bias = use_bias
|
| 44 |
+
self.attn_implementation = attn_implementation
|
| 45 |
+
self.initializer_range = initializer_range
|
| 46 |
+
self.init_merger_std = init_merger_std
|
| 47 |
+
self.is_causal = is_causal
|
| 48 |
+
self.post_norm = post_norm
|
| 49 |
+
self.gradient_checkpointing = gradient_checkpointing
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
class DotsOCRConfig(Qwen2Config):
|
| 54 |
+
model_type = "dots_ocr"
|
| 55 |
+
def __init__(self,
|
| 56 |
+
image_token_id = 151665,
|
| 57 |
+
video_token_id = 151656,
|
| 58 |
+
vision_config: Optional[dict] = None, *args, **kwargs):
|
| 59 |
+
super().__init__(*args, **kwargs)
|
| 60 |
+
self.image_token_id = image_token_id
|
| 61 |
+
self.video_token_id = video_token_id
|
| 62 |
+
self.vision_config = DotsVisionConfig(**(vision_config or {}))
|
| 63 |
+
|
| 64 |
+
def save_pretrained(self, save_directory, **kwargs):
|
| 65 |
+
self._auto_class = None
|
| 66 |
+
super().save_pretrained(save_directory, **kwargs)
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
class DotsVLProcessor(Qwen2_5_VLProcessor):
|
| 70 |
+
def __init__(self, image_processor=None, tokenizer=None, video_processor=None, chat_template=None, **kwargs):
|
| 71 |
+
super().__init__(image_processor, tokenizer, video_processor, chat_template=chat_template)
|
| 72 |
+
self.image_token = "<|imgpad|>" if not hasattr(tokenizer, "image_token") else tokenizer.image_token
|
| 73 |
+
self.image_token_id = 151665
|
| 74 |
+
self.video_token = "<|video_pad|>" if not hasattr(tokenizer, "video_token") else tokenizer.video_token
|
| 75 |
+
self.video_token_id = 151656
|
| 76 |
+
|
| 77 |
+
AutoProcessor.register("dots_ocr", DotsVLProcessor)
|
| 78 |
+
CONFIG_MAPPING.register("dots_ocr", DotsOCRConfig)
|
dots.ocr-1.5 LICENSE AGREEMENT
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dots.ocr LICENSE AGREEMENT
|
| 2 |
+
|
| 3 |
+
Effective Date: [ August 8, 2025]
|
| 4 |
+
|
| 5 |
+
Copyright Holder: [Xingyin Information Technology (Shanghai) Co., Ltd]
|
| 6 |
+
|
| 7 |
+
This License Agreement (“Agreement”) governs Your use, reproduction, modification, and distribution of dots.ocr (the "Model Materials"). This Agreement is designed to maximize the openness and use of the Model Materials while addressing the unique legal, ethical, and technical challenges posed by large language models.
|
| 8 |
+
|
| 9 |
+
WHEREAS, Licensor has developed the dots.ocr document parsing model and intends to distribute the Model Materials under an open‑source framework;
|
| 10 |
+
WHEREAS, traditional open-source licenses (e.g., the MIT License) may not fully address the complexity inherent complexities of document parsing models, namely their multiple components (code, weights, training data), potential ethical risks, data‑governance issues, and intellectual‑property and liability questions regarding AI‑generated content;
|
| 11 |
+
WHEREAS, Licensor seeks to provide a legal framework that ensures maximum access to and use of the Model Materials while clearly defining the rights, obligations, and liabilities of Licensee;
|
| 12 |
+
|
| 13 |
+
THEREFORE, the parties agree that, subject to the MIT License, they shall be bound by the following terms and conditions:
|
| 14 |
+
|
| 15 |
+
1. Definitions and Interpretation
|
| 16 |
+
Purpose: To define key terms used in this Agreement, particularly "Model Materials," ensuring clarity of the license scope beyond traditional software code. To clarify the order of precedence between this Agreement and the MIT License to avoid conflict.
|
| 17 |
+
|
| 18 |
+
1.1 “Licensor” shall mean the entity providing the Model Materials under this Agreement, namely [Xingyin Information Technology (Shanghai) Co., Ltd].
|
| 19 |
+
|
| 20 |
+
1.2 “Licensee” or "You" shall mean any individual or entity exercising permissions granted by this Agreement.
|
| 21 |
+
|
| 22 |
+
1.3 “Model Materials” shall mean all materials provided by Licensor under this Agreement, including but not limited to:
|
| 23 |
+
(a) one or more machine‑learning models, including architecture and trained parameters (i.e., model weights);
|
| 24 |
+
(b) all associated preprocessing, training, inference, and fine‑tuning code;
|
| 25 |
+
(c) training datasets and evaluation scripts (or their detailed descriptions and access mechanisms); and
|
| 26 |
+
(d) any accompanying documentation, metadata, and tools.
|
| 27 |
+
The above Model Materials shall be subject to the content published on the Licensor’s website or GitHub repository at https://github.com/rednote-hilab/dots.ocr.
|
| 28 |
+
|
| 29 |
+
1.4 “Outputs” shall mean any content generated through the use of the Model Materials, such as text, tables, code,layout information, and formulas extracted from documents.
|
| 30 |
+
|
| 31 |
+
1.5 “MIT License” shall mean The MIT Open Source License published by the Massachusetts Institute of Technology.
|
| 32 |
+
|
| 33 |
+
1.6 Priority of Agreement. In the event of any conflict or inconsistency between this Agreement and the MIT License, the terms of the MIT License shall prevail. However, if the terms of the MIT License are ambiguous or silent on a particular matter, the provisions of this Agreement shall apply and supplement the MIT License.
|
| 34 |
+
|
| 35 |
+
2. Grant of Rights and Scope of Use
|
| 36 |
+
|
| 37 |
+
Purpose: To grant broad, permissive rights to the Licensee for the Model Materials—including code, weights, data, and documentation—to ensure maximum openness and flexibility while clarifying the free use of model-generated content. Additionally, it clarifies the feasibility of transitioning from open-source to commercial‑use and the use of OpenAPI interfaces.
|
| 38 |
+
|
| 39 |
+
2.1 Grant of Copyright License. Subject to Licensee's compliance with this Agreement, Licensor hereby grants Licensee a perpetual, worldwide, non‑exclusive, no-charge, royalty‑free copyright license to use (run or test), reproduce, modify, create derivative works of, merge, publish, distribute the Model Materials; sublicense and/or sell copies of the Model Materials or any derivative works thereof; and incorporate the unmodified or modified Model Materials into proprietary products or services, including for commercial purposes, software‑as‑a‑service (SaaS) offerings, or via OpenAPI or other interfaces.
|
| 40 |
+
|
| 41 |
+
2.2 Fundamental Capabilities. The Model Materials only provide the fundamental model’s capabilities. Licensees may develop derivative AI applications or undertake task‑specific training thereon.
|
| 42 |
+
|
| 43 |
+
2.3 From Open Source to Commercial Use. The open-source release does not preclude Licensor’s commercial exploitation of the Model Materials, in whole or in part. Any such commercial use shall, at that time, be subject to license agreements between Licensor and applicable users.
|
| 44 |
+
|
| 45 |
+
2.4 API‑Service Exception. Licensees who access the Model Materials through API calls or provide model services via API interfaces(without directly distributing model weights )shall not be subject to this Agreement unless otherwise expressly agreed. Instead, such use shall be governed by the API terms of use published by Licensor (if any).
|
| 46 |
+
|
| 47 |
+
3. Acceptable Use Policy and Prohibited Uses
|
| 48 |
+
|
| 49 |
+
3.1 Responsible Use. Licensee must use the Model Materials in a responsible, ethical, and lawful manner, in compliance with all applicable laws, regulations, industry standards, and best practices.
|
| 50 |
+
|
| 51 |
+
3.2 Enterprise On‑Premises Deployment. The Licensee may deploy the Model Materials in closed‑source, on‑premises enterprise environments.
|
| 52 |
+
|
| 53 |
+
3.3 Prohibited Uses. Any breach of the prohibitions below will result in the automatic termination of all licenses granted under this Agreement. Licensee agrees not to use the Model Materials or any derivative works thereof, in connection with:
|
| 54 |
+
(a) Identification and Utilization of Illegal/Harmful Content:Includes identifying graphic/text materials used for counterfeiting certificates/invoices, perpetrating fraud, or launching cyberattacks; or processing images containing illegal content such as violence, criminal activities, disinformation, or child exploitation.
|
| 55 |
+
(b) Privacy Infringement and Discriminatory Practices:Extracting personal sensitive information (e.g., ID numbers, medical records, biometric data) or protected characteristics (e.g., race, gender) from images without legal authorization or consent, for purposes of privacy violation, automated discriminatory decision-making, or harassment.
|
| 56 |
+
(c) Copyright Restrictions:Licensees shall not use the tool for unauthorized digitization of publications/document scanning or bulk scraping of content. Any use involving publications or other copyright-protected materials must first obtain relevant permissions.
|
| 57 |
+
|
| 58 |
+
4. Intellectual Property Ownership and Contributions
|
| 59 |
+
|
| 60 |
+
4.1 Licensor's Copyright Reservation. Licensor reserves all right, title, and interest in and to the Model Materials (including the model architecture, parameters, code, and original training data), except as expressly licensed herein. The original copyright of the Model Materials belongs to the Licensor.
|
| 61 |
+
|
| 62 |
+
4.2 Patent License. Subject to the terms and conditions of this Agreement, Licensor hereby grants Licensee a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model Materials, where such license applies only to those patent claims licensable by the Lisensor that are necessarily infringed by its contribution(s).
|
| 63 |
+
If Licensee institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model Materials constitute direct or contributory patent infringement, then any patent licenses granted under this License for the Model Materials shall terminate as of the date such litigation is asserted or filed.
|
| 64 |
+
|
| 65 |
+
4.3 Outputs: The Outputs generated through the use of the Model Materials generally refer to text, tables, layouts, and other content extracted from documents or images. The extracted content itself does not generate new intellectual property rights, and all intellectual property remains with the original authors or copyright holders. The Licensee is responsible for due diligence regarding the legality of the Outputs, particularly where the content extracted by the OCR model may be substantially similar to existing copyrighted works, which could present intellectual property infringement risks. The Licensor assumes no liability for such infringements.
|
| 66 |
+
4.4 Trademarks. Nothing in this License permits Licensee to make use of Licensor’s trademarks, trade names, logos (e.g., “rednote,” “Xiaohongshu,” “dots.ocr”) or to otherwise suggest endorsement or misrepresent the relationship between the parties, unless Licensor’s prior written approval is granted.
|
| 67 |
+
|
| 68 |
+
5. Data Governance, Privacy, and Security
|
| 69 |
+
|
| 70 |
+
5.1 Data Quality and Bias. Licensee shall use training data from lawful sources and is encouraged to conduct due diligence before deploying the Model Materials and to take reasonable steps to mitigate any known biases in its training data or applications.
|
| 71 |
+
|
| 72 |
+
5.2 Privacy Protection.
|
| 73 |
+
(a) Sensitive‑Data Restrictions. It is prohibited to use the Model Materials to process,or extract infer sensitive personal data protected under specific laws (such as GDPR or HIPAA), particularly when dealing with documents containing personally identifiable information (such as ID numbers, health data, financial information, etc.), unless Licensee has obtained all necessary consents, lawful basis, or authorizations, and has implemented adequate anonymization, pseudonymization, or other privacy-enhancing technologies.
|
| 74 |
+
(b) Data Minimization and Purpose Limitation. The Licensee shall follow the principle of data minimization when using the OCR Model, processing only the user data necessary for specific, explicit, and lawful purposes. Specifically, the OCR Model should avoid processing unnecessary sensitive data and ensure compliance with applicable privacy protection laws during data handling.
|
| 75 |
+
(c) Transparency. Licensee shall provide clear and transparent privacy policies and terms of use when processing user data, particularly during document scanning and information extraction. .
|
| 76 |
+
|
| 77 |
+
5.3 Security Measures. Licensee shall implement appropriate technical and administrative safeguards to protect the Model Materials and any associated data against unauthorized access, disclosure, alteration, or destruction. Such measures may include, but are not limited to, encryption, access controls, logging, and audit trails.
|
| 78 |
+
|
| 79 |
+
5.4 Further Training. Licensee may only use user‑provided input or Outputs for training, fine-tuning, or improving other AI models if it has obtained the specific and informed consent of data subjects.
|
| 80 |
+
|
| 81 |
+
6. Disclaimer of Warranty and Limitation of Liability
|
| 82 |
+
|
| 83 |
+
6.1 “AS IS” Basis. Unless required by applicable law, the Model Materials are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. Licensee is solely responsible for determining the appropriateness of using or redistributing the Model Materials and assume any risks associated with the exercise of permissions under this License. Licensor does not provide any warranty of non-infringement but represents that no infringing code has been knowingly included.
|
| 84 |
+
|
| 85 |
+
6.2 Outputs Disclaimer. As a neutral technology, Licensor disclaims all liability for the accuracy, completeness, reliability, safety, legality, or suitability of any Outputs. The Licensee is solely responsible for verifying the accuracy and appropriateness of AI-generated content and shall provide appropriate disclosures when publishing or relying upon such content.
|
| 86 |
+
|
| 87 |
+
6.3 Limitation of Liability and Recourse. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall Licensor or contributors be liable for any claims, damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model Materials (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Licensor has been advised of the possibility of such damages. If such losses are incurred, recourse may be sought against the Licensee responsible for causing the loss.
|
| 88 |
+
|
| 89 |
+
6.4 Content‑Filtering Disclaimer. Although the Model Materials may include content‑filtering mechanisms, Licensor makes no warranties of any kind regarding the stability, quality, accuracy, completeness, or any specific outcome of Outputs. Licensee is solely responsible for reviewing, verifying, and performing quality control on Outputs and assumes all associated risks and liabilities.
|
| 90 |
+
|
| 91 |
+
7. Attribution and License Reservation
|
| 92 |
+
|
| 93 |
+
7.1 License. When distributing or redistributing the Model Materials, Licensee must give any other recipients of the Model Materials a copy of this Agreement.
|
| 94 |
+
|
| 95 |
+
7.2 Copyright and Notices. When distributing any part of the Model Materials, Licensee must retain all copyright, patent, trademark, and attribution notices included in the Model Materials.
|
| 96 |
+
|
| 97 |
+
7.3 Attribution. Licensee is encouraged to prominently display the name of Licensor and the Model Materials in any public statements, products, or services that contain the Model Materials (or any derivative works thereof), to promote transparency and community trust. If Licensee distributes modified weights or fine‑tuned models based on the Model Materials, Licensee must prominently display the following statement in the related website or documentation: “Built with dots.ocr.”
|
| 98 |
+
|
| 99 |
+
8. Governing Law and Dispute Resolution
|
| 100 |
+
|
| 101 |
+
8.1 Governing Law. This Agreement shall be governed by and construed in accordance with the laws of the People’s Republic of China, without regard to its conflict of laws principles.
|
| 102 |
+
|
| 103 |
+
8.2 Dispute Resolution. Any dispute claim, or disagreement arising out of or relating to this Agreement shall first be resolved through amicable consultation. If such consultation fails, the dispute shall be submitted to the Hangzhou Arbitration Commission for arbitration. The arbitration shall be conducted in accordance with the laws of China, and the place of arbitration shall be [Hangzhou, China]. The arbitral award shall be final and binding upon both parties.
|
| 104 |
+
|
| 105 |
+
9. Regulatory Compliance Amendments
|
| 106 |
+
In the event that any part of this Agreement becomes invalid or requires adjustment due to changes in applicable laws or regulations, Licensor reserves the right to issue a revised version of this Agreement. Licensee shall migrate to the new version within [e.g., ninety (90)] days of its release; otherwise, all rights granted under this Agreement shall automatically terminate.
|
| 107 |
+
|
| 108 |
+
10. Security Reporting
|
| 109 |
+
Licensee discovering any security vulnerability in the Model Materials may report it to Licensor via: dots-feedback@xiaohongshu.com. Licensee shall not disclose vulnerability details until Licensor issues an official remediation, unless otherwise required by law.
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_length": 32768,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151643,
|
| 5 |
+
151672,
|
| 6 |
+
151673
|
| 7 |
+
]
|
| 8 |
+
}
|
merges.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:599bab54075088774b1733fde865d5bd747cbcc7a547c5bc12610e874e26f5e3
|
| 3 |
+
size 1671839
|
model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8f4bc75340279da003609fe93f2eb02cc1a77087f5dfb6ba46c0980e1b4da81
|
| 3 |
+
size 4998547840
|
model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0101b36fe6620ba135d4bb8efbbf275fc27b4363b10b7f632c058c0955f3dc4d
|
| 3 |
+
size 1079883896
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,651 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_parameters": 3039179264,
|
| 4 |
+
"total_size": 6078358528
|
| 5 |
+
},
|
| 6 |
+
"weight_map": {
|
| 7 |
+
"lm_head.weight": "model-00002-of-00002.safetensors",
|
| 8 |
+
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
|
| 9 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 10 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 11 |
+
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 12 |
+
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 13 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 14 |
+
"model.layers.0.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 15 |
+
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 16 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 17 |
+
"model.layers.0.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 18 |
+
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 19 |
+
"model.layers.0.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 20 |
+
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 21 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 22 |
+
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 23 |
+
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 24 |
+
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 25 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 26 |
+
"model.layers.1.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 27 |
+
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 28 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 29 |
+
"model.layers.1.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 30 |
+
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 31 |
+
"model.layers.1.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 32 |
+
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 33 |
+
"model.layers.10.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 34 |
+
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 35 |
+
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 36 |
+
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 37 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 38 |
+
"model.layers.10.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 39 |
+
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 40 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 41 |
+
"model.layers.10.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 42 |
+
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 43 |
+
"model.layers.10.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 44 |
+
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 45 |
+
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 46 |
+
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 47 |
+
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 48 |
+
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 49 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 50 |
+
"model.layers.11.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 51 |
+
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 52 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 53 |
+
"model.layers.11.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
|
| 54 |
+
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 55 |
+
"model.layers.11.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
|
| 56 |
+
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 57 |
+
"model.layers.12.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 58 |
+
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 59 |
+
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 60 |
+
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 61 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 62 |
+
"model.layers.12.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 63 |
+
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 64 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 65 |
+
"model.layers.12.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 66 |
+
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
| 67 |
+
"model.layers.12.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 68 |
+
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 69 |
+
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 70 |
+
"model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 71 |
+
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 72 |
+
"model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 73 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 74 |
+
"model.layers.13.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 75 |
+
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 76 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 77 |
+
"model.layers.13.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 78 |
+
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 79 |
+
"model.layers.13.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 80 |
+
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 81 |
+
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 82 |
+
"model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 83 |
+
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 84 |
+
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 85 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 86 |
+
"model.layers.14.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 87 |
+
"model.layers.14.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 88 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 89 |
+
"model.layers.14.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 90 |
+
"model.layers.14.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 91 |
+
"model.layers.14.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 92 |
+
"model.layers.14.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 93 |
+
"model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 94 |
+
"model.layers.15.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 95 |
+
"model.layers.15.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 96 |
+
"model.layers.15.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 97 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 98 |
+
"model.layers.15.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 99 |
+
"model.layers.15.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 100 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 101 |
+
"model.layers.15.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 102 |
+
"model.layers.15.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 103 |
+
"model.layers.15.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 104 |
+
"model.layers.15.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 105 |
+
"model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 106 |
+
"model.layers.16.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 107 |
+
"model.layers.16.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 108 |
+
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 109 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 110 |
+
"model.layers.16.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 111 |
+
"model.layers.16.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 112 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 113 |
+
"model.layers.16.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 114 |
+
"model.layers.16.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 115 |
+
"model.layers.16.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 116 |
+
"model.layers.16.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 117 |
+
"model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 118 |
+
"model.layers.17.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 119 |
+
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
| 120 |
+
"model.layers.17.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 121 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 122 |
+
"model.layers.17.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 123 |
+
"model.layers.17.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 124 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 125 |
+
"model.layers.17.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 126 |
+
"model.layers.17.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 127 |
+
"model.layers.17.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
|
| 128 |
+
"model.layers.17.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 129 |
+
"model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 130 |
+
"model.layers.18.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 131 |
+
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
| 132 |
+
"model.layers.18.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 133 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 134 |
+
"model.layers.18.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
|
| 135 |
+
"model.layers.18.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 136 |
+
"model.layers.18.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 137 |
+
"model.layers.18.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 138 |
+
"model.layers.18.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 139 |
+
"model.layers.18.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 140 |
+
"model.layers.18.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 141 |
+
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 142 |
+
"model.layers.19.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 143 |
+
"model.layers.19.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 144 |
+
"model.layers.19.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 145 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 146 |
+
"model.layers.19.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 147 |
+
"model.layers.19.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 148 |
+
"model.layers.19.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 149 |
+
"model.layers.19.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 150 |
+
"model.layers.19.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 151 |
+
"model.layers.19.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
|
| 152 |
+
"model.layers.19.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 153 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 154 |
+
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 155 |
+
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 156 |
+
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 157 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 158 |
+
"model.layers.2.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 159 |
+
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 160 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
| 161 |
+
"model.layers.2.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 162 |
+
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 163 |
+
"model.layers.2.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 164 |
+
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 165 |
+
"model.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 166 |
+
"model.layers.20.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 167 |
+
"model.layers.20.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 168 |
+
"model.layers.20.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 169 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 170 |
+
"model.layers.20.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
|
| 171 |
+
"model.layers.20.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 172 |
+
"model.layers.20.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
| 173 |
+
"model.layers.20.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 174 |
+
"model.layers.20.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 175 |
+
"model.layers.20.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 176 |
+
"model.layers.20.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 177 |
+
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 178 |
+
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
| 179 |
+
"model.layers.21.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 180 |
+
"model.layers.21.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 181 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 182 |
+
"model.layers.21.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 183 |
+
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
| 184 |
+
"model.layers.21.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 185 |
+
"model.layers.21.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 186 |
+
"model.layers.21.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 187 |
+
"model.layers.21.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
|
| 188 |
+
"model.layers.21.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 189 |
+
"model.layers.22.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 190 |
+
"model.layers.22.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 191 |
+
"model.layers.22.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 192 |
+
"model.layers.22.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 193 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 194 |
+
"model.layers.22.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 195 |
+
"model.layers.22.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 196 |
+
"model.layers.22.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 197 |
+
"model.layers.22.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 198 |
+
"model.layers.22.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 199 |
+
"model.layers.22.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 200 |
+
"model.layers.22.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 201 |
+
"model.layers.23.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 202 |
+
"model.layers.23.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 203 |
+
"model.layers.23.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 204 |
+
"model.layers.23.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 205 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 206 |
+
"model.layers.23.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 207 |
+
"model.layers.23.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 208 |
+
"model.layers.23.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 209 |
+
"model.layers.23.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
|
| 210 |
+
"model.layers.23.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 211 |
+
"model.layers.23.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 212 |
+
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
| 213 |
+
"model.layers.24.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 214 |
+
"model.layers.24.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 215 |
+
"model.layers.24.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 216 |
+
"model.layers.24.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 217 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 218 |
+
"model.layers.24.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 219 |
+
"model.layers.24.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 220 |
+
"model.layers.24.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 221 |
+
"model.layers.24.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 222 |
+
"model.layers.24.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 223 |
+
"model.layers.24.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 224 |
+
"model.layers.24.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 225 |
+
"model.layers.25.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 226 |
+
"model.layers.25.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 227 |
+
"model.layers.25.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 228 |
+
"model.layers.25.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 229 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 230 |
+
"model.layers.25.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 231 |
+
"model.layers.25.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 232 |
+
"model.layers.25.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 233 |
+
"model.layers.25.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 234 |
+
"model.layers.25.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 235 |
+
"model.layers.25.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 236 |
+
"model.layers.25.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 237 |
+
"model.layers.26.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 238 |
+
"model.layers.26.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 239 |
+
"model.layers.26.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 240 |
+
"model.layers.26.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 241 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 242 |
+
"model.layers.26.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 243 |
+
"model.layers.26.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 244 |
+
"model.layers.26.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 245 |
+
"model.layers.26.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 246 |
+
"model.layers.26.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 247 |
+
"model.layers.26.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 248 |
+
"model.layers.26.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 249 |
+
"model.layers.27.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 250 |
+
"model.layers.27.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 251 |
+
"model.layers.27.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 252 |
+
"model.layers.27.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 253 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 254 |
+
"model.layers.27.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
|
| 255 |
+
"model.layers.27.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 256 |
+
"model.layers.27.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 257 |
+
"model.layers.27.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 258 |
+
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
| 259 |
+
"model.layers.27.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 260 |
+
"model.layers.27.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 261 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 262 |
+
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 263 |
+
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 264 |
+
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 265 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 266 |
+
"model.layers.3.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 267 |
+
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 268 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 269 |
+
"model.layers.3.self_attn.q_proj.bias": "model-00002-of-00002.safetensors",
|
| 270 |
+
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 271 |
+
"model.layers.3.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 272 |
+
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 273 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 274 |
+
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 275 |
+
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 276 |
+
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 277 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 278 |
+
"model.layers.4.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 279 |
+
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 280 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 281 |
+
"model.layers.4.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 282 |
+
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 283 |
+
"model.layers.4.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 284 |
+
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 285 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 286 |
+
"model.layers.5.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
| 287 |
+
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 288 |
+
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 289 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 290 |
+
"model.layers.5.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 291 |
+
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 292 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 293 |
+
"model.layers.5.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 294 |
+
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 295 |
+
"model.layers.5.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 296 |
+
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 297 |
+
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 298 |
+
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 299 |
+
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 300 |
+
"model.layers.6.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 301 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 302 |
+
"model.layers.6.self_attn.k_proj.bias": "model-00002-of-00002.safetensors",
|
| 303 |
+
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 304 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 305 |
+
"model.layers.6.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 306 |
+
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 307 |
+
"model.layers.6.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 308 |
+
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 309 |
+
"model.layers.7.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 310 |
+
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 311 |
+
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 312 |
+
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 313 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 314 |
+
"model.layers.7.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 315 |
+
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 316 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 317 |
+
"model.layers.7.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 318 |
+
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 319 |
+
"model.layers.7.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 320 |
+
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 321 |
+
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 322 |
+
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 323 |
+
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 324 |
+
"model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 325 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 326 |
+
"model.layers.8.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 327 |
+
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 328 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 329 |
+
"model.layers.8.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 330 |
+
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 331 |
+
"model.layers.8.self_attn.v_proj.bias": "model-00002-of-00002.safetensors",
|
| 332 |
+
"model.layers.8.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
| 333 |
+
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 334 |
+
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 335 |
+
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 336 |
+
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 337 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 338 |
+
"model.layers.9.self_attn.k_proj.bias": "model-00001-of-00002.safetensors",
|
| 339 |
+
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
| 340 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 341 |
+
"model.layers.9.self_attn.q_proj.bias": "model-00001-of-00002.safetensors",
|
| 342 |
+
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 343 |
+
"model.layers.9.self_attn.v_proj.bias": "model-00001-of-00002.safetensors",
|
| 344 |
+
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 345 |
+
"model.norm.weight": "model-00001-of-00002.safetensors",
|
| 346 |
+
"vision_tower.blocks.0.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 347 |
+
"vision_tower.blocks.0.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 348 |
+
"vision_tower.blocks.0.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 349 |
+
"vision_tower.blocks.0.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 350 |
+
"vision_tower.blocks.0.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 351 |
+
"vision_tower.blocks.0.norm1.weight": "model-00001-of-00002.safetensors",
|
| 352 |
+
"vision_tower.blocks.0.norm2.weight": "model-00001-of-00002.safetensors",
|
| 353 |
+
"vision_tower.blocks.1.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 354 |
+
"vision_tower.blocks.1.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 355 |
+
"vision_tower.blocks.1.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 356 |
+
"vision_tower.blocks.1.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 357 |
+
"vision_tower.blocks.1.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 358 |
+
"vision_tower.blocks.1.norm1.weight": "model-00002-of-00002.safetensors",
|
| 359 |
+
"vision_tower.blocks.1.norm2.weight": "model-00001-of-00002.safetensors",
|
| 360 |
+
"vision_tower.blocks.10.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 361 |
+
"vision_tower.blocks.10.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 362 |
+
"vision_tower.blocks.10.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 363 |
+
"vision_tower.blocks.10.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 364 |
+
"vision_tower.blocks.10.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 365 |
+
"vision_tower.blocks.10.norm1.weight": "model-00001-of-00002.safetensors",
|
| 366 |
+
"vision_tower.blocks.10.norm2.weight": "model-00001-of-00002.safetensors",
|
| 367 |
+
"vision_tower.blocks.11.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 368 |
+
"vision_tower.blocks.11.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 369 |
+
"vision_tower.blocks.11.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 370 |
+
"vision_tower.blocks.11.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 371 |
+
"vision_tower.blocks.11.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 372 |
+
"vision_tower.blocks.11.norm1.weight": "model-00002-of-00002.safetensors",
|
| 373 |
+
"vision_tower.blocks.11.norm2.weight": "model-00001-of-00002.safetensors",
|
| 374 |
+
"vision_tower.blocks.12.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 375 |
+
"vision_tower.blocks.12.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 376 |
+
"vision_tower.blocks.12.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 377 |
+
"vision_tower.blocks.12.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 378 |
+
"vision_tower.blocks.12.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 379 |
+
"vision_tower.blocks.12.norm1.weight": "model-00002-of-00002.safetensors",
|
| 380 |
+
"vision_tower.blocks.12.norm2.weight": "model-00001-of-00002.safetensors",
|
| 381 |
+
"vision_tower.blocks.13.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 382 |
+
"vision_tower.blocks.13.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 383 |
+
"vision_tower.blocks.13.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 384 |
+
"vision_tower.blocks.13.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 385 |
+
"vision_tower.blocks.13.mlp.fc3.weight": "model-00002-of-00002.safetensors",
|
| 386 |
+
"vision_tower.blocks.13.norm1.weight": "model-00001-of-00002.safetensors",
|
| 387 |
+
"vision_tower.blocks.13.norm2.weight": "model-00001-of-00002.safetensors",
|
| 388 |
+
"vision_tower.blocks.14.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 389 |
+
"vision_tower.blocks.14.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 390 |
+
"vision_tower.blocks.14.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 391 |
+
"vision_tower.blocks.14.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 392 |
+
"vision_tower.blocks.14.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 393 |
+
"vision_tower.blocks.14.norm1.weight": "model-00001-of-00002.safetensors",
|
| 394 |
+
"vision_tower.blocks.14.norm2.weight": "model-00001-of-00002.safetensors",
|
| 395 |
+
"vision_tower.blocks.15.attn.proj.weight": "model-00002-of-00002.safetensors",
|
| 396 |
+
"vision_tower.blocks.15.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 397 |
+
"vision_tower.blocks.15.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 398 |
+
"vision_tower.blocks.15.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 399 |
+
"vision_tower.blocks.15.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 400 |
+
"vision_tower.blocks.15.norm1.weight": "model-00002-of-00002.safetensors",
|
| 401 |
+
"vision_tower.blocks.15.norm2.weight": "model-00001-of-00002.safetensors",
|
| 402 |
+
"vision_tower.blocks.16.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 403 |
+
"vision_tower.blocks.16.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 404 |
+
"vision_tower.blocks.16.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 405 |
+
"vision_tower.blocks.16.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 406 |
+
"vision_tower.blocks.16.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 407 |
+
"vision_tower.blocks.16.norm1.weight": "model-00001-of-00002.safetensors",
|
| 408 |
+
"vision_tower.blocks.16.norm2.weight": "model-00001-of-00002.safetensors",
|
| 409 |
+
"vision_tower.blocks.17.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 410 |
+
"vision_tower.blocks.17.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 411 |
+
"vision_tower.blocks.17.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 412 |
+
"vision_tower.blocks.17.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 413 |
+
"vision_tower.blocks.17.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 414 |
+
"vision_tower.blocks.17.norm1.weight": "model-00001-of-00002.safetensors",
|
| 415 |
+
"vision_tower.blocks.17.norm2.weight": "model-00001-of-00002.safetensors",
|
| 416 |
+
"vision_tower.blocks.18.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 417 |
+
"vision_tower.blocks.18.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 418 |
+
"vision_tower.blocks.18.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 419 |
+
"vision_tower.blocks.18.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 420 |
+
"vision_tower.blocks.18.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 421 |
+
"vision_tower.blocks.18.norm1.weight": "model-00001-of-00002.safetensors",
|
| 422 |
+
"vision_tower.blocks.18.norm2.weight": "model-00001-of-00002.safetensors",
|
| 423 |
+
"vision_tower.blocks.19.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 424 |
+
"vision_tower.blocks.19.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 425 |
+
"vision_tower.blocks.19.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 426 |
+
"vision_tower.blocks.19.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 427 |
+
"vision_tower.blocks.19.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 428 |
+
"vision_tower.blocks.19.norm1.weight": "model-00001-of-00002.safetensors",
|
| 429 |
+
"vision_tower.blocks.19.norm2.weight": "model-00001-of-00002.safetensors",
|
| 430 |
+
"vision_tower.blocks.2.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 431 |
+
"vision_tower.blocks.2.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 432 |
+
"vision_tower.blocks.2.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 433 |
+
"vision_tower.blocks.2.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 434 |
+
"vision_tower.blocks.2.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 435 |
+
"vision_tower.blocks.2.norm1.weight": "model-00001-of-00002.safetensors",
|
| 436 |
+
"vision_tower.blocks.2.norm2.weight": "model-00002-of-00002.safetensors",
|
| 437 |
+
"vision_tower.blocks.20.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 438 |
+
"vision_tower.blocks.20.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 439 |
+
"vision_tower.blocks.20.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 440 |
+
"vision_tower.blocks.20.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 441 |
+
"vision_tower.blocks.20.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 442 |
+
"vision_tower.blocks.20.norm1.weight": "model-00001-of-00002.safetensors",
|
| 443 |
+
"vision_tower.blocks.20.norm2.weight": "model-00002-of-00002.safetensors",
|
| 444 |
+
"vision_tower.blocks.21.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 445 |
+
"vision_tower.blocks.21.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 446 |
+
"vision_tower.blocks.21.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 447 |
+
"vision_tower.blocks.21.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 448 |
+
"vision_tower.blocks.21.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 449 |
+
"vision_tower.blocks.21.norm1.weight": "model-00001-of-00002.safetensors",
|
| 450 |
+
"vision_tower.blocks.21.norm2.weight": "model-00001-of-00002.safetensors",
|
| 451 |
+
"vision_tower.blocks.22.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 452 |
+
"vision_tower.blocks.22.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 453 |
+
"vision_tower.blocks.22.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 454 |
+
"vision_tower.blocks.22.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 455 |
+
"vision_tower.blocks.22.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 456 |
+
"vision_tower.blocks.22.norm1.weight": "model-00001-of-00002.safetensors",
|
| 457 |
+
"vision_tower.blocks.22.norm2.weight": "model-00002-of-00002.safetensors",
|
| 458 |
+
"vision_tower.blocks.23.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 459 |
+
"vision_tower.blocks.23.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 460 |
+
"vision_tower.blocks.23.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 461 |
+
"vision_tower.blocks.23.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 462 |
+
"vision_tower.blocks.23.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 463 |
+
"vision_tower.blocks.23.norm1.weight": "model-00001-of-00002.safetensors",
|
| 464 |
+
"vision_tower.blocks.23.norm2.weight": "model-00001-of-00002.safetensors",
|
| 465 |
+
"vision_tower.blocks.24.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 466 |
+
"vision_tower.blocks.24.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 467 |
+
"vision_tower.blocks.24.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 468 |
+
"vision_tower.blocks.24.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 469 |
+
"vision_tower.blocks.24.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 470 |
+
"vision_tower.blocks.24.norm1.weight": "model-00001-of-00002.safetensors",
|
| 471 |
+
"vision_tower.blocks.24.norm2.weight": "model-00001-of-00002.safetensors",
|
| 472 |
+
"vision_tower.blocks.25.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 473 |
+
"vision_tower.blocks.25.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 474 |
+
"vision_tower.blocks.25.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 475 |
+
"vision_tower.blocks.25.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 476 |
+
"vision_tower.blocks.25.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 477 |
+
"vision_tower.blocks.25.norm1.weight": "model-00001-of-00002.safetensors",
|
| 478 |
+
"vision_tower.blocks.25.norm2.weight": "model-00002-of-00002.safetensors",
|
| 479 |
+
"vision_tower.blocks.26.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 480 |
+
"vision_tower.blocks.26.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 481 |
+
"vision_tower.blocks.26.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 482 |
+
"vision_tower.blocks.26.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 483 |
+
"vision_tower.blocks.26.mlp.fc3.weight": "model-00002-of-00002.safetensors",
|
| 484 |
+
"vision_tower.blocks.26.norm1.weight": "model-00002-of-00002.safetensors",
|
| 485 |
+
"vision_tower.blocks.26.norm2.weight": "model-00001-of-00002.safetensors",
|
| 486 |
+
"vision_tower.blocks.27.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 487 |
+
"vision_tower.blocks.27.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 488 |
+
"vision_tower.blocks.27.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 489 |
+
"vision_tower.blocks.27.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 490 |
+
"vision_tower.blocks.27.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 491 |
+
"vision_tower.blocks.27.norm1.weight": "model-00001-of-00002.safetensors",
|
| 492 |
+
"vision_tower.blocks.27.norm2.weight": "model-00001-of-00002.safetensors",
|
| 493 |
+
"vision_tower.blocks.28.attn.proj.weight": "model-00002-of-00002.safetensors",
|
| 494 |
+
"vision_tower.blocks.28.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 495 |
+
"vision_tower.blocks.28.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 496 |
+
"vision_tower.blocks.28.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 497 |
+
"vision_tower.blocks.28.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 498 |
+
"vision_tower.blocks.28.norm1.weight": "model-00002-of-00002.safetensors",
|
| 499 |
+
"vision_tower.blocks.28.norm2.weight": "model-00002-of-00002.safetensors",
|
| 500 |
+
"vision_tower.blocks.29.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 501 |
+
"vision_tower.blocks.29.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 502 |
+
"vision_tower.blocks.29.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 503 |
+
"vision_tower.blocks.29.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 504 |
+
"vision_tower.blocks.29.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 505 |
+
"vision_tower.blocks.29.norm1.weight": "model-00001-of-00002.safetensors",
|
| 506 |
+
"vision_tower.blocks.29.norm2.weight": "model-00002-of-00002.safetensors",
|
| 507 |
+
"vision_tower.blocks.3.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 508 |
+
"vision_tower.blocks.3.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 509 |
+
"vision_tower.blocks.3.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 510 |
+
"vision_tower.blocks.3.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 511 |
+
"vision_tower.blocks.3.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 512 |
+
"vision_tower.blocks.3.norm1.weight": "model-00001-of-00002.safetensors",
|
| 513 |
+
"vision_tower.blocks.3.norm2.weight": "model-00001-of-00002.safetensors",
|
| 514 |
+
"vision_tower.blocks.30.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 515 |
+
"vision_tower.blocks.30.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 516 |
+
"vision_tower.blocks.30.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 517 |
+
"vision_tower.blocks.30.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 518 |
+
"vision_tower.blocks.30.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 519 |
+
"vision_tower.blocks.30.norm1.weight": "model-00001-of-00002.safetensors",
|
| 520 |
+
"vision_tower.blocks.30.norm2.weight": "model-00001-of-00002.safetensors",
|
| 521 |
+
"vision_tower.blocks.31.attn.proj.weight": "model-00002-of-00002.safetensors",
|
| 522 |
+
"vision_tower.blocks.31.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 523 |
+
"vision_tower.blocks.31.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 524 |
+
"vision_tower.blocks.31.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 525 |
+
"vision_tower.blocks.31.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 526 |
+
"vision_tower.blocks.31.norm1.weight": "model-00001-of-00002.safetensors",
|
| 527 |
+
"vision_tower.blocks.31.norm2.weight": "model-00001-of-00002.safetensors",
|
| 528 |
+
"vision_tower.blocks.32.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 529 |
+
"vision_tower.blocks.32.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 530 |
+
"vision_tower.blocks.32.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 531 |
+
"vision_tower.blocks.32.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 532 |
+
"vision_tower.blocks.32.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 533 |
+
"vision_tower.blocks.32.norm1.weight": "model-00001-of-00002.safetensors",
|
| 534 |
+
"vision_tower.blocks.32.norm2.weight": "model-00001-of-00002.safetensors",
|
| 535 |
+
"vision_tower.blocks.33.attn.proj.weight": "model-00002-of-00002.safetensors",
|
| 536 |
+
"vision_tower.blocks.33.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 537 |
+
"vision_tower.blocks.33.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 538 |
+
"vision_tower.blocks.33.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 539 |
+
"vision_tower.blocks.33.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 540 |
+
"vision_tower.blocks.33.norm1.weight": "model-00001-of-00002.safetensors",
|
| 541 |
+
"vision_tower.blocks.33.norm2.weight": "model-00001-of-00002.safetensors",
|
| 542 |
+
"vision_tower.blocks.34.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 543 |
+
"vision_tower.blocks.34.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 544 |
+
"vision_tower.blocks.34.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 545 |
+
"vision_tower.blocks.34.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 546 |
+
"vision_tower.blocks.34.mlp.fc3.weight": "model-00002-of-00002.safetensors",
|
| 547 |
+
"vision_tower.blocks.34.norm1.weight": "model-00002-of-00002.safetensors",
|
| 548 |
+
"vision_tower.blocks.34.norm2.weight": "model-00001-of-00002.safetensors",
|
| 549 |
+
"vision_tower.blocks.35.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 550 |
+
"vision_tower.blocks.35.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 551 |
+
"vision_tower.blocks.35.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 552 |
+
"vision_tower.blocks.35.mlp.fc2.weight": "model-00002-of-00002.safetensors",
|
| 553 |
+
"vision_tower.blocks.35.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 554 |
+
"vision_tower.blocks.35.norm1.weight": "model-00001-of-00002.safetensors",
|
| 555 |
+
"vision_tower.blocks.35.norm2.weight": "model-00001-of-00002.safetensors",
|
| 556 |
+
"vision_tower.blocks.36.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 557 |
+
"vision_tower.blocks.36.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 558 |
+
"vision_tower.blocks.36.mlp.fc1.weight": "model-00002-of-00002.safetensors",
|
| 559 |
+
"vision_tower.blocks.36.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 560 |
+
"vision_tower.blocks.36.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 561 |
+
"vision_tower.blocks.36.norm1.weight": "model-00001-of-00002.safetensors",
|
| 562 |
+
"vision_tower.blocks.36.norm2.weight": "model-00001-of-00002.safetensors",
|
| 563 |
+
"vision_tower.blocks.37.attn.proj.weight": "model-00002-of-00002.safetensors",
|
| 564 |
+
"vision_tower.blocks.37.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 565 |
+
"vision_tower.blocks.37.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 566 |
+
"vision_tower.blocks.37.mlp.fc2.weight": "model-00002-of-00002.safetensors",
|
| 567 |
+
"vision_tower.blocks.37.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 568 |
+
"vision_tower.blocks.37.norm1.weight": "model-00001-of-00002.safetensors",
|
| 569 |
+
"vision_tower.blocks.37.norm2.weight": "model-00001-of-00002.safetensors",
|
| 570 |
+
"vision_tower.blocks.38.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 571 |
+
"vision_tower.blocks.38.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 572 |
+
"vision_tower.blocks.38.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 573 |
+
"vision_tower.blocks.38.mlp.fc2.weight": "model-00002-of-00002.safetensors",
|
| 574 |
+
"vision_tower.blocks.38.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 575 |
+
"vision_tower.blocks.38.norm1.weight": "model-00001-of-00002.safetensors",
|
| 576 |
+
"vision_tower.blocks.38.norm2.weight": "model-00002-of-00002.safetensors",
|
| 577 |
+
"vision_tower.blocks.39.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 578 |
+
"vision_tower.blocks.39.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 579 |
+
"vision_tower.blocks.39.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 580 |
+
"vision_tower.blocks.39.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 581 |
+
"vision_tower.blocks.39.mlp.fc3.weight": "model-00002-of-00002.safetensors",
|
| 582 |
+
"vision_tower.blocks.39.norm1.weight": "model-00002-of-00002.safetensors",
|
| 583 |
+
"vision_tower.blocks.39.norm2.weight": "model-00001-of-00002.safetensors",
|
| 584 |
+
"vision_tower.blocks.4.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 585 |
+
"vision_tower.blocks.4.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 586 |
+
"vision_tower.blocks.4.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 587 |
+
"vision_tower.blocks.4.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 588 |
+
"vision_tower.blocks.4.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 589 |
+
"vision_tower.blocks.4.norm1.weight": "model-00001-of-00002.safetensors",
|
| 590 |
+
"vision_tower.blocks.4.norm2.weight": "model-00002-of-00002.safetensors",
|
| 591 |
+
"vision_tower.blocks.40.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 592 |
+
"vision_tower.blocks.40.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 593 |
+
"vision_tower.blocks.40.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 594 |
+
"vision_tower.blocks.40.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 595 |
+
"vision_tower.blocks.40.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 596 |
+
"vision_tower.blocks.40.norm1.weight": "model-00001-of-00002.safetensors",
|
| 597 |
+
"vision_tower.blocks.40.norm2.weight": "model-00001-of-00002.safetensors",
|
| 598 |
+
"vision_tower.blocks.41.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 599 |
+
"vision_tower.blocks.41.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 600 |
+
"vision_tower.blocks.41.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 601 |
+
"vision_tower.blocks.41.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 602 |
+
"vision_tower.blocks.41.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 603 |
+
"vision_tower.blocks.41.norm1.weight": "model-00001-of-00002.safetensors",
|
| 604 |
+
"vision_tower.blocks.41.norm2.weight": "model-00002-of-00002.safetensors",
|
| 605 |
+
"vision_tower.blocks.5.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 606 |
+
"vision_tower.blocks.5.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 607 |
+
"vision_tower.blocks.5.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 608 |
+
"vision_tower.blocks.5.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 609 |
+
"vision_tower.blocks.5.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 610 |
+
"vision_tower.blocks.5.norm1.weight": "model-00002-of-00002.safetensors",
|
| 611 |
+
"vision_tower.blocks.5.norm2.weight": "model-00001-of-00002.safetensors",
|
| 612 |
+
"vision_tower.blocks.6.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 613 |
+
"vision_tower.blocks.6.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 614 |
+
"vision_tower.blocks.6.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 615 |
+
"vision_tower.blocks.6.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 616 |
+
"vision_tower.blocks.6.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 617 |
+
"vision_tower.blocks.6.norm1.weight": "model-00002-of-00002.safetensors",
|
| 618 |
+
"vision_tower.blocks.6.norm2.weight": "model-00001-of-00002.safetensors",
|
| 619 |
+
"vision_tower.blocks.7.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 620 |
+
"vision_tower.blocks.7.attn.qkv.weight": "model-00002-of-00002.safetensors",
|
| 621 |
+
"vision_tower.blocks.7.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 622 |
+
"vision_tower.blocks.7.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 623 |
+
"vision_tower.blocks.7.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 624 |
+
"vision_tower.blocks.7.norm1.weight": "model-00001-of-00002.safetensors",
|
| 625 |
+
"vision_tower.blocks.7.norm2.weight": "model-00001-of-00002.safetensors",
|
| 626 |
+
"vision_tower.blocks.8.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 627 |
+
"vision_tower.blocks.8.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 628 |
+
"vision_tower.blocks.8.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 629 |
+
"vision_tower.blocks.8.mlp.fc2.weight": "model-00002-of-00002.safetensors",
|
| 630 |
+
"vision_tower.blocks.8.mlp.fc3.weight": "model-00002-of-00002.safetensors",
|
| 631 |
+
"vision_tower.blocks.8.norm1.weight": "model-00001-of-00002.safetensors",
|
| 632 |
+
"vision_tower.blocks.8.norm2.weight": "model-00001-of-00002.safetensors",
|
| 633 |
+
"vision_tower.blocks.9.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 634 |
+
"vision_tower.blocks.9.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 635 |
+
"vision_tower.blocks.9.mlp.fc1.weight": "model-00001-of-00002.safetensors",
|
| 636 |
+
"vision_tower.blocks.9.mlp.fc2.weight": "model-00001-of-00002.safetensors",
|
| 637 |
+
"vision_tower.blocks.9.mlp.fc3.weight": "model-00001-of-00002.safetensors",
|
| 638 |
+
"vision_tower.blocks.9.norm1.weight": "model-00002-of-00002.safetensors",
|
| 639 |
+
"vision_tower.blocks.9.norm2.weight": "model-00001-of-00002.safetensors",
|
| 640 |
+
"vision_tower.merger.ln_q.bias": "model-00001-of-00002.safetensors",
|
| 641 |
+
"vision_tower.merger.ln_q.weight": "model-00001-of-00002.safetensors",
|
| 642 |
+
"vision_tower.merger.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 643 |
+
"vision_tower.merger.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 644 |
+
"vision_tower.merger.mlp.2.bias": "model-00002-of-00002.safetensors",
|
| 645 |
+
"vision_tower.merger.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 646 |
+
"vision_tower.patch_embed.patchifier.norm.weight": "model-00001-of-00002.safetensors",
|
| 647 |
+
"vision_tower.patch_embed.patchifier.proj.bias": "model-00002-of-00002.safetensors",
|
| 648 |
+
"vision_tower.patch_embed.patchifier.proj.weight": "model-00001-of-00002.safetensors",
|
| 649 |
+
"vision_tower.post_trunk_norm.weight": "model-00001-of-00002.safetensors"
|
| 650 |
+
}
|
| 651 |
+
}
|
modeling_dots_ocr.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import List, Optional, Tuple, Union
|
| 2 |
+
|
| 3 |
+
import torch
|
| 4 |
+
from transformers.modeling_outputs import CausalLMOutputWithPast
|
| 5 |
+
from transformers.models.qwen2 import Qwen2ForCausalLM
|
| 6 |
+
|
| 7 |
+
from .configuration_dots import DotsVisionConfig, DotsOCRConfig
|
| 8 |
+
from .modeling_dots_vision import DotsVisionTransformer
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
DOTS_VLM_MAX_IMAGES = 200
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class DotsOCRForCausalLM(Qwen2ForCausalLM):
|
| 15 |
+
config_class = DotsOCRConfig
|
| 16 |
+
|
| 17 |
+
def __init__(self, config: DotsOCRConfig):
|
| 18 |
+
super().__init__(config)
|
| 19 |
+
|
| 20 |
+
if isinstance(self.config.vision_config, dict):
|
| 21 |
+
vision_config = DotsVisionConfig(**self.config.vision_config)
|
| 22 |
+
self.config.vision_config = vision_config
|
| 23 |
+
else:
|
| 24 |
+
vision_config = self.config.vision_config
|
| 25 |
+
|
| 26 |
+
self.vision_tower = DotsVisionTransformer(vision_config)
|
| 27 |
+
|
| 28 |
+
def prepare_inputs_embeds(
|
| 29 |
+
self,
|
| 30 |
+
input_ids: torch.LongTensor,
|
| 31 |
+
pixel_values: Optional[torch.FloatTensor] = None,
|
| 32 |
+
grid_thw: Optional[torch.FloatTensor] = None,
|
| 33 |
+
img_mask: Optional[torch.BoolTensor] = None,
|
| 34 |
+
) -> torch.Tensor:
|
| 35 |
+
inputs_embeds = self.get_input_embeddings()(input_ids)
|
| 36 |
+
|
| 37 |
+
if pixel_values is not None:
|
| 38 |
+
assert img_mask is not None
|
| 39 |
+
if grid_thw.shape[0] > DOTS_VLM_MAX_IMAGES:
|
| 40 |
+
print(
|
| 41 |
+
f"Num image exceeded: {grid_thw.shape[0]} > {DOTS_VLM_MAX_IMAGES}, which may cause FSDP hang"
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
vision_embeddings = self.vision_tower(pixel_values, grid_thw)
|
| 45 |
+
|
| 46 |
+
true_indices = torch.nonzero(img_mask).squeeze()
|
| 47 |
+
if len(true_indices) > vision_embeddings.size(0):
|
| 48 |
+
print(
|
| 49 |
+
f"img_mask sum > VE and will be truncated, mask.sum()={len(true_indices)} {vision_embeddings.size(0)=}"
|
| 50 |
+
)
|
| 51 |
+
true_indices = true_indices[: vision_embeddings.size(0)]
|
| 52 |
+
new_img_mask = torch.zeros_like(img_mask, device=img_mask.device)
|
| 53 |
+
new_img_mask[true_indices[:, 0], true_indices[:, 1]] = True
|
| 54 |
+
else:
|
| 55 |
+
new_img_mask = img_mask
|
| 56 |
+
|
| 57 |
+
assert (
|
| 58 |
+
vision_embeddings.size(0) == new_img_mask.sum()
|
| 59 |
+
), f"{vision_embeddings.size(0)=}, {new_img_mask.sum()=}"
|
| 60 |
+
|
| 61 |
+
inputs_embeds = inputs_embeds.masked_scatter(
|
| 62 |
+
new_img_mask.to(inputs_embeds.device).unsqueeze(-1).expand_as(inputs_embeds),
|
| 63 |
+
vision_embeddings.to(inputs_embeds.device).type(inputs_embeds.dtype),
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
return inputs_embeds
|
| 67 |
+
|
| 68 |
+
def forward(
|
| 69 |
+
self,
|
| 70 |
+
input_ids: torch.LongTensor,
|
| 71 |
+
pixel_values: Optional[torch.FloatTensor] = None,
|
| 72 |
+
image_grid_thw: Optional[torch.FloatTensor] = None,
|
| 73 |
+
inputs_embeds: Optional[torch.Tensor] = None,
|
| 74 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 75 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 76 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
| 77 |
+
labels: Optional[torch.LongTensor] = None,
|
| 78 |
+
output_attentions: Optional[bool] = None,
|
| 79 |
+
output_hidden_states: Optional[bool] = None,
|
| 80 |
+
return_dict: Optional[bool] = None,
|
| 81 |
+
use_cache: Optional[bool] = None,
|
| 82 |
+
logits_to_keep: int = 0,
|
| 83 |
+
**loss_kwargs,
|
| 84 |
+
) -> Union[Tuple, CausalLMOutputWithPast]:
|
| 85 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 86 |
+
assert len(input_ids) >= 1, f"empty input_ids {input_ids.shape=} will cause gradnorm nan"
|
| 87 |
+
if inputs_embeds is None:
|
| 88 |
+
img_mask = input_ids == self.config.image_token_id
|
| 89 |
+
inputs_embeds = self.prepare_inputs_embeds(input_ids, pixel_values, image_grid_thw, img_mask)
|
| 90 |
+
|
| 91 |
+
outputs = super().forward(
|
| 92 |
+
inputs_embeds=inputs_embeds,
|
| 93 |
+
attention_mask=attention_mask,
|
| 94 |
+
position_ids=position_ids,
|
| 95 |
+
past_key_values=past_key_values,
|
| 96 |
+
labels=labels,
|
| 97 |
+
use_cache=use_cache if use_cache is not None else self.config.use_cache,
|
| 98 |
+
output_attentions=output_attentions,
|
| 99 |
+
output_hidden_states=output_hidden_states,
|
| 100 |
+
# return_dict=return_dict,
|
| 101 |
+
logits_to_keep=logits_to_keep,
|
| 102 |
+
**loss_kwargs,
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
return outputs
|
| 106 |
+
|
| 107 |
+
def prepare_inputs_for_generation(
|
| 108 |
+
self,
|
| 109 |
+
input_ids,
|
| 110 |
+
past_key_values=None,
|
| 111 |
+
inputs_embeds=None,
|
| 112 |
+
pixel_values=None,
|
| 113 |
+
attention_mask=None,
|
| 114 |
+
cache_position=None,
|
| 115 |
+
num_logits_to_keep=None,
|
| 116 |
+
**kwargs,
|
| 117 |
+
):
|
| 118 |
+
model_inputs = super().prepare_inputs_for_generation(
|
| 119 |
+
input_ids,
|
| 120 |
+
past_key_values=past_key_values,
|
| 121 |
+
inputs_embeds=inputs_embeds,
|
| 122 |
+
attention_mask=attention_mask,
|
| 123 |
+
cache_position=cache_position,
|
| 124 |
+
num_logits_to_keep=num_logits_to_keep,
|
| 125 |
+
**kwargs,
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
if cache_position[0] == 0:
|
| 129 |
+
model_inputs["pixel_values"] = pixel_values
|
| 130 |
+
|
| 131 |
+
return model_inputs
|
modeling_dots_vision.py
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import math
|
| 2 |
+
|
| 3 |
+
import torch
|
| 4 |
+
import torch.nn as nn
|
| 5 |
+
import torch.nn.functional as F
|
| 6 |
+
import torch.utils.checkpoint
|
| 7 |
+
from flash_attn import flash_attn_varlen_func
|
| 8 |
+
from torch.nn import LayerNorm
|
| 9 |
+
from transformers.modeling_utils import PreTrainedModel
|
| 10 |
+
from .configuration_dots import DotsVisionConfig
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def rotate_half(x):
|
| 14 |
+
"""Rotates half the hidden dims of the input."""
|
| 15 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 16 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 17 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def apply_rotary_pos_emb_vision(tensor: torch.Tensor, freqs: torch.Tensor) -> torch.Tensor:
|
| 21 |
+
orig_dtype = tensor.dtype
|
| 22 |
+
tensor = tensor.float()
|
| 23 |
+
|
| 24 |
+
cos = freqs.cos()
|
| 25 |
+
sin = freqs.sin()
|
| 26 |
+
|
| 27 |
+
cos = cos.unsqueeze(1).repeat(1, 1, 2).unsqueeze(0).float()
|
| 28 |
+
sin = sin.unsqueeze(1).repeat(1, 1, 2).unsqueeze(0).float()
|
| 29 |
+
|
| 30 |
+
output = (tensor * cos) + (rotate_half(tensor) * sin)
|
| 31 |
+
|
| 32 |
+
output = output.to(orig_dtype)
|
| 33 |
+
|
| 34 |
+
return output
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class VisionRotaryEmbedding(nn.Module):
|
| 38 |
+
def __init__(self, dim: int, theta: float = 10000.0) -> None:
|
| 39 |
+
super().__init__()
|
| 40 |
+
inv_freq = 1.0 / (theta ** (torch.arange(0, dim, 2, dtype=torch.float) / dim))
|
| 41 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 42 |
+
|
| 43 |
+
def forward(self, seqlen: int) -> torch.Tensor:
|
| 44 |
+
seq = torch.arange(seqlen, device=self.inv_freq.device, dtype=self.inv_freq.dtype)
|
| 45 |
+
freqs = torch.outer(seq, self.inv_freq)
|
| 46 |
+
return freqs
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
class PatchMerger(nn.Module):
|
| 50 |
+
def __init__(
|
| 51 |
+
self,
|
| 52 |
+
dim: int,
|
| 53 |
+
context_dim: int,
|
| 54 |
+
spatial_merge_size: int = 2,
|
| 55 |
+
pre_norm="layernorm",
|
| 56 |
+
init_merger_std=None,
|
| 57 |
+
) -> None:
|
| 58 |
+
super().__init__()
|
| 59 |
+
self.hidden_size = context_dim * (spatial_merge_size ** 2)
|
| 60 |
+
self.pre_norm = pre_norm
|
| 61 |
+
if self.pre_norm == "layernorm":
|
| 62 |
+
self.ln_q = LayerNorm(context_dim, eps=1e-6)
|
| 63 |
+
elif self.pre_norm == "rmsnorm":
|
| 64 |
+
self.ln_q = RMSNorm(context_dim, eps=1e-6)
|
| 65 |
+
else:
|
| 66 |
+
print("no norm in patch merger")
|
| 67 |
+
|
| 68 |
+
self.mlp = nn.Sequential(
|
| 69 |
+
nn.Linear(self.hidden_size, self.hidden_size),
|
| 70 |
+
nn.GELU(),
|
| 71 |
+
nn.Linear(self.hidden_size, dim),
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
if init_merger_std is not None:
|
| 75 |
+
nn.init.normal_(self.mlp[0].weight, mean=0.0, std=init_merger_std)
|
| 76 |
+
nn.init.zeros_(self.mlp[0].bias)
|
| 77 |
+
nn.init.normal_(self.mlp[2].weight, mean=0.0, std=init_merger_std)
|
| 78 |
+
nn.init.zeros_(self.mlp[2].bias)
|
| 79 |
+
|
| 80 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 81 |
+
if self.pre_norm:
|
| 82 |
+
x = self.mlp(self.ln_q(x).view(-1, self.hidden_size))
|
| 83 |
+
else:
|
| 84 |
+
x = self.mlp(x.view(-1, self.hidden_size))
|
| 85 |
+
return x
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
class VisionAttention(nn.Module):
|
| 89 |
+
def __init__(self, config, dim: int, num_heads: int = 16, bias=True) -> None:
|
| 90 |
+
super().__init__()
|
| 91 |
+
self.num_heads = num_heads
|
| 92 |
+
self.head_dim = dim // num_heads
|
| 93 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=bias)
|
| 94 |
+
self.proj = nn.Linear(dim, dim, bias=bias)
|
| 95 |
+
|
| 96 |
+
def forward(
|
| 97 |
+
self,
|
| 98 |
+
hidden_states: torch.Tensor,
|
| 99 |
+
cu_seqlens: torch.Tensor,
|
| 100 |
+
rotary_pos_emb: torch.Tensor = None,
|
| 101 |
+
) -> torch.Tensor:
|
| 102 |
+
seq_length = hidden_states.shape[0]
|
| 103 |
+
|
| 104 |
+
q, k, v = self.qkv(hidden_states).reshape(seq_length, 3, self.num_heads, -1).permute(1, 0, 2, 3).unbind(0)
|
| 105 |
+
q = apply_rotary_pos_emb_vision(q.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 106 |
+
k = apply_rotary_pos_emb_vision(k.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 107 |
+
|
| 108 |
+
attention_mask = torch.full(
|
| 109 |
+
[1, seq_length, seq_length], torch.finfo(q.dtype).min, device=q.device, dtype=q.dtype
|
| 110 |
+
)
|
| 111 |
+
for i in range(1, len(cu_seqlens)):
|
| 112 |
+
attention_mask[..., cu_seqlens[i - 1] : cu_seqlens[i], cu_seqlens[i - 1] : cu_seqlens[i]] = 0
|
| 113 |
+
|
| 114 |
+
q = q.transpose(0, 1)
|
| 115 |
+
k = k.transpose(0, 1)
|
| 116 |
+
v = v.transpose(0, 1)
|
| 117 |
+
attn_weights = torch.matmul(q, k.transpose(1, 2)) / math.sqrt(self.head_dim)
|
| 118 |
+
attn_weights = attn_weights + attention_mask
|
| 119 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(q.dtype)
|
| 120 |
+
attn_output = torch.matmul(attn_weights, v)
|
| 121 |
+
attn_output = attn_output.transpose(0, 1)
|
| 122 |
+
attn_output = attn_output.reshape(seq_length, -1)
|
| 123 |
+
attn_output = self.proj(attn_output)
|
| 124 |
+
return attn_output
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
class VisionFlashAttention2(nn.Module):
|
| 128 |
+
def __init__(self, config, dim: int, num_heads: int = 16, bias=True) -> None:
|
| 129 |
+
super().__init__()
|
| 130 |
+
self.num_heads = num_heads
|
| 131 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=bias)
|
| 132 |
+
self.proj = nn.Linear(dim, dim, bias=bias)
|
| 133 |
+
self.config = config
|
| 134 |
+
self.is_causal = config.is_causal
|
| 135 |
+
|
| 136 |
+
def forward(
|
| 137 |
+
self,
|
| 138 |
+
hidden_states: torch.Tensor,
|
| 139 |
+
cu_seqlens: torch.Tensor,
|
| 140 |
+
rotary_pos_emb: torch.Tensor = None,
|
| 141 |
+
) -> torch.Tensor:
|
| 142 |
+
seq_length = hidden_states.shape[0]
|
| 143 |
+
q, k, v = (
|
| 144 |
+
self.qkv(hidden_states).reshape(seq_length, 3, self.num_heads, -1).permute(1, 0, 2, 3).unbind(0)
|
| 145 |
+
) # 'shd'
|
| 146 |
+
q = apply_rotary_pos_emb_vision(q.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 147 |
+
k = apply_rotary_pos_emb_vision(k.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 148 |
+
max_seqlen = (cu_seqlens[1:] - cu_seqlens[:-1]).max().item()
|
| 149 |
+
attn_output = flash_attn_varlen_func(
|
| 150 |
+
q, k, v, cu_seqlens, cu_seqlens, max_seqlen, max_seqlen, causal=self.is_causal
|
| 151 |
+
).reshape(seq_length, -1)
|
| 152 |
+
attn_output = self.proj(attn_output)
|
| 153 |
+
|
| 154 |
+
return attn_output
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
class VisionSdpaAttention(nn.Module):
|
| 158 |
+
def __init__(self, config, dim: int, num_heads: int = 16, bias=True) -> None:
|
| 159 |
+
super().__init__()
|
| 160 |
+
self.num_heads = num_heads
|
| 161 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=bias)
|
| 162 |
+
self.proj = nn.Linear(dim, dim, bias=bias)
|
| 163 |
+
self.config = config
|
| 164 |
+
|
| 165 |
+
def forward(
|
| 166 |
+
self,
|
| 167 |
+
hidden_states: torch.Tensor,
|
| 168 |
+
cu_seqlens: torch.Tensor,
|
| 169 |
+
rotary_pos_emb: torch.Tensor = None,
|
| 170 |
+
) -> torch.Tensor:
|
| 171 |
+
seq_length = hidden_states.shape[0]
|
| 172 |
+
q, k, v = self.qkv(hidden_states).reshape(seq_length, 3, self.num_heads, -1).permute(1, 0, 2, 3).unbind(0)
|
| 173 |
+
|
| 174 |
+
q = apply_rotary_pos_emb_vision(q.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 175 |
+
k = apply_rotary_pos_emb_vision(k.unsqueeze(0), rotary_pos_emb).squeeze(0)
|
| 176 |
+
|
| 177 |
+
attention_mask = torch.zeros([1, seq_length, seq_length], device=q.device, dtype=torch.bool)
|
| 178 |
+
for i in range(1, len(cu_seqlens)):
|
| 179 |
+
attention_mask[..., cu_seqlens[i - 1] : cu_seqlens[i], cu_seqlens[i - 1] : cu_seqlens[i]] = True
|
| 180 |
+
|
| 181 |
+
q = q.transpose(0, 1)
|
| 182 |
+
k = k.transpose(0, 1)
|
| 183 |
+
v = v.transpose(0, 1)
|
| 184 |
+
|
| 185 |
+
attn_output = F.scaled_dot_product_attention(q, k, v, attention_mask, dropout_p=0.0)
|
| 186 |
+
attn_output = attn_output.transpose(0, 1)
|
| 187 |
+
attn_output = attn_output.reshape(seq_length, -1)
|
| 188 |
+
|
| 189 |
+
attn_output = self.proj(attn_output)
|
| 190 |
+
return attn_output
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
DOTS_VISION_ATTENTION_CLASSES = {
|
| 194 |
+
"eager": VisionAttention,
|
| 195 |
+
"flash_attention_2": VisionFlashAttention2,
|
| 196 |
+
"sdpa": VisionSdpaAttention,
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
class RMSNorm(nn.Module):
|
| 201 |
+
def __init__(self, dim: int, eps: float = 1e-6):
|
| 202 |
+
super().__init__()
|
| 203 |
+
self.weight = nn.Parameter(torch.ones(dim))
|
| 204 |
+
self.eps = eps
|
| 205 |
+
|
| 206 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 207 |
+
output = self._norm(x.float()).type_as(x)
|
| 208 |
+
return output * self.weight
|
| 209 |
+
|
| 210 |
+
def extra_repr(self) -> str:
|
| 211 |
+
return f"{tuple(self.weight.shape)}, eps={self.eps}"
|
| 212 |
+
|
| 213 |
+
def _norm(self, x: torch.Tensor) -> torch.Tensor:
|
| 214 |
+
return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
class DotsSwiGLUFFN(nn.Module):
|
| 218 |
+
def __init__(self, config):
|
| 219 |
+
super().__init__()
|
| 220 |
+
hidden_features = config.intermediate_size
|
| 221 |
+
in_features = config.embed_dim
|
| 222 |
+
bias = config.use_bias
|
| 223 |
+
|
| 224 |
+
self.fc1 = nn.Linear(in_features, hidden_features, bias=bias)
|
| 225 |
+
self.fc2 = nn.Linear(hidden_features, in_features, bias=bias)
|
| 226 |
+
self.fc3 = nn.Linear(in_features, hidden_features, bias=bias)
|
| 227 |
+
|
| 228 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 229 |
+
x = F.silu(self.fc1(x)) * self.fc3(x)
|
| 230 |
+
x = self.fc2(x)
|
| 231 |
+
return x
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
class DotsPatchEmbed(nn.Module):
|
| 236 |
+
def __init__(self, config):
|
| 237 |
+
super().__init__()
|
| 238 |
+
self.num_channels = config.num_channels
|
| 239 |
+
self.patch_size = config.patch_size
|
| 240 |
+
self.temporal_patch_size = config.temporal_patch_size
|
| 241 |
+
self.embed_dim = config.embed_dim
|
| 242 |
+
self.config = config
|
| 243 |
+
self.proj = nn.Conv2d(
|
| 244 |
+
config.num_channels,
|
| 245 |
+
config.embed_dim,
|
| 246 |
+
kernel_size=(config.patch_size, config.patch_size),
|
| 247 |
+
stride=(config.patch_size, config.patch_size),
|
| 248 |
+
)
|
| 249 |
+
self.norm = RMSNorm(config.embed_dim, eps=config.rms_norm_eps)
|
| 250 |
+
|
| 251 |
+
def forward(self, x: torch.Tensor, grid_thw=None) -> torch.Tensor:
|
| 252 |
+
x = x.view(-1, self.num_channels, self.temporal_patch_size, self.patch_size, self.patch_size)[:, :, 0]
|
| 253 |
+
x = self.proj(x).view(-1, self.embed_dim)
|
| 254 |
+
x = self.norm(x)
|
| 255 |
+
return x
|
| 256 |
+
|
| 257 |
+
|
| 258 |
+
class DotsViTPreprocessor(nn.Module):
|
| 259 |
+
def __init__(self, config):
|
| 260 |
+
super().__init__()
|
| 261 |
+
self.patch_h = config.patch_size
|
| 262 |
+
self.patch_w = config.patch_size
|
| 263 |
+
self.embed_dim = config.embed_dim
|
| 264 |
+
self.config = config
|
| 265 |
+
self.patchifier = DotsPatchEmbed(config)
|
| 266 |
+
|
| 267 |
+
def forward(self, x: torch.Tensor, grid_thw=None) -> torch.Tensor:
|
| 268 |
+
tokens = self.patchifier(x, grid_thw)
|
| 269 |
+
return tokens
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
class DotsVisionBlock(nn.Module):
|
| 273 |
+
def __init__(self, config, attn_implementation: str = "flash_attention_2"):
|
| 274 |
+
super().__init__()
|
| 275 |
+
self.attn = DOTS_VISION_ATTENTION_CLASSES[attn_implementation](
|
| 276 |
+
config, config.embed_dim, num_heads=config.num_attention_heads, bias=config.use_bias
|
| 277 |
+
)
|
| 278 |
+
self.norm1 = RMSNorm(config.embed_dim, eps=config.rms_norm_eps)
|
| 279 |
+
self.mlp = DotsSwiGLUFFN(config)
|
| 280 |
+
self.norm2 = RMSNorm(config.embed_dim, eps=config.rms_norm_eps)
|
| 281 |
+
|
| 282 |
+
def forward(self, hidden_states, cu_seqlens, rotary_pos_emb) -> torch.Tensor:
|
| 283 |
+
hidden_states = hidden_states + self.attn(
|
| 284 |
+
self.norm1(hidden_states), cu_seqlens=cu_seqlens, rotary_pos_emb=rotary_pos_emb
|
| 285 |
+
)
|
| 286 |
+
hidden_states = hidden_states + self.mlp(self.norm2(hidden_states))
|
| 287 |
+
return hidden_states
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
class DotsVisionTransformer(PreTrainedModel):
|
| 291 |
+
def __init__(self, config: DotsVisionConfig) -> None:
|
| 292 |
+
super().__init__(config)
|
| 293 |
+
self.config = config
|
| 294 |
+
self.spatial_merge_size = config.spatial_merge_size
|
| 295 |
+
|
| 296 |
+
self.patch_embed = DotsViTPreprocessor(config)
|
| 297 |
+
self._init_weights(self.patch_embed.patchifier.proj)
|
| 298 |
+
|
| 299 |
+
head_dim = config.embed_dim // config.num_attention_heads
|
| 300 |
+
|
| 301 |
+
self.rotary_pos_emb = VisionRotaryEmbedding(head_dim // 2)
|
| 302 |
+
|
| 303 |
+
_num_hidden_layers = config.num_hidden_layers
|
| 304 |
+
self.blocks = nn.ModuleList(
|
| 305 |
+
[DotsVisionBlock(config, config.attn_implementation) for _ in range(_num_hidden_layers)]
|
| 306 |
+
)
|
| 307 |
+
|
| 308 |
+
if self.config.post_norm:
|
| 309 |
+
self.post_trunk_norm = RMSNorm(config.embed_dim, eps=config.rms_norm_eps)
|
| 310 |
+
|
| 311 |
+
self.merger = PatchMerger(
|
| 312 |
+
dim=config.hidden_size,
|
| 313 |
+
context_dim=config.embed_dim,
|
| 314 |
+
spatial_merge_size=config.spatial_merge_size,
|
| 315 |
+
init_merger_std=self.config.init_merger_std,
|
| 316 |
+
)
|
| 317 |
+
|
| 318 |
+
self.gradient_checkpointing = False
|
| 319 |
+
self._gradient_checkpointing_func = torch.utils.checkpoint.checkpoint
|
| 320 |
+
|
| 321 |
+
def _init_weights(self, module):
|
| 322 |
+
std = self.config.initializer_range
|
| 323 |
+
if isinstance(module, (nn.Linear, nn.Conv3d)):
|
| 324 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 325 |
+
if module.bias is not None:
|
| 326 |
+
module.bias.data.zero_()
|
| 327 |
+
elif isinstance(module, nn.Embedding):
|
| 328 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 329 |
+
if module.padding_idx is not None:
|
| 330 |
+
module.weight.data[module.padding_idx].zero_()
|
| 331 |
+
|
| 332 |
+
@property
|
| 333 |
+
def dtype(self) -> torch.dtype:
|
| 334 |
+
return self.blocks[0].mlp.fc2.weight.dtype
|
| 335 |
+
|
| 336 |
+
@property
|
| 337 |
+
def device(self) -> torch.device:
|
| 338 |
+
return self.blocks[0].mlp.fc2.weight.device
|
| 339 |
+
|
| 340 |
+
def get_pos_ids_by_grid(self, grid_thw):
|
| 341 |
+
pos_ids = []
|
| 342 |
+
for t, h, w in grid_thw:
|
| 343 |
+
hpos_ids = torch.arange(h).unsqueeze(1).expand(-1, w)
|
| 344 |
+
hpos_ids = hpos_ids.reshape(
|
| 345 |
+
h // self.spatial_merge_size,
|
| 346 |
+
self.spatial_merge_size,
|
| 347 |
+
w // self.spatial_merge_size,
|
| 348 |
+
self.spatial_merge_size,
|
| 349 |
+
)
|
| 350 |
+
hpos_ids = hpos_ids.permute(0, 2, 1, 3)
|
| 351 |
+
hpos_ids = hpos_ids.flatten()
|
| 352 |
+
|
| 353 |
+
wpos_ids = torch.arange(w).unsqueeze(0).expand(h, -1)
|
| 354 |
+
wpos_ids = wpos_ids.reshape(
|
| 355 |
+
h // self.spatial_merge_size,
|
| 356 |
+
self.spatial_merge_size,
|
| 357 |
+
w // self.spatial_merge_size,
|
| 358 |
+
self.spatial_merge_size,
|
| 359 |
+
)
|
| 360 |
+
wpos_ids = wpos_ids.permute(0, 2, 1, 3)
|
| 361 |
+
wpos_ids = wpos_ids.flatten()
|
| 362 |
+
pos_ids.append(
|
| 363 |
+
torch.stack([hpos_ids, wpos_ids], dim=-1).repeat(t, 1)
|
| 364 |
+
)
|
| 365 |
+
|
| 366 |
+
return pos_ids
|
| 367 |
+
|
| 368 |
+
def rot_pos_emb(self, grid_thw):
|
| 369 |
+
pos_ids = self.get_pos_ids_by_grid(grid_thw)
|
| 370 |
+
pos_ids = torch.cat(pos_ids, dim=0)
|
| 371 |
+
max_grid_size = grid_thw[:, 1:].max()
|
| 372 |
+
rotary_pos_emb_full = self.rotary_pos_emb(max_grid_size)
|
| 373 |
+
rotary_pos_emb = rotary_pos_emb_full[pos_ids].flatten(1)
|
| 374 |
+
return rotary_pos_emb
|
| 375 |
+
|
| 376 |
+
def forward(self, hidden_states: torch.Tensor, grid_thw: torch.Tensor, bf16=True) -> torch.Tensor:
|
| 377 |
+
if bf16:
|
| 378 |
+
hidden_states = hidden_states.bfloat16()
|
| 379 |
+
hidden_states = self.patch_embed(hidden_states, grid_thw)
|
| 380 |
+
|
| 381 |
+
rotary_pos_emb = self.rot_pos_emb(grid_thw)
|
| 382 |
+
|
| 383 |
+
cu_seqlens = torch.repeat_interleave(grid_thw[:, 1] * grid_thw[:, 2], grid_thw[:, 0]).cumsum(
|
| 384 |
+
dim=0,
|
| 385 |
+
dtype=grid_thw.dtype if torch.jit.is_tracing() else torch.int32,
|
| 386 |
+
)
|
| 387 |
+
cu_seqlens = F.pad(cu_seqlens, (1, 0), value=0)
|
| 388 |
+
|
| 389 |
+
for blk in self.blocks:
|
| 390 |
+
if self.gradient_checkpointing and self.training:
|
| 391 |
+
hidden_states = self._gradient_checkpointing_func(
|
| 392 |
+
blk.__call__,
|
| 393 |
+
hidden_states,
|
| 394 |
+
cu_seqlens,
|
| 395 |
+
rotary_pos_emb,
|
| 396 |
+
)
|
| 397 |
+
else:
|
| 398 |
+
hidden_states = blk(hidden_states, cu_seqlens=cu_seqlens, rotary_pos_emb=rotary_pos_emb)
|
| 399 |
+
|
| 400 |
+
if self.config.post_norm:
|
| 401 |
+
hidden_states = self.post_trunk_norm(hidden_states)
|
| 402 |
+
|
| 403 |
+
hidden_states = self.merger(hidden_states)
|
| 404 |
+
return hidden_states
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"auto_map": {
|
| 3 |
+
"AutoProcessor": "configuration_dots.DotsVLProcessor"
|
| 4 |
+
},
|
| 5 |
+
"min_pixels": 3136,
|
| 6 |
+
"max_pixels": 11289600,
|
| 7 |
+
"patch_size": 14,
|
| 8 |
+
"temporal_patch_size": 1,
|
| 9 |
+
"merge_size": 2,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.48145466,
|
| 12 |
+
0.4578275,
|
| 13 |
+
0.40821073
|
| 14 |
+
],
|
| 15 |
+
"image_std": [
|
| 16 |
+
0.26862954,
|
| 17 |
+
0.26130258,
|
| 18 |
+
0.27577711
|
| 19 |
+
],
|
| 20 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 21 |
+
"processor_class": "DotsVLProcessor"
|
| 22 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|im_start|>",
|
| 4 |
+
"<|im_end|>",
|
| 5 |
+
"<|object_ref_start|>",
|
| 6 |
+
"<|object_ref_end|>",
|
| 7 |
+
"<|box_start|>",
|
| 8 |
+
"<|box_end|>",
|
| 9 |
+
"<|quad_start|>",
|
| 10 |
+
"<|quad_end|>",
|
| 11 |
+
"<|vision_start|>",
|
| 12 |
+
"<|vision_end|>",
|
| 13 |
+
"<|vision_pad|>",
|
| 14 |
+
"<|image_pad|>",
|
| 15 |
+
"<|video_pad|>"
|
| 16 |
+
],
|
| 17 |
+
"eos_token": {
|
| 18 |
+
"content": "<|endoftext|>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
"pad_token": "[PAD]"
|
| 25 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:386545eb05f08c51352cde2fcc2c867f1592bb330f305efd1c6a57a93b1244cd
|
| 3 |
+
size 7036028
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"151643": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
},
|
| 181 |
+
"151665": {
|
| 182 |
+
"content": "<|imgpad|>",
|
| 183 |
+
"lstrip": false,
|
| 184 |
+
"normalized": false,
|
| 185 |
+
"rstrip": false,
|
| 186 |
+
"single_word": false,
|
| 187 |
+
"special": true
|
| 188 |
+
},
|
| 189 |
+
"151666": {
|
| 190 |
+
"content": "<|img|>",
|
| 191 |
+
"lstrip": false,
|
| 192 |
+
"normalized": false,
|
| 193 |
+
"rstrip": false,
|
| 194 |
+
"single_word": false,
|
| 195 |
+
"special": true
|
| 196 |
+
},
|
| 197 |
+
"151667": {
|
| 198 |
+
"content": "<|endofimg|>",
|
| 199 |
+
"lstrip": false,
|
| 200 |
+
"normalized": false,
|
| 201 |
+
"rstrip": false,
|
| 202 |
+
"single_word": false,
|
| 203 |
+
"special": true
|
| 204 |
+
},
|
| 205 |
+
"151668": {
|
| 206 |
+
"content": "<|systemprompt|>",
|
| 207 |
+
"lstrip": false,
|
| 208 |
+
"normalized": false,
|
| 209 |
+
"rstrip": false,
|
| 210 |
+
"single_word": false,
|
| 211 |
+
"special": true
|
| 212 |
+
},
|
| 213 |
+
"151669": {
|
| 214 |
+
"content": "<|endofsystemprompt|>",
|
| 215 |
+
"lstrip": false,
|
| 216 |
+
"normalized": false,
|
| 217 |
+
"rstrip": false,
|
| 218 |
+
"single_word": false,
|
| 219 |
+
"special": true
|
| 220 |
+
},
|
| 221 |
+
"151670": {
|
| 222 |
+
"content": "<|user|>",
|
| 223 |
+
"lstrip": false,
|
| 224 |
+
"normalized": false,
|
| 225 |
+
"rstrip": false,
|
| 226 |
+
"single_word": false,
|
| 227 |
+
"special": true
|
| 228 |
+
},
|
| 229 |
+
"151671": {
|
| 230 |
+
"content": "<|endofuser|>",
|
| 231 |
+
"lstrip": false,
|
| 232 |
+
"normalized": false,
|
| 233 |
+
"rstrip": false,
|
| 234 |
+
"single_word": false,
|
| 235 |
+
"special": true
|
| 236 |
+
},
|
| 237 |
+
"151672": {
|
| 238 |
+
"content": "<|assistant|>",
|
| 239 |
+
"lstrip": false,
|
| 240 |
+
"normalized": false,
|
| 241 |
+
"rstrip": false,
|
| 242 |
+
"single_word": false,
|
| 243 |
+
"special": true
|
| 244 |
+
},
|
| 245 |
+
"151673": {
|
| 246 |
+
"content": "<|endofassistant|>",
|
| 247 |
+
"lstrip": false,
|
| 248 |
+
"normalized": false,
|
| 249 |
+
"rstrip": false,
|
| 250 |
+
"single_word": false,
|
| 251 |
+
"special": true
|
| 252 |
+
},
|
| 253 |
+
"151674": {
|
| 254 |
+
"content": "<|ref_start|>",
|
| 255 |
+
"lstrip": false,
|
| 256 |
+
"normalized": false,
|
| 257 |
+
"rstrip": false,
|
| 258 |
+
"single_word": false,
|
| 259 |
+
"special": true
|
| 260 |
+
},
|
| 261 |
+
"151675": {
|
| 262 |
+
"content": "<|ref_end|>",
|
| 263 |
+
"lstrip": false,
|
| 264 |
+
"normalized": false,
|
| 265 |
+
"rstrip": false,
|
| 266 |
+
"single_word": false,
|
| 267 |
+
"special": true
|
| 268 |
+
},
|
| 269 |
+
"151676": {
|
| 270 |
+
"content": "[SEP]",
|
| 271 |
+
"lstrip": false,
|
| 272 |
+
"normalized": false,
|
| 273 |
+
"rstrip": false,
|
| 274 |
+
"single_word": false,
|
| 275 |
+
"special": true
|
| 276 |
+
},
|
| 277 |
+
"151677": {
|
| 278 |
+
"content": "<|pic|>",
|
| 279 |
+
"lstrip": false,
|
| 280 |
+
"normalized": false,
|
| 281 |
+
"rstrip": false,
|
| 282 |
+
"single_word": false,
|
| 283 |
+
"special": true
|
| 284 |
+
},
|
| 285 |
+
"151678": {
|
| 286 |
+
"content": "<|text|>",
|
| 287 |
+
"lstrip": false,
|
| 288 |
+
"normalized": false,
|
| 289 |
+
"rstrip": false,
|
| 290 |
+
"single_word": false,
|
| 291 |
+
"special": true
|
| 292 |
+
},
|
| 293 |
+
"151679": {
|
| 294 |
+
"content": "<|pictotext|>",
|
| 295 |
+
"lstrip": false,
|
| 296 |
+
"normalized": false,
|
| 297 |
+
"rstrip": false,
|
| 298 |
+
"single_word": false,
|
| 299 |
+
"special": true
|
| 300 |
+
},
|
| 301 |
+
"151680": {
|
| 302 |
+
"content": "[PAD]",
|
| 303 |
+
"lstrip": false,
|
| 304 |
+
"normalized": false,
|
| 305 |
+
"rstrip": false,
|
| 306 |
+
"single_word": false,
|
| 307 |
+
"special": true
|
| 308 |
+
},
|
| 309 |
+
"151681": {
|
| 310 |
+
"content": "<|slice|>",
|
| 311 |
+
"lstrip": false,
|
| 312 |
+
"normalized": false,
|
| 313 |
+
"rstrip": false,
|
| 314 |
+
"single_word": false,
|
| 315 |
+
"special": true
|
| 316 |
+
},
|
| 317 |
+
"151682": {
|
| 318 |
+
"content": "<|endofslice|>",
|
| 319 |
+
"lstrip": false,
|
| 320 |
+
"normalized": false,
|
| 321 |
+
"rstrip": false,
|
| 322 |
+
"single_word": false,
|
| 323 |
+
"special": true
|
| 324 |
+
},
|
| 325 |
+
"151683": {
|
| 326 |
+
"content": "<|imgrowend|>",
|
| 327 |
+
"lstrip": false,
|
| 328 |
+
"normalized": false,
|
| 329 |
+
"rstrip": false,
|
| 330 |
+
"single_word": false,
|
| 331 |
+
"special": true
|
| 332 |
+
},
|
| 333 |
+
"151684": {
|
| 334 |
+
"content": "<|polygon_start|>",
|
| 335 |
+
"lstrip": false,
|
| 336 |
+
"normalized": false,
|
| 337 |
+
"rstrip": false,
|
| 338 |
+
"single_word": false,
|
| 339 |
+
"special": true
|
| 340 |
+
},
|
| 341 |
+
"151685": {
|
| 342 |
+
"content": "<|polygon_end|>",
|
| 343 |
+
"lstrip": false,
|
| 344 |
+
"normalized": false,
|
| 345 |
+
"rstrip": false,
|
| 346 |
+
"single_word": false,
|
| 347 |
+
"special": true
|
| 348 |
+
},
|
| 349 |
+
"151686": {
|
| 350 |
+
"content": "<|image_gen_start|>",
|
| 351 |
+
"lstrip": false,
|
| 352 |
+
"normalized": false,
|
| 353 |
+
"rstrip": false,
|
| 354 |
+
"single_word": false,
|
| 355 |
+
"special": true
|
| 356 |
+
},
|
| 357 |
+
"151687": {
|
| 358 |
+
"content": "<|image_gen_end|>",
|
| 359 |
+
"lstrip": false,
|
| 360 |
+
"normalized": false,
|
| 361 |
+
"rstrip": false,
|
| 362 |
+
"single_word": false,
|
| 363 |
+
"special": true
|
| 364 |
+
}
|
| 365 |
+
},
|
| 366 |
+
"additional_special_tokens": [
|
| 367 |
+
"<|im_start|>",
|
| 368 |
+
"<|im_end|>",
|
| 369 |
+
"<|object_ref_start|>",
|
| 370 |
+
"<|object_ref_end|>",
|
| 371 |
+
"<|box_start|>",
|
| 372 |
+
"<|box_end|>",
|
| 373 |
+
"<|quad_start|>",
|
| 374 |
+
"<|quad_end|>",
|
| 375 |
+
"<|vision_start|>",
|
| 376 |
+
"<|vision_end|>",
|
| 377 |
+
"<|vision_pad|>",
|
| 378 |
+
"<|image_pad|>",
|
| 379 |
+
"<|video_pad|>"
|
| 380 |
+
],
|
| 381 |
+
"bos_token": null,
|
| 382 |
+
"chat_template": "{%- for m in messages %}\n {%- if m.role == 'system' %}\n {{- '<|system|>' + m.content + '<|endofsystem|>\\n' }}\n {%- elif m.role == 'user' %}\n {{- '<|user|>' + m.content + '<|endofuser|>' }}\n {%- elif m.role == 'assistant' %}\n {{- '<|assistant|>' + m.content }}\n {%- if not loop.last %}\n {{- '<|endofassistant|>' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if messages[-1].role != 'assistant' %}\n {{- '<|assistant|>' }}\n{%- endif %}",
|
| 383 |
+
"clean_up_tokenization_spaces": false,
|
| 384 |
+
"eos_token": "<|endoftext|>",
|
| 385 |
+
"errors": "replace",
|
| 386 |
+
"model_max_length": 131072,
|
| 387 |
+
"pad_token": "[PAD]",
|
| 388 |
+
"split_special_tokens": false,
|
| 389 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 390 |
+
"unk_token": null
|
| 391 |
+
}
|
vocab.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
|
| 3 |
+
size 2776833
|