Image-Text-to-Text
Transformers
Safetensors
qwen3_5
vision-language-model
long-context
visual-text-compression
conversational
Instructions to use apple/LensVLM-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apple/LensVLM-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="apple/LensVLM-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("apple/LensVLM-9B") model = AutoModelForMultimodalLM.from_pretrained("apple/LensVLM-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use apple/LensVLM-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "apple/LensVLM-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "apple/LensVLM-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/apple/LensVLM-9B
- SGLang
How to use apple/LensVLM-9B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "apple/LensVLM-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "apple/LensVLM-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "apple/LensVLM-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "apple/LensVLM-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use apple/LensVLM-9B with Docker Model Runner:
docker model run hf.co/apple/LensVLM-9B
first commit
Browse filesCo-authored-by: kolecke <kolecke@users.noreply.huggingface.co>
- .gitattributes +36 -0
- ACKNOWLEDGEMENTS +278 -0
- LICENSE +88 -0
- NOTICE +142 -0
- README.md +66 -0
- chat_template.jinja +154 -0
- config.json +113 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- processor_config.json +65 -0
- tokenizer.json +3 -0
- tokenizer_config.json +33 -0
.gitattributes
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt 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 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
ACKNOWLEDGEMENTS
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Acknowledgements
|
| 2 |
+
Portions of this LensVLM Software may utilize the following copyrighted
|
| 3 |
+
material, the use of which is hereby acknowledged.
|
| 4 |
+
|
| 5 |
+
_____________________
|
| 6 |
+
|
| 7 |
+
Alibaba Cloud (Qwen3.5-9B)
|
| 8 |
+
|
| 9 |
+
The LensVLM-9B model weights are a Derivative Work of Qwen3.5-9B
|
| 10 |
+
(https://huggingface.co/Qwen/Qwen3.5-9B), licensed under the Apache
|
| 11 |
+
License, Version 2.0.
|
| 12 |
+
|
| 13 |
+
Copyright 2026 Alibaba Cloud
|
| 14 |
+
|
| 15 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 16 |
+
you may not use this file except in compliance with the License.
|
| 17 |
+
You may obtain a copy of the License at
|
| 18 |
+
|
| 19 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 20 |
+
|
| 21 |
+
Unless required by applicable law or agreed to in writing, software
|
| 22 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 23 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 24 |
+
See the License for the specific language governing permissions and
|
| 25 |
+
limitations under the License.
|
| 26 |
+
|
| 27 |
+
A verbatim copy of the Apache License, Version 2.0 -- as received with the
|
| 28 |
+
original work -- is reproduced in full at the end of this file. Apple Inc.
|
| 29 |
+
changed files of this original work; those modifications are designated
|
| 30 |
+
NOT A CONTRIBUTION and are itemized in the NOTICE file. As permitted by
|
| 31 |
+
Section 4 of the Apache License, Version 2.0, the LensVLM-9B weights as a
|
| 32 |
+
whole are released under the Apple Machine Learning Research Model License.
|
| 33 |
+
|
| 34 |
+
"Qwen" is a trademark of Alibaba Group, used solely to identify the origin
|
| 35 |
+
of the original work as permitted by Section 6 of the Apache License,
|
| 36 |
+
Version 2.0.
|
| 37 |
+
|
| 38 |
+
_____________________
|
| 39 |
+
|
| 40 |
+
Bitstream, Inc. and Tavmjong Bah (DejaVu Fonts)
|
| 41 |
+
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
|
| 42 |
+
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below).
|
| 43 |
+
|
| 44 |
+
Bitstream Vera Fonts Copyright:
|
| 45 |
+
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
|
| 46 |
+
Vera is a trademark of Bitstream, Inc.
|
| 47 |
+
|
| 48 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 49 |
+
a copy of the fonts accompanying this license ("Fonts") and associated
|
| 50 |
+
documentation files (the "Font Software"), to reproduce and distribute
|
| 51 |
+
the Font Software, including without limitation the rights to use, copy,
|
| 52 |
+
merge, publish, distribute, and/or sell copies of the Font Software, and
|
| 53 |
+
to permit persons to whom the Font Software is furnished to do so,
|
| 54 |
+
subject to the following conditions:
|
| 55 |
+
|
| 56 |
+
The above copyright and trademark notices and this permission notice
|
| 57 |
+
shall be included in all copies of one or more of the Font Software
|
| 58 |
+
typefaces.
|
| 59 |
+
|
| 60 |
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 61 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 62 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
| 63 |
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
|
| 64 |
+
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
| 65 |
+
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
|
| 66 |
+
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 67 |
+
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
|
| 68 |
+
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
_____________________
|
| 72 |
+
|
| 73 |
+
Full text of the Apache License, Version 2.0
|
| 74 |
+
(reproduced verbatim as received with Qwen3.5-9B; see the entry for Alibaba
|
| 75 |
+
Cloud above)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
Apache License
|
| 79 |
+
Version 2.0, January 2004
|
| 80 |
+
http://www.apache.org/licenses/
|
| 81 |
+
|
| 82 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 83 |
+
|
| 84 |
+
1. Definitions.
|
| 85 |
+
|
| 86 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 87 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 88 |
+
|
| 89 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 90 |
+
the copyright owner that is granting the License.
|
| 91 |
+
|
| 92 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 93 |
+
other entities that control, are controlled by, or are under common
|
| 94 |
+
control with that entity. For the purposes of this definition,
|
| 95 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 96 |
+
direction or management of such entity, whether by contract or
|
| 97 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 98 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 99 |
+
|
| 100 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 101 |
+
exercising permissions granted by this License.
|
| 102 |
+
|
| 103 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 104 |
+
including but not limited to software source code, documentation
|
| 105 |
+
source, and configuration files.
|
| 106 |
+
|
| 107 |
+
"Object" form shall mean any form resulting from mechanical
|
| 108 |
+
transformation or translation of a Source form, including but
|
| 109 |
+
not limited to compiled object code, generated documentation,
|
| 110 |
+
and conversions to other media types.
|
| 111 |
+
|
| 112 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 113 |
+
Object form, made available under the License, as indicated by a
|
| 114 |
+
copyright notice that is included in or attached to the work
|
| 115 |
+
(an example is provided in the Appendix below).
|
| 116 |
+
|
| 117 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 118 |
+
form, that is based on (or derived from) the Work and for which the
|
| 119 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 120 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 121 |
+
of this License, Derivative Works shall not include works that remain
|
| 122 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 123 |
+
the Work and Derivative Works thereof.
|
| 124 |
+
|
| 125 |
+
"Contribution" shall mean any work of authorship, including
|
| 126 |
+
the original version of the Work and any modifications or additions
|
| 127 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 128 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 129 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 130 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 131 |
+
means any form of electronic, verbal, or written communication sent
|
| 132 |
+
to the Licensor or its representatives, including but not limited to
|
| 133 |
+
communication on electronic mailing lists, source code control systems,
|
| 134 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 135 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 136 |
+
excluding communication that is conspicuously marked or otherwise
|
| 137 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 138 |
+
|
| 139 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 140 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 141 |
+
subsequently incorporated within the Work.
|
| 142 |
+
|
| 143 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 144 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 145 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 146 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 147 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 148 |
+
Work and such Derivative Works in Source or Object form.
|
| 149 |
+
|
| 150 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 151 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 152 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 153 |
+
(except as stated in this section) patent license to make, have made,
|
| 154 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 155 |
+
where such license applies only to those patent claims licensable
|
| 156 |
+
by such Contributor that are necessarily infringed by their
|
| 157 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 158 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 159 |
+
institute patent litigation against any entity (including a
|
| 160 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 161 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 162 |
+
or contributory patent infringement, then any patent licenses
|
| 163 |
+
granted to You under this License for that Work shall terminate
|
| 164 |
+
as of the date such litigation is filed.
|
| 165 |
+
|
| 166 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 167 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 168 |
+
modifications, and in Source or Object form, provided that You
|
| 169 |
+
meet the following conditions:
|
| 170 |
+
|
| 171 |
+
(a) You must give any other recipients of the Work or
|
| 172 |
+
Derivative Works a copy of this License; and
|
| 173 |
+
|
| 174 |
+
(b) You must cause any modified files to carry prominent notices
|
| 175 |
+
stating that You changed the files; and
|
| 176 |
+
|
| 177 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 178 |
+
that You distribute, all copyright, patent, trademark, and
|
| 179 |
+
attribution notices from the Source form of the Work,
|
| 180 |
+
excluding those notices that do not pertain to any part of
|
| 181 |
+
the Derivative Works; and
|
| 182 |
+
|
| 183 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 184 |
+
distribution, then any Derivative Works that You distribute must
|
| 185 |
+
include a readable copy of the attribution notices contained
|
| 186 |
+
within such NOTICE file, excluding those notices that do not
|
| 187 |
+
pertain to any part of the Derivative Works, in at least one
|
| 188 |
+
of the following places: within a NOTICE text file distributed
|
| 189 |
+
as part of the Derivative Works; within the Source form or
|
| 190 |
+
documentation, if provided along with the Derivative Works; or,
|
| 191 |
+
within a display generated by the Derivative Works, if and
|
| 192 |
+
wherever such third-party notices normally appear. The contents
|
| 193 |
+
of the NOTICE file are for informational purposes only and
|
| 194 |
+
do not modify the License. You may add Your own attribution
|
| 195 |
+
notices within Derivative Works that You distribute, alongside
|
| 196 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 197 |
+
that such additional attribution notices cannot be construed
|
| 198 |
+
as modifying the License.
|
| 199 |
+
|
| 200 |
+
You may add Your own copyright statement to Your modifications and
|
| 201 |
+
may provide additional or different license terms and conditions
|
| 202 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 203 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 204 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 205 |
+
the conditions stated in this License.
|
| 206 |
+
|
| 207 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 208 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 209 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 210 |
+
this License, without any additional terms or conditions.
|
| 211 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 212 |
+
the terms of any separate license agreement you may have executed
|
| 213 |
+
with Licensor regarding such Contributions.
|
| 214 |
+
|
| 215 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 216 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 217 |
+
except as required for reasonable and customary use in describing the
|
| 218 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 219 |
+
|
| 220 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 221 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 222 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 223 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 224 |
+
implied, including, without limitation, any warranties or conditions
|
| 225 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 226 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 227 |
+
appropriateness of using or redistributing the Work and assume any
|
| 228 |
+
risks associated with Your exercise of permissions under this License.
|
| 229 |
+
|
| 230 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 231 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 232 |
+
unless required by applicable law (such as deliberate and grossly
|
| 233 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 234 |
+
liable to You for damages, including any direct, indirect, special,
|
| 235 |
+
incidental, or consequential damages of any character arising as a
|
| 236 |
+
result of this License or out of the use or inability to use the
|
| 237 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 238 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 239 |
+
other commercial damages or losses), even if such Contributor
|
| 240 |
+
has been advised of the possibility of such damages.
|
| 241 |
+
|
| 242 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 243 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 244 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 245 |
+
or other liability obligations and/or rights consistent with this
|
| 246 |
+
License. However, in accepting such obligations, You may act only
|
| 247 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 248 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 249 |
+
defend, and hold each Contributor harmless for any liability
|
| 250 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 251 |
+
of your accepting any such warranty or additional liability.
|
| 252 |
+
|
| 253 |
+
END OF TERMS AND CONDITIONS
|
| 254 |
+
|
| 255 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 256 |
+
|
| 257 |
+
To apply the Apache License to your work, attach the following
|
| 258 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 259 |
+
replaced with your own identifying information. (Don't include
|
| 260 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 261 |
+
comment syntax for the file format. We also recommend that a
|
| 262 |
+
file or class name and description of purpose be included on the
|
| 263 |
+
same "printed page" as the copyright notice for easier
|
| 264 |
+
identification within third-party archives.
|
| 265 |
+
|
| 266 |
+
Copyright 2026 Alibaba Cloud
|
| 267 |
+
|
| 268 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 269 |
+
you may not use this file except in compliance with the License.
|
| 270 |
+
You may obtain a copy of the License at
|
| 271 |
+
|
| 272 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 273 |
+
|
| 274 |
+
Unless required by applicable law or agreed to in writing, software
|
| 275 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 276 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 277 |
+
See the License for the specific language governing permissions and
|
| 278 |
+
limitations under the License.
|
LICENSE
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Disclaimer: IMPORTANT: This Apple Machine Learning Research Model is
|
| 2 |
+
specifically developed and released by Apple Inc. ("Apple") for the sole purpose
|
| 3 |
+
of scientific research of artificial intelligence and machine-learning
|
| 4 |
+
technology. “Apple Machine Learning Research Model” means the model, including
|
| 5 |
+
but not limited to algorithms, formulas, trained model weights, parameters,
|
| 6 |
+
configurations, checkpoints, and any related materials (including
|
| 7 |
+
documentation).
|
| 8 |
+
|
| 9 |
+
This Apple Machine Learning Research Model is provided to You by
|
| 10 |
+
Apple in consideration of your agreement to the following terms, and your use,
|
| 11 |
+
modification, creation of Model Derivatives, and or redistribution of the Apple
|
| 12 |
+
Machine Learning Research Model constitutes acceptance of this Agreement. If You
|
| 13 |
+
do not agree with these terms, please do not use, modify, create Model
|
| 14 |
+
Derivatives of, or distribute this Apple Machine Learning Research Model or
|
| 15 |
+
Model Derivatives.
|
| 16 |
+
|
| 17 |
+
* License Scope: In consideration of your agreement to abide by the following
|
| 18 |
+
terms, and subject to these terms, Apple hereby grants you a personal,
|
| 19 |
+
non-exclusive, worldwide, non-transferable, royalty-free, revocable, and
|
| 20 |
+
limited license, to use, copy, modify, distribute, and create Model
|
| 21 |
+
Derivatives (defined below) of the Apple Machine Learning Research Model
|
| 22 |
+
exclusively for Research Purposes. You agree that any Model Derivatives You
|
| 23 |
+
may create or that may be created for You will be limited to Research Purposes
|
| 24 |
+
as well. “Research Purposes” means non-commercial scientific research and
|
| 25 |
+
academic development activities, such as experimentation, analysis, testing
|
| 26 |
+
conducted by You with the sole intent to advance scientific knowledge and
|
| 27 |
+
research. “Research Purposes” does not include any commercial exploitation,
|
| 28 |
+
product development or use in any commercial product or service.
|
| 29 |
+
|
| 30 |
+
* Distribution of Apple Machine Learning Research Model and Model Derivatives:
|
| 31 |
+
If you choose to redistribute Apple Machine Learning Research Model or its
|
| 32 |
+
Model Derivatives, you must provide a copy of this Agreement to such third
|
| 33 |
+
party, and ensure that the following attribution notice be provided: “Apple
|
| 34 |
+
Machine Learning Research Model is licensed under the Apple Machine Learning
|
| 35 |
+
Research Model License Agreement.” Additionally, all Model Derivatives must
|
| 36 |
+
clearly be identified as such, including disclosure of modifications and
|
| 37 |
+
changes made to the Apple Machine Learning Research Model. The name,
|
| 38 |
+
trademarks, service marks or logos of Apple may not be used to endorse or
|
| 39 |
+
promote Model Derivatives or the relationship between You and Apple. “Model
|
| 40 |
+
Derivatives” means any models or any other artifacts created by modifications,
|
| 41 |
+
improvements, adaptations, alterations to the architecture, algorithm or
|
| 42 |
+
training processes of the Apple Machine Learning Research Model, or by any
|
| 43 |
+
retraining, fine-tuning of the Apple Machine Learning Research Model.
|
| 44 |
+
|
| 45 |
+
* No Other License: Except as expressly stated in this notice, no other rights
|
| 46 |
+
or licenses, express or implied, are granted by Apple herein, including but
|
| 47 |
+
not limited to any patent, trademark, and similar intellectual property rights
|
| 48 |
+
worldwide that may be infringed by the Apple Machine Learning Research Model,
|
| 49 |
+
the Model Derivatives or by other works in which the Apple Machine Learning
|
| 50 |
+
Research Model may be incorporated.
|
| 51 |
+
|
| 52 |
+
* Compliance with Laws: Your use of Apple Machine Learning Research Model must
|
| 53 |
+
be in compliance with all applicable laws and regulations.
|
| 54 |
+
|
| 55 |
+
* Term and Termination: The term of this Agreement will begin upon your
|
| 56 |
+
acceptance of this Agreement or use of the Apple Machine Learning Research
|
| 57 |
+
Model and will continue until terminated in accordance with the following
|
| 58 |
+
terms. Apple may terminate this Agreement at any time if You are in breach of
|
| 59 |
+
any term or condition of this Agreement. Upon termination of this Agreement,
|
| 60 |
+
You must cease to use all Apple Machine Learning Research Models and Model
|
| 61 |
+
Derivatives and permanently delete any copy thereof. Sections 3, 6 and 7 will
|
| 62 |
+
survive termination.
|
| 63 |
+
|
| 64 |
+
* Disclaimer and Limitation of Liability: This Apple Machine Learning Research
|
| 65 |
+
Model and any outputs generated by the Apple Machine Learning Research Model
|
| 66 |
+
are provided on an “AS IS” basis. APPLE MAKES NO WARRANTIES, EXPRESS OR
|
| 67 |
+
IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
|
| 68 |
+
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
|
| 69 |
+
REGARDING THE APPLE MACHINE LEARNING RESEARCH MODEL OR OUTPUTS GENERATED BY
|
| 70 |
+
THE APPLE MACHINE LEARNING RESEARCH MODEL. You are solely responsible for
|
| 71 |
+
determining the appropriateness of using or redistributing the Apple Machine
|
| 72 |
+
Learning Research Model and any outputs of the Apple Machine Learning Research
|
| 73 |
+
Model and assume any risks associated with Your use of the Apple Machine
|
| 74 |
+
Learning Research Model and any output and results. IN NO EVENT SHALL APPLE BE
|
| 75 |
+
LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
| 76 |
+
IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF
|
| 77 |
+
THE APPLE MACHINE LEARNING RESEARCH MODEL AND ANY OUTPUTS OF THE APPLE MACHINE
|
| 78 |
+
LEARNING RESEARCH MODEL, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
|
| 79 |
+
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS
|
| 80 |
+
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 81 |
+
|
| 82 |
+
* Governing Law: This Agreement will be governed by and construed under the laws
|
| 83 |
+
of the State of California without regard to its choice of law principles. The
|
| 84 |
+
Convention on Contracts for the International Sale of Goods shall not apply to
|
| 85 |
+
the Agreement except that the arbitration clause and any arbitration hereunder
|
| 86 |
+
shall be governed by the Federal Arbitration Act, Chapters 1 and 2.
|
| 87 |
+
|
| 88 |
+
Copyright (C) 2026 Apple Inc. All Rights Reserved.
|
NOTICE
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
NOTICE
|
| 2 |
+
======
|
| 3 |
+
|
| 4 |
+
LensVLM
|
| 5 |
+
Copyright (C) 2026 Apple Inc. All Rights Reserved.
|
| 6 |
+
|
| 7 |
+
This NOTICE file accompanies both this source repository and the LensVLM-9B
|
| 8 |
+
model weights distributed at https://huggingface.co/apple/LensVLM-9B.
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
-------------------------------------------------------------------------------
|
| 12 |
+
1. Apple-authored source code
|
| 13 |
+
-------------------------------------------------------------------------------
|
| 14 |
+
|
| 15 |
+
The source code in this repository was authored by Apple Inc. and is released
|
| 16 |
+
under the Apple Sample Code License. See the accompanying LICENSE file.
|
| 17 |
+
|
| 18 |
+
This source code is not derived from, and contains no code copied from, the
|
| 19 |
+
third-party work identified in Section 3 below.
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
-------------------------------------------------------------------------------
|
| 23 |
+
2. LensVLM-9B model weights
|
| 24 |
+
-------------------------------------------------------------------------------
|
| 25 |
+
|
| 26 |
+
The LensVLM-9B model weights are released under the Apple Machine Learning
|
| 27 |
+
Research Model License.
|
| 28 |
+
|
| 29 |
+
Apple Machine Learning Research Model is licensed under the Apple Machine
|
| 30 |
+
Learning Research Model License Agreement.
|
| 31 |
+
|
| 32 |
+
That license limits use of the weights to non-commercial Research Purposes.
|
| 33 |
+
Applying these terms to the weights as a whole is permitted by Section 4 of the
|
| 34 |
+
Apache License, Version 2.0, which governs the original work identified in
|
| 35 |
+
Section 3 below.
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
-------------------------------------------------------------------------------
|
| 39 |
+
3. Third-party material: Qwen3.5-9B (Apache License, Version 2.0)
|
| 40 |
+
-------------------------------------------------------------------------------
|
| 41 |
+
|
| 42 |
+
The LensVLM-9B model is a Derivative Work of the following third-party work,
|
| 43 |
+
which is licensed under the Apache License, Version 2.0:
|
| 44 |
+
|
| 45 |
+
Work: Qwen3.5-9B
|
| 46 |
+
Source: https://huggingface.co/Qwen/Qwen3.5-9B
|
| 47 |
+
Copyright: Copyright 2026 Alibaba Cloud
|
| 48 |
+
License: Apache License, Version 2.0
|
| 49 |
+
|
| 50 |
+
A complete copy of the Apache License, Version 2.0 -- reproduced verbatim as
|
| 51 |
+
received with the original work -- is provided in the accompanying file:
|
| 52 |
+
|
| 53 |
+
ACKNOWLEDGEMENTS
|
| 54 |
+
|
| 55 |
+
You may also obtain a copy of the License at:
|
| 56 |
+
|
| 57 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 58 |
+
|
| 59 |
+
Unless required by applicable law or agreed to in writing, software distributed
|
| 60 |
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
| 61 |
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
| 62 |
+
specific language governing permissions and limitations under the License.
|
| 63 |
+
|
| 64 |
+
Attribution notices retained from the original work:
|
| 65 |
+
|
| 66 |
+
@misc{qwen3.5,
|
| 67 |
+
title = {{Qwen3.5}: Towards Native Multimodal Agents},
|
| 68 |
+
author = {{Qwen Team}},
|
| 69 |
+
month = {February},
|
| 70 |
+
year = {2026},
|
| 71 |
+
url = {https://qwen.ai/blog?id=qwen3.5}
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
The original work does not include a "NOTICE" text file as part of its
|
| 75 |
+
distribution. Accordingly, there are no upstream NOTICE attribution notices to
|
| 76 |
+
reproduce. All copyright, patent, trademark, and attribution notices that are
|
| 77 |
+
present in the original work are retained above and in ACKNOWLEDGEMENTS.
|
| 78 |
+
|
| 79 |
+
"Qwen" is a trademark of Alibaba Group. Its use here is solely to identify the
|
| 80 |
+
origin of the original work, as permitted by Section 6 of the Apache License,
|
| 81 |
+
Version 2.0. Neither Alibaba Cloud nor the Qwen Team endorses LensVLM.
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
-------------------------------------------------------------------------------
|
| 85 |
+
4. Statement of modifications -- NOT A CONTRIBUTION
|
| 86 |
+
-------------------------------------------------------------------------------
|
| 87 |
+
|
| 88 |
+
NOT A CONTRIBUTION.
|
| 89 |
+
|
| 90 |
+
Apple Inc. has changed files of the original work identified in Section 3. All
|
| 91 |
+
such modifications are Copyright (C) 2026 Apple Inc. All Rights Reserved, and
|
| 92 |
+
are expressly designated in writing as "NOT A CONTRIBUTION" within the meaning
|
| 93 |
+
of Section 1 of the Apache License, Version 2.0. Nothing in this distribution
|
| 94 |
+
is intentionally submitted to Alibaba Cloud, the Qwen Team, or any other
|
| 95 |
+
licensor for inclusion in the original work, and no Contribution as defined by
|
| 96 |
+
Section 1 of the Apache License, Version 2.0 is made or intended.
|
| 97 |
+
|
| 98 |
+
The files listed below were changed by Apple Inc. Because these files are
|
| 99 |
+
binary tensor archives or JSON documents, neither of which supports embedded
|
| 100 |
+
comments, the prominent notice required by Section 4(b) of the Apache License,
|
| 101 |
+
Version 2.0 is given here and in the accompanying model card.
|
| 102 |
+
|
| 103 |
+
Files CHANGED by Apple Inc. (relative to Qwen/Qwen3.5-9B):
|
| 104 |
+
|
| 105 |
+
model.safetensors Model weights fine-tuned by Apple Inc. for
|
| 106 |
+
selective context expansion over compressed page
|
| 107 |
+
images. Changed. NOT A CONTRIBUTION.
|
| 108 |
+
|
| 109 |
+
config.json Re-serialized by a newer version of the
|
| 110 |
+
Transformers library and updated with Apple
|
| 111 |
+
training/inference settings. The model
|
| 112 |
+
architecture, hidden size, layer count, layer
|
| 113 |
+
types, and vocabulary size are unchanged from the
|
| 114 |
+
original work. Changed. NOT A CONTRIBUTION.
|
| 115 |
+
|
| 116 |
+
tokenizer.json Re-serialized by a newer version of the
|
| 117 |
+
tokenizer_config.json Transformers library (tokenizer class
|
| 118 |
+
"Qwen2Tokenizer" to "TokenizersBackend"). The
|
| 119 |
+
vocabulary is byte-for-byte identical to the
|
| 120 |
+
original work; no tokens were added, removed, or
|
| 121 |
+
remapped. Changed. NOT A CONTRIBUTION.
|
| 122 |
+
|
| 123 |
+
generation_config.json Decoding defaults set by Apple Inc.
|
| 124 |
+
processor_config.json Image/video preprocessing defaults set by Apple
|
| 125 |
+
Inc. for compressed-page rendering. Changed.
|
| 126 |
+
NOT A CONTRIBUTION.
|
| 127 |
+
|
| 128 |
+
Files redistributed UNMODIFIED from the original work:
|
| 129 |
+
|
| 130 |
+
chat_template.jinja Byte-for-byte identical to the original work.
|
| 131 |
+
|
| 132 |
+
No file of the original work was removed from the distribution in a way that
|
| 133 |
+
would strip a copyright, patent, trademark, or attribution notice.
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
-------------------------------------------------------------------------------
|
| 137 |
+
5. Other third-party material
|
| 138 |
+
-------------------------------------------------------------------------------
|
| 139 |
+
|
| 140 |
+
Additional third-party material bundled with this repository, including the
|
| 141 |
+
DejaVu fonts used for deterministic page rendering, is identified in the
|
| 142 |
+
accompanying ACKNOWLEDGEMENTS file.
|
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apple-amlr
|
| 3 |
+
license_link: https://huggingface.co/apple/LensVLM-9B/blob/main/LICENSE
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
base_model:
|
| 7 |
+
- Qwen/Qwen3.5-9B
|
| 8 |
+
tags:
|
| 9 |
+
- vision-language-model
|
| 10 |
+
- long-context
|
| 11 |
+
- visual-text-compression
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# LensVLM-9B
|
| 15 |
+
|
| 16 |
+
LensVLM is a 9B Vision Language Model (VLM) that scans compressed images of text,
|
| 17 |
+
then selectively expands only the relevant pages to their uncompressed form via
|
| 18 |
+
learned tools.
|
| 19 |
+
|
| 20 |
+
- Paper: [LensVLM: Selective Context Expansion for Compressed Visual Representation of Text](https://arxiv.org/abs/2605.07019)
|
| 21 |
+
- Code: https://github.com/apple-aiml-research/ml-lensvlm
|
| 22 |
+
|
| 23 |
+
## License
|
| 24 |
+
|
| 25 |
+
All ML model files in this repository, including Apple's modifications to the Qwen
|
| 26 |
+
model, are provided under the terms of the
|
| 27 |
+
[Apple Machine Learning Research Model License](https://huggingface.co/apple/LensVLM-9B/blob/main/LICENSE).
|
| 28 |
+
|
| 29 |
+
The source code that accompanies this model is distributed separately and is provided
|
| 30 |
+
under the terms of the Apple Sample Code License.
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
Install the LensVLM code and run inference:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
git clone https://github.com/apple-aiml-research/ml-lensvlm
|
| 38 |
+
cd ml-lensvlm
|
| 39 |
+
pip install -r requirements.txt
|
| 40 |
+
python scripts/run_demo.py --model apple/LensVLM-9B
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
For a custom document:
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
python demo.py \
|
| 47 |
+
--model apple/LensVLM-9B \
|
| 48 |
+
--text_file document.txt \
|
| 49 |
+
--question "What is the main finding?" \
|
| 50 |
+
--compression 10x
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
Compression options: `5x`, `10x`, `15x`. See the
|
| 54 |
+
[repository README](https://github.com/apple-aiml-research/ml-lensvlm) for data preparation
|
| 55 |
+
and evaluation.
|
| 56 |
+
|
| 57 |
+
## Citation
|
| 58 |
+
|
| 59 |
+
```bibtex
|
| 60 |
+
@article{xie2026lensvlm,
|
| 61 |
+
title={LensVLM: Selective Context Expansion for Compressed Visual Representation of Text},
|
| 62 |
+
author={Xie, Roy and Friedman, Dan and Yu, Donghan and Pan, Bowen and Fifty, Christopher and Kim, Jang-Hyun and Du, Xianzhi and Gan, Zhe and Rathod, Vivek and Dhingra, Bhuwan},
|
| 63 |
+
journal={arXiv preprint arXiv:2605.07019},
|
| 64 |
+
year={2026}
|
| 65 |
+
}
|
| 66 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
+
{{- '<|im_start|>system\n' }}
|
| 47 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 48 |
+
{%- for tool in tools %}
|
| 49 |
+
{{- "\n" }}
|
| 50 |
+
{{- tool | tojson }}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{{- "\n</tools>" }}
|
| 53 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 54 |
+
{%- if messages[0].role == 'system' %}
|
| 55 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 56 |
+
{%- if content %}
|
| 57 |
+
{{- '\n\n' + content }}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<|im_end|>\n' }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if messages[0].role == 'system' %}
|
| 63 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 64 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 68 |
+
{%- for message in messages[::-1] %}
|
| 69 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 70 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 71 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 72 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 73 |
+
{%- set ns.multi_step_tool = false %}
|
| 74 |
+
{%- set ns.last_query_index = index %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{%- endfor %}
|
| 78 |
+
{%- if ns.multi_step_tool %}
|
| 79 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- for message in messages %}
|
| 82 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
+
{%- if message.role == "system" %}
|
| 84 |
+
{%- if not loop.first %}
|
| 85 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- elif message.role == "user" %}
|
| 88 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 89 |
+
{%- elif message.role == "assistant" %}
|
| 90 |
+
{%- set reasoning_content = '' %}
|
| 91 |
+
{%- if message.reasoning_content is string %}
|
| 92 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{%- if '</think>' in content %}
|
| 95 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 96 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endif %}
|
| 99 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if tool_call.function is defined %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if loop.first %}
|
| 111 |
+
{%- if content|trim %}
|
| 112 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 113 |
+
{%- else %}
|
| 114 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- else %}
|
| 117 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
+
{%- endif %}
|
| 119 |
+
{%- if tool_call.arguments is defined %}
|
| 120 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 121 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 122 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 123 |
+
{{- args_value }}
|
| 124 |
+
{{- '\n</parameter>\n' }}
|
| 125 |
+
{%- endfor %}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{{- '</function>\n</tool_call>' }}
|
| 128 |
+
{%- endfor %}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{{- '<|im_end|>\n' }}
|
| 131 |
+
{%- elif message.role == "tool" %}
|
| 132 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 133 |
+
{{- '<|im_start|>user' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{{- '\n<tool_response>\n' }}
|
| 136 |
+
{{- content }}
|
| 137 |
+
{{- '\n</tool_response>' }}
|
| 138 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 139 |
+
{{- '<|im_end|>\n' }}
|
| 140 |
+
{%- elif loop.last %}
|
| 141 |
+
{{- '<|im_end|>\n' }}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{%- else %}
|
| 144 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{%- endfor %}
|
| 147 |
+
{%- if add_generation_prompt %}
|
| 148 |
+
{{- '<|im_start|>assistant\n' }}
|
| 149 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 150 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 151 |
+
{%- else %}
|
| 152 |
+
{{- '<think>\n' }}
|
| 153 |
+
{%- endif %}
|
| 154 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "bfloat16",
|
| 6 |
+
"eos_token_id": 248046,
|
| 7 |
+
"hidden_size": 4096,
|
| 8 |
+
"image_token_id": 248056,
|
| 9 |
+
"model_type": "qwen3_5",
|
| 10 |
+
"pad_token_id": 248044,
|
| 11 |
+
"text_config": {
|
| 12 |
+
"attention_bias": false,
|
| 13 |
+
"attention_dropout": 0.0,
|
| 14 |
+
"attn_output_gate": true,
|
| 15 |
+
"bos_token_id": null,
|
| 16 |
+
"dtype": "bfloat16",
|
| 17 |
+
"eos_token_id": 248044,
|
| 18 |
+
"full_attention_interval": 4,
|
| 19 |
+
"head_dim": 256,
|
| 20 |
+
"hidden_act": "silu",
|
| 21 |
+
"hidden_size": 4096,
|
| 22 |
+
"initializer_range": 0.02,
|
| 23 |
+
"intermediate_size": 12288,
|
| 24 |
+
"layer_types": [
|
| 25 |
+
"linear_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"linear_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"linear_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"linear_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"linear_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"linear_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"linear_attention",
|
| 50 |
+
"linear_attention",
|
| 51 |
+
"linear_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"linear_attention",
|
| 54 |
+
"linear_attention",
|
| 55 |
+
"linear_attention",
|
| 56 |
+
"full_attention"
|
| 57 |
+
],
|
| 58 |
+
"linear_conv_kernel_dim": 4,
|
| 59 |
+
"linear_key_head_dim": 128,
|
| 60 |
+
"linear_num_key_heads": 16,
|
| 61 |
+
"linear_num_value_heads": 32,
|
| 62 |
+
"linear_value_head_dim": 128,
|
| 63 |
+
"mamba_ssm_dtype": "float32",
|
| 64 |
+
"max_position_embeddings": 262144,
|
| 65 |
+
"mlp_only_layers": [],
|
| 66 |
+
"model_type": "qwen3_5_text",
|
| 67 |
+
"mtp_num_hidden_layers": 1,
|
| 68 |
+
"mtp_use_dedicated_embeddings": false,
|
| 69 |
+
"num_attention_heads": 16,
|
| 70 |
+
"num_hidden_layers": 32,
|
| 71 |
+
"num_key_value_heads": 4,
|
| 72 |
+
"pad_token_id": null,
|
| 73 |
+
"partial_rotary_factor": 0.25,
|
| 74 |
+
"rms_norm_eps": 1e-06,
|
| 75 |
+
"rope_parameters": {
|
| 76 |
+
"mrope_interleaved": true,
|
| 77 |
+
"mrope_section": [
|
| 78 |
+
11,
|
| 79 |
+
11,
|
| 80 |
+
10
|
| 81 |
+
],
|
| 82 |
+
"partial_rotary_factor": 0.25,
|
| 83 |
+
"rope_theta": 10000000,
|
| 84 |
+
"rope_type": "default"
|
| 85 |
+
},
|
| 86 |
+
"tie_word_embeddings": false,
|
| 87 |
+
"use_cache": false,
|
| 88 |
+
"vocab_size": 248320
|
| 89 |
+
},
|
| 90 |
+
"tie_word_embeddings": false,
|
| 91 |
+
"transformers_version": "5.2.0",
|
| 92 |
+
"use_cache": false,
|
| 93 |
+
"video_token_id": 248057,
|
| 94 |
+
"vision_config": {
|
| 95 |
+
"deepstack_visual_indexes": [],
|
| 96 |
+
"depth": 27,
|
| 97 |
+
"dtype": "bfloat16",
|
| 98 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 99 |
+
"hidden_size": 1152,
|
| 100 |
+
"in_channels": 3,
|
| 101 |
+
"initializer_range": 0.02,
|
| 102 |
+
"intermediate_size": 4304,
|
| 103 |
+
"model_type": "qwen3_5",
|
| 104 |
+
"num_heads": 16,
|
| 105 |
+
"num_position_embeddings": 2304,
|
| 106 |
+
"out_hidden_size": 4096,
|
| 107 |
+
"patch_size": 16,
|
| 108 |
+
"spatial_merge_size": 2,
|
| 109 |
+
"temporal_patch_size": 2
|
| 110 |
+
},
|
| 111 |
+
"vision_end_token_id": 248054,
|
| 112 |
+
"vision_start_token_id": 248053
|
| 113 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
248046,
|
| 5 |
+
248044
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 248044,
|
| 8 |
+
"transformers_version": "5.2.0",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc6305126b47349db0c14061200e6bc1b930c3a19eee7338921eaca2b28f1e87
|
| 3 |
+
size 18819722392
|
processor_config.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"data_format": "channels_first",
|
| 4 |
+
"do_convert_rgb": true,
|
| 5 |
+
"do_normalize": true,
|
| 6 |
+
"do_rescale": true,
|
| 7 |
+
"do_resize": true,
|
| 8 |
+
"image_mean": [
|
| 9 |
+
0.5,
|
| 10 |
+
0.5,
|
| 11 |
+
0.5
|
| 12 |
+
],
|
| 13 |
+
"image_processor_type": "Qwen2VLImageProcessorFast",
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"max_pixels": 1572864,
|
| 20 |
+
"merge_size": 2,
|
| 21 |
+
"min_pixels": 1,
|
| 22 |
+
"patch_size": 16,
|
| 23 |
+
"resample": 3,
|
| 24 |
+
"rescale_factor": 0.00392156862745098,
|
| 25 |
+
"size": {
|
| 26 |
+
"longest_edge": 16777216,
|
| 27 |
+
"shortest_edge": 65536
|
| 28 |
+
},
|
| 29 |
+
"temporal_patch_size": 2
|
| 30 |
+
},
|
| 31 |
+
"processor_class": "Qwen3VLProcessor",
|
| 32 |
+
"video_processor": {
|
| 33 |
+
"data_format": "channels_first",
|
| 34 |
+
"default_to_square": true,
|
| 35 |
+
"do_convert_rgb": true,
|
| 36 |
+
"do_normalize": true,
|
| 37 |
+
"do_rescale": true,
|
| 38 |
+
"do_resize": true,
|
| 39 |
+
"do_sample_frames": true,
|
| 40 |
+
"fps": 2,
|
| 41 |
+
"image_mean": [
|
| 42 |
+
0.5,
|
| 43 |
+
0.5,
|
| 44 |
+
0.5
|
| 45 |
+
],
|
| 46 |
+
"image_std": [
|
| 47 |
+
0.5,
|
| 48 |
+
0.5,
|
| 49 |
+
0.5
|
| 50 |
+
],
|
| 51 |
+
"max_frames": 768,
|
| 52 |
+
"merge_size": 2,
|
| 53 |
+
"min_frames": 4,
|
| 54 |
+
"patch_size": 16,
|
| 55 |
+
"resample": 3,
|
| 56 |
+
"rescale_factor": 0.00392156862745098,
|
| 57 |
+
"return_metadata": false,
|
| 58 |
+
"size": {
|
| 59 |
+
"longest_edge": 234881024,
|
| 60 |
+
"shortest_edge": 4096
|
| 61 |
+
},
|
| 62 |
+
"temporal_patch_size": 2,
|
| 63 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 64 |
+
}
|
| 65 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
|
| 3 |
+
size 19989343
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": false,
|
| 13 |
+
"model_max_length": 262144,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"audio_bos_token": "<|audio_start|>",
|
| 16 |
+
"audio_eos_token": "<|audio_end|>",
|
| 17 |
+
"audio_token": "<|audio_pad|>",
|
| 18 |
+
"image_token": "<|image_pad|>",
|
| 19 |
+
"video_token": "<|video_pad|>",
|
| 20 |
+
"vision_bos_token": "<|vision_start|>",
|
| 21 |
+
"vision_eos_token": "<|vision_end|>"
|
| 22 |
+
},
|
| 23 |
+
"pad_token": "<|endoftext|>",
|
| 24 |
+
"padding_side": "right",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "TokenizersBackend",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|