|
| 1 | +<!--Copyright 2025 The HuggingFace Team. All rights reserved. |
| 2 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 3 | +the License. You may obtain a copy of the License at |
| 4 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 5 | +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 6 | +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 7 | +specific language governing permissions and limitations under the License. |
| 8 | +⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be |
| 9 | +rendered properly in your Markdown viewer. |
| 10 | +--> |
| 11 | +*This model was contributed to Hugging Face Transformers on 2026-10-22.* |
| 12 | + |
| 13 | +# LLaVA-OneVision-1.5 |
| 14 | + |
| 15 | +LLaVA-OneVision-1.5 was introduced in [LLaVA-OneVision-1.5: Fully Open Framework for Democratized Multimodal Training](https://huggingface.co/papers/2509.23661). |
| 16 | +It combines a native resolution vision encoder with a Qwen3 language backbone. The vision encoder adds a learned class token to each image, applies full attention, removes the class token, and merges spatial patches into visual features for the language model. The language backbone uses ordinary one dimensional rotary positions for the combined image and text sequence. |
| 17 | + |
| 18 | +The implementation reuses the Qwen2.5-VL processor and supports the converted [4B checkpoint](https://huggingface.co/Deep-VLM/LLaVA-OneVision-1.5-4B-Instruct-hf). Use left padding for batched generation. |
| 19 | + |
| 20 | +## Abstract |
| 21 | + |
| 22 | +The [paper's abstract](https://arxiv.org/abs/2509.23661) describes an open framework for training vision-language models from scratch at a reduced cost. Its release includes a concept-balanced collection of 85 million pretraining examples, a curated instruction dataset containing 22 million examples, and a training system that uses offline parallel packing. The authors report a training budget of $16,000. In their evaluation, the 8B model exceeds Qwen2.5-VL-7B on 18 out of 27 benchmarks, while the 4B model exceeds Qwen2.5-VL-3B on all 27. The report also describes a lightweight reinforcement learning stage that improves multimodal reasoning through chain-of-thought responses. |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +```python |
| 27 | +from transformers import AutoProcessor, LlavaOnevision15ForConditionalGeneration |
| 28 | + |
| 29 | +model_id = "Deep-VLM/LLaVA-OneVision-1.5-4B-Instruct-hf" |
| 30 | +processor = AutoProcessor.from_pretrained(model_id) |
| 31 | +model = LlavaOnevision15ForConditionalGeneration.from_pretrained(model_id, device_map="auto") |
| 32 | +messages = [{"role": "user", "content": [ |
| 33 | + {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg"}, |
| 34 | + {"type": "text", "text": "Describe the image."}, |
| 35 | +]}] |
| 36 | +inputs = processor.apply_chat_template( |
| 37 | + messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" |
| 38 | +).to(model.device) |
| 39 | +output = model.generate(**inputs, max_new_tokens=64) |
| 40 | +processor.batch_decode(output[:, inputs.input_ids.shape[1]:], skip_special_tokens=True) |
| 41 | +``` |
| 42 | + |
| 43 | +## LlavaOnevision15Config |
| 44 | + |
| 45 | +[[autodoc]] LlavaOnevision15Config |
| 46 | + |
| 47 | +## LlavaOnevision15VisionConfig |
| 48 | + |
| 49 | +[[autodoc]] LlavaOnevision15VisionConfig |
| 50 | + |
| 51 | +## LlavaOnevision15VisionModel |
| 52 | + |
| 53 | +[[autodoc]] LlavaOnevision15VisionModel |
| 54 | + - forward |
| 55 | + |
| 56 | +## LlavaOnevision15Model |
| 57 | + |
| 58 | +[[autodoc]] LlavaOnevision15Model |
| 59 | + - forward |
| 60 | + |
| 61 | +## LlavaOnevision15ForConditionalGeneration |
| 62 | + |
| 63 | +[[autodoc]] LlavaOnevision15ForConditionalGeneration |
| 64 | + - forward |
0 commit comments