Repository navigation
Add LLaVA-OneVision-1.5 model and related configurations #41095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <!--Copyright 2026 The HuggingFace Team. All rights reserved. | ||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations under the License. | ||
| ⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be | ||
| rendered properly in your Markdown viewer. | ||
| --> | ||
| *This model was contributed to Hugging Face Transformers on 2026-11-11.* | ||
|
|
||
| # LLaVA-OneVision-1.5 | ||
|
|
||
| ## Overview | ||
|
|
||
| LLaVA-OneVision-1.5 was introduced in [LLaVA-OneVision-1.5: Fully Open Framework for Democratized Multimodal Training](https://huggingface.co/papers/2509.23661). | ||
| 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. | ||
|
|
||
| Transformers supports the [4B checkpoint](https://huggingface.co/Deep-VLM/LLaVA-OneVision-1.5-4B-Instruct-hf). Use left padding for batched generation. | ||
|
|
||
| The paper describes the work as follows: | ||
|
|
||
| *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.* | ||
|
|
||
| ## Usage | ||
|
|
||
| ```python | ||
| from transformers import AutoModelForImageTextToText, AutoProcessor | ||
|
|
||
| model_id = "Deep-VLM/LLaVA-OneVision-1.5-4B-Instruct-hf" | ||
| processor = AutoProcessor.from_pretrained(model_id) | ||
| model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto") | ||
|
|
||
| messages = [{"role": "user", "content": [ | ||
| {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg"}, | ||
| {"type": "text", "text": "Describe the image."}, | ||
| ]}] | ||
|
|
||
| inputs = processor.apply_chat_template( | ||
| messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" | ||
| ).to(model.device) | ||
|
|
||
| output = model.generate(**inputs, max_new_tokens=64) | ||
|
|
||
| processor.batch_decode(output[:, inputs.input_ids.shape[1]:], skip_special_tokens=True) | ||
| ``` | ||
|
|
||
| ## LlavaOnevision15Config | ||
|
|
||
| [[autodoc]] LlavaOnevision15Config | ||
|
|
||
| ## LlavaOnevision15VisionConfig | ||
|
|
||
| [[autodoc]] LlavaOnevision15VisionConfig | ||
|
|
||
| ## LlavaOnevision15VisionModel | ||
|
|
||
| [[autodoc]] LlavaOnevision15VisionModel | ||
| - forward | ||
|
|
||
| ## LlavaOnevision15Model | ||
|
|
||
| [[autodoc]] LlavaOnevision15Model | ||
| - forward | ||
|
|
||
| ## LlavaOnevision15ForConditionalGeneration | ||
|
|
||
| [[autodoc]] LlavaOnevision15ForConditionalGeneration | ||
| - forward | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,7 @@ | |
| ("hyperclovax_vision_v2", {"torchvision": "Qwen2VLVideoProcessor"}), | ||
| ("instructblip", {"torchvision": "InstructBlipVideoVideoProcessor"}), | ||
| ("lfm3_vl", {"torchvision": "Qwen3VLVideoProcessor"}), | ||
| ("llava_onevision1_5", {"torchvision": "Qwen2VLVideoProcessor"}), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super super nice on mapping processors to existing classes 🫶 |
||
| ("minicpmv4_7", {"torchvision": "MiniCPMV4_6VideoProcessor"}), | ||
| ("muse_spark", {"torchvision": "MuseGlimmerVideoProcessor"}), | ||
| ("pe_audio_video", {"torchvision": "PeVideoVideoProcessor"}), | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niit: just a little more spacing for readability would be nice