Upload folder using huggingface_hub
Browse files- LICENSE +71 -0
- README.md +261 -0
- chat_template.jinja +92 -0
- config.json +97 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
- processor_config.json +39 -0
- tokenizer.json +0 -0
- tokenizer_config.json +27 -0
LICENSE
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
LFM Open License v1.0
|
| 2 |
+
|
| 3 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 4 |
+
|
| 5 |
+
1. Definitions.
|
| 6 |
+
|
| 7 |
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by this document.
|
| 8 |
+
|
| 9 |
+
"Licensor" shall mean Liquid AI, Inc.
|
| 10 |
+
|
| 11 |
+
"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, "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.
|
| 12 |
+
|
| 13 |
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
| 14 |
+
|
| 15 |
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
| 16 |
+
|
| 17 |
+
"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.
|
| 18 |
+
|
| 19 |
+
"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.
|
| 20 |
+
|
| 21 |
+
"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.
|
| 22 |
+
|
| 23 |
+
"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."
|
| 24 |
+
|
| 25 |
+
"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.
|
| 26 |
+
|
| 27 |
+
"Commercial Use" shall mean any use of the Work for direct or indirect commercial advantage or monetary compensation.
|
| 28 |
+
|
| 29 |
+
"Qualified Non-Profit Organization" shall mean a Legal Entity that is organized and operated exclusively for religious, charitable, scientific, testing for public safety, literary, or educational purposes, and which is exempt from federal income tax under Section 501(c)(3) of the United States Internal Revenue Code of 1986, as amended, or any equivalent non-profit or charitable organization in a foreign jurisdiction.
|
| 30 |
+
|
| 31 |
+
"Non-Commercial or Research Purposes" shall mean purposes that do not involve any use of the Work or a Derivative Work for Commercial Use.
|
| 32 |
+
|
| 33 |
+
"Threshold" shall mean annual revenue of 10 million United States dollars ($10,000,000) or more.
|
| 34 |
+
|
| 35 |
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, including the Commercial Use limitation set forth in Section 5, 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.
|
| 36 |
+
|
| 37 |
+
3. Grant of Patent License. Subject to the terms and conditions of this License, including the Commercial Use limitation set forth in Section 5, 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 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.
|
| 38 |
+
|
| 39 |
+
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:
|
| 40 |
+
|
| 41 |
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
| 42 |
+
|
| 43 |
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
| 44 |
+
|
| 45 |
+
(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
|
| 46 |
+
|
| 47 |
+
(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.
|
| 48 |
+
|
| 49 |
+
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.
|
| 50 |
+
|
| 51 |
+
5. Commercial Use Limitation.
|
| 52 |
+
|
| 53 |
+
(a) The rights granted under this License for Commercial Use are conditioned upon You or Your Legal Entity not exceeding the Threshold.
|
| 54 |
+
|
| 55 |
+
(b) Any Commercial Use of the Work or a Derivative Work by a Legal Entity that exceeds the Threshold is not licensed under this Agreement.
|
| 56 |
+
|
| 57 |
+
(c) The Threshold shall not apply to a Qualified Non-Profit Organization's use of the Work or a Derivative Work for Non-Commercial or Research Purposes.
|
| 58 |
+
|
| 59 |
+
6. 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. Notwithstanding 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 |
+
7. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except for the reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
| 62 |
+
|
| 63 |
+
8. 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 |
+
9. 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 |
+
10. 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 |
+
11. Termination. This License will terminate automatically and immediately if You fail to comply with any of its terms and conditions. Upon termination, You must cease all use of the Work and any Derivative Works and delete all copies in Your possession.
|
| 70 |
+
|
| 71 |
+
END OF TERMS AND CONDITIONS
|
README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: other
|
| 4 |
+
license_name: lfm1.0
|
| 5 |
+
license_link: LICENSE
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
- ja
|
| 9 |
+
- ko
|
| 10 |
+
- fr
|
| 11 |
+
- es
|
| 12 |
+
- de
|
| 13 |
+
- ar
|
| 14 |
+
- zh
|
| 15 |
+
- pt
|
| 16 |
+
pipeline_tag: image-text-to-text
|
| 17 |
+
tags:
|
| 18 |
+
- liquid
|
| 19 |
+
- lfm2
|
| 20 |
+
- lfm2-vl
|
| 21 |
+
- edge
|
| 22 |
+
- lfm2.5-vl
|
| 23 |
+
- lfm2.5
|
| 24 |
+
base_model: LiquidAI/LFM2.5-350M
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
<center>
|
| 28 |
+
<div style="text-align: center;">
|
| 29 |
+
<img
|
| 30 |
+
src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/2b08LKpev0DNEk6DlnWkY.png"
|
| 31 |
+
alt="Liquid AI"
|
| 32 |
+
style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"
|
| 33 |
+
/>
|
| 34 |
+
</div>
|
| 35 |
+
<div style="display: flex; justify-content: center; gap: 0.5em;">
|
| 36 |
+
<a href="https://playground.liquid.ai/chat?model=lfm2.5-vl-450m"><strong>Try LFM</strong></a> • <a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> • <a href="https://leap.liquid.ai/"><strong>LEAP</strong></a> • <a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a>
|
| 37 |
+
</div>
|
| 38 |
+
</center>
|
| 39 |
+
|
| 40 |
+
<br>
|
| 41 |
+
|
| 42 |
+
# LFM2.5‑VL-450M
|
| 43 |
+
|
| 44 |
+
LFM2.5‑VL-450M is [Liquid AI](https://www.liquid.ai/)'s refreshed version of the first vision-language model, [LFM2-VL-450M](https://huggingface.co/LiquidAI/LFM2-VL-450M), built on an updated backbone [LFM2.5-350M](https://huggingface.co/LiquidAI/LFM2.5-350M) and tuned for stronger real-world performance. Find more about LFM2.5 family of models in our [blog post](http://www.liquid.ai/blog/lfm2-5-vl-450m).
|
| 45 |
+
|
| 46 |
+
* **Enhanced instruction following** on vision and language tasks.
|
| 47 |
+
* **Improved multilingual vision understanding** in Arabic, Chinese, French, German, Japanese, Korean, Portuguese and Spanish.
|
| 48 |
+
* **Bounding box prediction and object detection** for grounded visual understanding.
|
| 49 |
+
* **Function calling support** for text-only input.
|
| 50 |
+
|
| 51 |
+
🎥⚡️ You can try LFM2.5-VL-450M running locally in your browser with our real-time video stream captioning [WebGPU demo](https://huggingface.co/spaces/LiquidAI/LFM2.5-VL-450M-WebGPU) 🎥⚡️
|
| 52 |
+
|
| 53 |
+
Alternatively, try the API model on the [Playground](https://playground.liquid.ai/chat?model=lfm2.5-vl-450m).
|
| 54 |
+
|
| 55 |
+
## 📄 Model details
|
| 56 |
+
|
| 57 |
+
LFM2.5-VL-450M is a general-purpose vision-language model with the following features:
|
| 58 |
+
|
| 59 |
+
- **LM Backbone**: LFM2.5-350M
|
| 60 |
+
- **Vision encoder**: SigLIP2 NaFlex shape‑optimized 86M
|
| 61 |
+
- **Context length**: 32,768 tokens
|
| 62 |
+
- **Vocabulary size**: 65,536
|
| 63 |
+
- **Languages**: English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese, and Spanish
|
| 64 |
+
- **Native resolution processing**: handles images up to 512*512 pixels without upscaling and preserves non-standard aspect ratios without distortion
|
| 65 |
+
- **Tiling strategy**: splits large images into non-overlapping 512×512 patches and includes thumbnail encoding for global context
|
| 66 |
+
- **Inference-time flexibility**: user-tunable maximum image tokens and tile count for speed/quality tradeoff without retraining
|
| 67 |
+
- **Generation parameters**:
|
| 68 |
+
- text: `temperature=0.1`, `min_p=0.15`, `repetition_penalty=1.05`
|
| 69 |
+
- vision: `min_image_tokens=32` `max_image_tokens=256`, `do_image_splitting=True`
|
| 70 |
+
|
| 71 |
+
| Model | Description |
|
| 72 |
+
|-------|-------------|
|
| 73 |
+
| [**LFM2.5-VL-450M**](https://huggingface.co/LiquidAI/LFM2.5-VL-450M) | Original model checkpoint in native format. Best for fine-tuning or inference with Transformers and vLLM. |
|
| 74 |
+
| [LFM2.5-VL-450M-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-GGUF) | Quantized format for llama.cpp and compatible tools. Optimized for CPU inference and local deployment with reduced memory usage. |
|
| 75 |
+
| [LFM2.5-VL-450M-ONNX](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-ONNX) | ONNX Runtime format for cross-platform deployment. Enables hardware-accelerated inference across diverse environments (cloud, edge, mobile). |
|
| 76 |
+
|
| 77 |
+
We recommend using it for general vision-language workloads, captioning and object detection. It’s not well-suited for knowledge-intensive tasks or fine-grained OCR.
|
| 78 |
+
|
| 79 |
+
### Chat Template
|
| 80 |
+
|
| 81 |
+
LFM2.5-VL uses a ChatML-like format. See the [Chat Template documentation](https://docs.liquid.ai/lfm/key-concepts/chat-template#vision-models) for details.
|
| 82 |
+
|
| 83 |
+
```
|
| 84 |
+
<|startoftext|><|im_start|>system
|
| 85 |
+
You are a helpful multimodal assistant by Liquid AI.<|im_end|>
|
| 86 |
+
<|im_start|>user
|
| 87 |
+
<image>Describe this image.<|im_end|>
|
| 88 |
+
<|im_start|>assistant
|
| 89 |
+
This image shows a Caenorhabditis elegans (C. elegans) nematode.<|im_end|>
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
You can use [`processor.apply_chat_template()`](https://huggingface.co/docs/transformers/en/chat_templating_multimodal) to format your messages automatically.
|
| 93 |
+
|
| 94 |
+
## 🏃 Inference
|
| 95 |
+
|
| 96 |
+
You can run LFM2.5-VL-450M with Hugging Face [`transformers`](https://github.com/huggingface/transformers) v5.1 or newer:
|
| 97 |
+
|
| 98 |
+
```bash
|
| 99 |
+
pip install transformers pillow
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
```python
|
| 103 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 104 |
+
from transformers.image_utils import load_image
|
| 105 |
+
|
| 106 |
+
# Load model and processor
|
| 107 |
+
model_id = "LiquidAI/LFM2.5-VL-450M"
|
| 108 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 109 |
+
model_id,
|
| 110 |
+
device_map="auto",
|
| 111 |
+
dtype="bfloat16"
|
| 112 |
+
)
|
| 113 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 114 |
+
|
| 115 |
+
# Load image and create conversation
|
| 116 |
+
url = "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
|
| 117 |
+
image = load_image(url)
|
| 118 |
+
conversation = [
|
| 119 |
+
{
|
| 120 |
+
"role": "user",
|
| 121 |
+
"content": [
|
| 122 |
+
{"type": "image", "image": image},
|
| 123 |
+
{"type": "text", "text": "What is in this image?"},
|
| 124 |
+
],
|
| 125 |
+
},
|
| 126 |
+
]
|
| 127 |
+
|
| 128 |
+
# Generate Answer
|
| 129 |
+
inputs = processor.apply_chat_template(
|
| 130 |
+
conversation,
|
| 131 |
+
add_generation_prompt=True,
|
| 132 |
+
return_tensors="pt",
|
| 133 |
+
return_dict=True,
|
| 134 |
+
tokenize=True,
|
| 135 |
+
).to(model.device)
|
| 136 |
+
outputs = model.generate(**inputs, max_new_tokens=64)
|
| 137 |
+
processor.batch_decode(outputs, skip_special_tokens=True)[0]
|
| 138 |
+
|
| 139 |
+
# This image captures the iconic Statue of Liberty standing majestically on Liberty Island in New York City. The statue, a symbol of freedom and democracy, is prominently featured in the foreground, its greenish-gray hue contrasting beautifully with the surrounding water.
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
### Visual grounding
|
| 143 |
+
|
| 144 |
+
LFM2.5-VL-450M supports bounding box prediction:
|
| 145 |
+
|
| 146 |
+
```python
|
| 147 |
+
url = "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
|
| 148 |
+
image = load_image(url)
|
| 149 |
+
query = "status"
|
| 150 |
+
prompt = f'Detect all instances of: {query}. Response must be a JSON array: [{"label": ..., "bbox": [x1, y1, x2, y2]}, ...]. Coordinates are normalized to [0,1].'
|
| 151 |
+
|
| 152 |
+
conversation = [
|
| 153 |
+
{
|
| 154 |
+
"role": "user",
|
| 155 |
+
"content": [
|
| 156 |
+
{"type": "image", "image": image},
|
| 157 |
+
{"type": "text", "text": prompt},
|
| 158 |
+
],
|
| 159 |
+
},
|
| 160 |
+
]
|
| 161 |
+
|
| 162 |
+
# Generate Answer
|
| 163 |
+
inputs = processor.apply_chat_template(
|
| 164 |
+
conversation,
|
| 165 |
+
add_generation_prompt=True,
|
| 166 |
+
return_tensors="pt",
|
| 167 |
+
return_dict=True,
|
| 168 |
+
tokenize=True,
|
| 169 |
+
).to(model.device)
|
| 170 |
+
outputs = model.generate(**inputs, max_new_tokens=64)
|
| 171 |
+
processor.batch_decode(outputs, skip_special_tokens=True)[0]
|
| 172 |
+
|
| 173 |
+
# [{"label": "statue", "bbox": [0.3, 0.25, 0.4, 0.65]}]
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
### Tool Use
|
| 177 |
+
|
| 178 |
+
LFM2.5 supports function calling for text only input by applying the chat template with the tokenizer. See the [Tool Use documentation](https://docs.liquid.ai/lfm/key-concepts/tool-use) for the full guide.
|
| 179 |
+
|
| 180 |
+
```python
|
| 181 |
+
tools = [{
|
| 182 |
+
"name": "get_weather",
|
| 183 |
+
"description": "Get current weather for a location",
|
| 184 |
+
"parameters": {
|
| 185 |
+
"type": "object",
|
| 186 |
+
"properties": {"location": {"type": "string"}},
|
| 187 |
+
"required": ["location"]
|
| 188 |
+
}
|
| 189 |
+
}]
|
| 190 |
+
|
| 191 |
+
messages = [{"role": "user", "content": "What's the weather in Paris?"}]
|
| 192 |
+
|
| 193 |
+
# Apply chat template with tools
|
| 194 |
+
inputs = processor.tokenizer.apply_chat_template(
|
| 195 |
+
messages,
|
| 196 |
+
tools=tools,
|
| 197 |
+
add_generation_prompt=True,
|
| 198 |
+
return_tensors="pt",
|
| 199 |
+
return_dict=True,
|
| 200 |
+
)
|
| 201 |
+
input_ids = inputs["input_ids"].to(model.device)
|
| 202 |
+
outputs = model.generate(input_ids, max_new_tokens=256)
|
| 203 |
+
response = processor.tokenizer.decode(outputs[0, input_ids.shape[1]:], skip_special_tokens=False)
|
| 204 |
+
|
| 205 |
+
# <|tool_call_start|>[get_weather(location="Paris")]<|tool_call_end|>I am retrieving the current weather for Paris.<|im_end|>
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
| Name | Description | Docs | Notebook |
|
| 209 |
+
|------|-------------|------|----------|
|
| 210 |
+
| [Transformers](https://github.com/huggingface/transformers) | Simple inference with direct access to model internals. | <a href="https://docs.liquid.ai/lfm/inference/transformers#vision-models">Link</a>| <a href="https://colab.research.google.com/drive/1WVQpf4XrHgHFkP0FnlZfx2nK8PugvQNZ?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 211 |
+
| [vLLM](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/vllm#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1sUfQlqAvuAVB4bZ6akYVQPGmHtTDUNpF?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 212 |
+
| [SGLang](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/sglang#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1qJlAFag223yFOZGzuMIkYUFhybM9ao5g?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 213 |
+
| [llama.cpp](https://github.com/ggml-org/llama.cpp) | Cross-platform inference with CPU offloading. | <a href="https://docs.liquid.ai/lfm/inference/llama-cpp#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1q2PjE6O_AahakRlkTNJGYL32MsdUcj7b?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 214 |
+
|
| 215 |
+
## 🔧 Fine-tuning
|
| 216 |
+
|
| 217 |
+
We recommend fine-tuning LFM2.5-VL-450M model on your use cases to maximize performance.
|
| 218 |
+
|
| 219 |
+
| Notebook | Description | Link |
|
| 220 |
+
|-----------|----------------------------------------------------------------------|------|
|
| 221 |
+
| SFT (Unsloth) | Supervised Fine-Tuning with LoRA using Unsloth. | <a href="https://colab.research.google.com/drive/1FaR2HSe91YDe88TG97-JVxMygl-rL6vB?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 222 |
+
| SFT (TRL) | Supervised Fine-Tuning with LoRA using TRL. | <a href="https://colab.research.google.com/drive/10530_jt_Joa5zH2wgYlyXosypq1R7PIz?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
## 📊 Performance
|
| 226 |
+
|
| 227 |
+
LFM2.5-VL-450M improves over LFM2-VL-450M across both vision and language benchmarks, while also adding two new capabilities: bounding box prediction on RefCOCO-M and function calling support measured by BFCLv4.
|
| 228 |
+
|
| 229 |
+
### Vision benchmarks
|
| 230 |
+
|
| 231 |
+
| Model | MMStar | RealWorldQA | MMBench (dev en) | MMMU (val) | POPE | MMVet | BLINK | InfoVQA (val) | OCRBench | MM-IFEval | MMMB | CountBench | RefCOCO-M |
|
| 232 |
+
|--------------------|--------|-------------|------------------|------------|------|-------|-------|---------------|----------|------------|------|------------|-----------|
|
| 233 |
+
| **LFM2.5-VL-450M** | 43.00 | 58.43 | 60.91 | 32.67 | 86.93| 41.10 | 43.92 | 43.02 | 684 | 45.00 | 68.09| 73.31 | 81.28 |
|
| 234 |
+
| LFM2-VL-450M | 40.87 | 52.03 | 56.27 | 34.44 | 83.79| 33.85 | 42.61 | 44.56 | 657 | 33.09 | 54.29| 47.64 | - |
|
| 235 |
+
| SmolVLM2-500M | 38.20 | 49.90 | 52.32 | 34.10 | 82.67| 29.90 | 40.70 | 24.64 | 609 | 11.27 | 46.79| 61.81 | - |
|
| 236 |
+
|
| 237 |
+
All vision benchmark scores are obtained using [VLMEvalKit](https://github.com/open-compass/VLMEvalKit). Multilingual scores are based on the average of benchmarks translated by GPT-4.1-mini from English to Arabic, Chinese, French, German, Japanese, Korean, Portuguese, and Spanish.
|
| 238 |
+
|
| 239 |
+
### Language benchmarks
|
| 240 |
+
|
| 241 |
+
| Model | GPQA | MMLU Pro | IFEval | Multi-IF | BFCLv4 |
|
| 242 |
+
|--------------------|------|----------|--------|----------|--------|
|
| 243 |
+
| **LFM2.5-VL-450M** | 25.66| 19.32 | 61.16 | 34.63 | 21.08 |
|
| 244 |
+
| LFM2-VL-450M | 23.13| 17.22 | 51.75 | 26.21 | - |
|
| 245 |
+
| SmolVLM2-500M | 23.84| 13.57 | 30.14 | 6.82 | - |
|
| 246 |
+
|
| 247 |
+
## 📬 Contact
|
| 248 |
+
|
| 249 |
+
- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)
|
| 250 |
+
- If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).
|
| 251 |
+
|
| 252 |
+
## Citation
|
| 253 |
+
|
| 254 |
+
```
|
| 255 |
+
@article{liquidai2025lfm2,
|
| 256 |
+
title={LFM2 Technical Report},
|
| 257 |
+
author={Liquid AI},
|
| 258 |
+
journal={arXiv preprint arXiv:2511.23404},
|
| 259 |
+
year={2025}
|
| 260 |
+
}
|
| 261 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
| 3 |
+
|
| 4 |
+
{%- macro format_arg_value(arg_value) -%}
|
| 5 |
+
{%- if arg_value is string -%}
|
| 6 |
+
{{- '"' + arg_value + '"' -}}
|
| 7 |
+
{%- elif arg_value is mapping -%}
|
| 8 |
+
{{- arg_value | tojson -}}
|
| 9 |
+
{%- else -%}
|
| 10 |
+
{{- arg_value | string -}}
|
| 11 |
+
{%- endif -%}
|
| 12 |
+
{%- endmacro -%}
|
| 13 |
+
|
| 14 |
+
{%- macro parse_content(content) -%}
|
| 15 |
+
{%- if content is string -%}
|
| 16 |
+
{{- content -}}
|
| 17 |
+
{%- else -%}
|
| 18 |
+
{%- set _ns = namespace(result="") -%}
|
| 19 |
+
{%- for item in content -%}
|
| 20 |
+
{%- if item.type == "image" -%}
|
| 21 |
+
{%- set _ns.result = _ns.result + "<image>" -%}
|
| 22 |
+
{%- elif item.type == "text" -%}
|
| 23 |
+
{%- set _ns.result = _ns.result + item.text -%}
|
| 24 |
+
{%- else -%}
|
| 25 |
+
{%- set _ns.result = _ns.result + item | tojson -%}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{{- _ns.result -}}
|
| 29 |
+
{%- endif -%}
|
| 30 |
+
{%- endmacro -%}
|
| 31 |
+
|
| 32 |
+
{%- macro render_tool_calls(tool_calls) -%}
|
| 33 |
+
{%- set tool_calls_ns = namespace(tool_calls=[]) -%}
|
| 34 |
+
{%- for tool_call in tool_calls -%}
|
| 35 |
+
{%- set func_name = tool_call.function.name -%}
|
| 36 |
+
{%- set func_args = tool_call.function.arguments -%}
|
| 37 |
+
{%- set args_ns = namespace(arg_strings=[]) -%}
|
| 38 |
+
{%- for arg_name, arg_value in func_args.items() -%}
|
| 39 |
+
{%- set args_ns.arg_strings = args_ns.arg_strings + [arg_name + "=" + format_arg_value(arg_value)] -%}
|
| 40 |
+
{%- endfor -%}
|
| 41 |
+
{%- set tool_calls_ns.tool_calls = tool_calls_ns.tool_calls + [func_name + "(" + (args_ns.arg_strings | join(", ")) + ")"] -%}
|
| 42 |
+
{%- endfor -%}
|
| 43 |
+
{{- "<|tool_call_start|>[" + (tool_calls_ns.tool_calls | join(", ")) + "]<|tool_call_end|>" -}}
|
| 44 |
+
{%- endmacro -%}
|
| 45 |
+
|
| 46 |
+
{%- set ns = namespace(system_prompt="", last_assistant_index=-1) -%}
|
| 47 |
+
{%- if messages[0].role == "system" -%}
|
| 48 |
+
{%- if messages[0].content is defined -%}
|
| 49 |
+
{%- set ns.system_prompt = parse_content(messages[0].content) -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
{%- set messages = messages[1:] -%}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
{%- if tools -%}
|
| 54 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n\n" if ns.system_prompt else "") + "Today's date: " + strftime_now("%Y-%m-%d") + "\n\nList of tools: " + (tools | tojson) -%}
|
| 55 |
+
{%- endif -%}
|
| 56 |
+
{%- if ns.system_prompt -%}
|
| 57 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- for message in messages -%}
|
| 60 |
+
{%- if message.role == "assistant" -%}
|
| 61 |
+
{%- set ns.last_assistant_index = loop.index0 -%}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
{%- endfor -%}
|
| 64 |
+
{%- for message in messages -%}
|
| 65 |
+
{{- "<|im_start|>" + message.role + "\n" -}}
|
| 66 |
+
{%- if message.role == "assistant" -%}
|
| 67 |
+
{%- generation -%}
|
| 68 |
+
{%- if message.thinking is defined and (keep_past_thinking or loop.index0 == ns.last_assistant_index) -%}
|
| 69 |
+
{{- "<think>" + message.thinking + "</think>" -}}
|
| 70 |
+
{%- endif -%}
|
| 71 |
+
{%- if message.tool_calls is defined -%}
|
| 72 |
+
{{- render_tool_calls(message.tool_calls) -}}
|
| 73 |
+
{%- endif -%}
|
| 74 |
+
{%- if message.content is defined -%}
|
| 75 |
+
{%- set content = parse_content(message.content) -%}
|
| 76 |
+
{%- if not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 77 |
+
{%- if "</think>" in content -%}
|
| 78 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 79 |
+
{%- endif -%}
|
| 80 |
+
{%- endif -%}
|
| 81 |
+
{{- content + ("" if (continue_final_message and loop.last) else "<|im_end|>\n") -}}
|
| 82 |
+
{%- endif -%}
|
| 83 |
+
{%- endgeneration -%}
|
| 84 |
+
{%- else %}
|
| 85 |
+
{%- if message.content is defined -%}
|
| 86 |
+
{{- parse_content(message.content) + "<|im_end|>\n" -}}
|
| 87 |
+
{%- endif -%}
|
| 88 |
+
{%- endif %}
|
| 89 |
+
{%- endfor -%}
|
| 90 |
+
{%- if add_generation_prompt -%}
|
| 91 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 92 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2VlForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"do_image_splitting": true,
|
| 6 |
+
"downsample_factor": 2,
|
| 7 |
+
"dtype": "bfloat16",
|
| 8 |
+
"encoder_patch_size": 16,
|
| 9 |
+
"image_token_id": 396,
|
| 10 |
+
"max_image_tokens": 256,
|
| 11 |
+
"max_pixels_tolerance": 2.0,
|
| 12 |
+
"max_tiles": 10,
|
| 13 |
+
"min_image_tokens": 64,
|
| 14 |
+
"min_tiles": 2,
|
| 15 |
+
"model_type": "lfm2_vl",
|
| 16 |
+
"projector_bias": true,
|
| 17 |
+
"projector_hidden_act": "gelu",
|
| 18 |
+
"projector_hidden_size": 2048,
|
| 19 |
+
"projector_use_layernorm": false,
|
| 20 |
+
"text_config": {
|
| 21 |
+
"_name_or_path": "LiquidAI/LFM2-350M",
|
| 22 |
+
"architectures": [
|
| 23 |
+
"Lfm2ForCausalLM"
|
| 24 |
+
],
|
| 25 |
+
"block_auto_adjust_ff_dim": true,
|
| 26 |
+
"block_dim": 1024,
|
| 27 |
+
"block_ff_dim": 6656,
|
| 28 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 29 |
+
"block_mlp_init_scale": 1.0,
|
| 30 |
+
"block_multiple_of": 256,
|
| 31 |
+
"block_norm_eps": 1e-05,
|
| 32 |
+
"block_out_init_scale": 1.0,
|
| 33 |
+
"block_use_swiglu": true,
|
| 34 |
+
"block_use_xavier_init": true,
|
| 35 |
+
"conv_L_cache": 3,
|
| 36 |
+
"conv_bias": false,
|
| 37 |
+
"conv_dim": 1024,
|
| 38 |
+
"conv_dim_out": 1024,
|
| 39 |
+
"conv_use_xavier_init": true,
|
| 40 |
+
"dtype": "bfloat16",
|
| 41 |
+
"eos_token_id": 7,
|
| 42 |
+
"hidden_size": 1024,
|
| 43 |
+
"initializer_range": 0.02,
|
| 44 |
+
"intermediate_size": 6656,
|
| 45 |
+
"layer_types": [
|
| 46 |
+
"conv",
|
| 47 |
+
"conv",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"conv",
|
| 50 |
+
"conv",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"conv",
|
| 53 |
+
"conv",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"conv",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"conv",
|
| 58 |
+
"full_attention",
|
| 59 |
+
"conv",
|
| 60 |
+
"full_attention",
|
| 61 |
+
"conv"
|
| 62 |
+
],
|
| 63 |
+
"max_position_embeddings": 128000,
|
| 64 |
+
"model_type": "lfm2",
|
| 65 |
+
"norm_eps": 1e-05,
|
| 66 |
+
"num_attention_heads": 16,
|
| 67 |
+
"num_heads": 16,
|
| 68 |
+
"num_hidden_layers": 16,
|
| 69 |
+
"num_key_value_heads": 8,
|
| 70 |
+
"rope_parameters": {
|
| 71 |
+
"rope_theta": 1000000.0,
|
| 72 |
+
"rope_type": "default"
|
| 73 |
+
},
|
| 74 |
+
"use_cache": true,
|
| 75 |
+
"use_pos_enc": true,
|
| 76 |
+
"vocab_size": 65536
|
| 77 |
+
},
|
| 78 |
+
"tile_size": 512,
|
| 79 |
+
"transformers_version": "5.0.0.dev0",
|
| 80 |
+
"use_image_special_tokens": true,
|
| 81 |
+
"use_thumbnail": true,
|
| 82 |
+
"vision_config": {
|
| 83 |
+
"attention_dropout": 0.0,
|
| 84 |
+
"dtype": "bfloat16",
|
| 85 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 86 |
+
"hidden_size": 768,
|
| 87 |
+
"intermediate_size": 3072,
|
| 88 |
+
"layer_norm_eps": 1e-06,
|
| 89 |
+
"model_type": "siglip2_vision_model",
|
| 90 |
+
"num_attention_heads": 12,
|
| 91 |
+
"num_channels": 3,
|
| 92 |
+
"num_hidden_layers": 12,
|
| 93 |
+
"num_patches": 256,
|
| 94 |
+
"patch_size": 16,
|
| 95 |
+
"vision_use_head": false
|
| 96 |
+
}
|
| 97 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 7,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "5.0.0.dev0"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f6deb5dd43707de5cfe3c59470d3bccf4c3112a810a74570499f4728d412eea
|
| 3 |
+
size 897484568
|
processor_config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"data_format": "channels_first",
|
| 4 |
+
"do_image_splitting": true,
|
| 5 |
+
"do_normalize": true,
|
| 6 |
+
"do_pad": true,
|
| 7 |
+
"do_rescale": true,
|
| 8 |
+
"do_resize": true,
|
| 9 |
+
"downsample_factor": 2,
|
| 10 |
+
"encoder_patch_size": 16,
|
| 11 |
+
"image_mean": [
|
| 12 |
+
0.5,
|
| 13 |
+
0.5,
|
| 14 |
+
0.5
|
| 15 |
+
],
|
| 16 |
+
"image_processor_type": "Lfm2VlImageProcessorFast",
|
| 17 |
+
"image_std": [
|
| 18 |
+
0.5,
|
| 19 |
+
0.5,
|
| 20 |
+
0.5
|
| 21 |
+
],
|
| 22 |
+
"max_image_tokens": 256,
|
| 23 |
+
"max_num_patches": 1024,
|
| 24 |
+
"max_pixels_tolerance": 2.0,
|
| 25 |
+
"max_tiles": 10,
|
| 26 |
+
"min_image_tokens": 64,
|
| 27 |
+
"min_tiles": 2,
|
| 28 |
+
"resample": 2,
|
| 29 |
+
"rescale_factor": 0.00392156862745098,
|
| 30 |
+
"return_row_col_info": true,
|
| 31 |
+
"size": {
|
| 32 |
+
"height": 512,
|
| 33 |
+
"width": 512
|
| 34 |
+
},
|
| 35 |
+
"tile_size": 512,
|
| 36 |
+
"use_thumbnail": true
|
| 37 |
+
},
|
| 38 |
+
"processor_class": "Lfm2VlProcessor"
|
| 39 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|startoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": true,
|
| 5 |
+
"eos_token": "<|im_end|>",
|
| 6 |
+
"extra_special_tokens": [],
|
| 7 |
+
"image_end_token": "<|image_end|>",
|
| 8 |
+
"image_start_token": "<|image_start|>",
|
| 9 |
+
"image_thumbnail": "<|img_thumbnail|>",
|
| 10 |
+
"image_token": "<image>",
|
| 11 |
+
"is_local": true,
|
| 12 |
+
"legacy": false,
|
| 13 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"image_end_token": "<|image_end|>",
|
| 16 |
+
"image_start_token": "<|image_start|>",
|
| 17 |
+
"image_token": "<image>"
|
| 18 |
+
},
|
| 19 |
+
"pad_token": "<|pad|>",
|
| 20 |
+
"processor_class": "Lfm2VlProcessor",
|
| 21 |
+
"return_token_type_ids": false,
|
| 22 |
+
"sp_model_kwargs": {},
|
| 23 |
+
"spaces_between_special_tokens": false,
|
| 24 |
+
"tokenizer_class": "TokenizersBackend",
|
| 25 |
+
"use_default_system_prompt": false,
|
| 26 |
+
"use_fast": true
|
| 27 |
+
}
|