Skip to content
Open
Show file tree
Hide file tree
Changes from 191 commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
c8a10f0
Add Ovis2.5 model support
Jul 30, 2026
93f0200
Fix Ovis2.5 processor autodoc entry
Jul 30, 2026
c417022
Use v5 weight conversion for Ovis2.5 checkpoints
Aug 6, 2026
8768c8b
Generate Ovis2.5 image processing from modular source
Aug 6, 2026
5aa5a42
Fix Ovis2.5 model and processor contracts
Aug 7, 2026
9d8e332
Fix Ovis2.5 documentation examples
Aug 11, 2026
0e952e7
Use standard Ovis2.5 image normalization constants
Aug 12, 2026
cb4d399
Remove the Ovis2.5 language config alias
Aug 12, 2026
bd0ed48
Remove the Ovis2.5 vision config alias
Aug 12, 2026
38acf19
Use conversion for original Ovis2.5 configs
Aug 12, 2026
ad04b36
Use released Ovis2.5 patch embedding layout
Aug 12, 2026
ca5af4e
Remove unused Ovis2.5 linear patch path
Aug 12, 2026
f0f7a01
Base Ovis2.5 vision blocks on VideoLlama3
Aug 12, 2026
55219dd
Reuse the VideoLlama3 vision block forward
Aug 12, 2026
dbb20fb
Reuse VideoLlama3 vision block initialization
Aug 12, 2026
58a4e40
Derive Ovis2.5 vision layer types
Aug 12, 2026
16b8a20
Dispatch Ovis2.5 vision layers by type
Aug 12, 2026
25883c8
Restore Ovis2.5 vision order once per forward
Aug 12, 2026
30cb813
Reuse the VideoLlama3 base model output
Aug 12, 2026
43b3345
Reuse the VideoLlama3 causal model output
Aug 12, 2026
4ed8e04
Base Ovis2.5 models on VideoLlama3
Aug 12, 2026
1d422dd
Reuse VideoLlama3 vision rotary embedding
Aug 12, 2026
070b16d
Reuse VideoLlama3 weight initialization
Aug 12, 2026
b035a24
Use initialized Ovis2.5 sub-configs directly
Aug 12, 2026
89b2e8c
Use the initialized Ovis2.5 text config
Aug 12, 2026
6db3ff1
Use inherited Ovis2.5 input embeddings getter
Aug 12, 2026
eda5a46
Use inherited Ovis2.5 input embeddings setter
Aug 12, 2026
94a0cdd
Project soft Ovis2.5 visual tokens explicitly
Aug 12, 2026
4ea30f3
Use a standard Ovis2.5 visual embedding table
Aug 12, 2026
82f2a27
Remove the custom Ovis2.5 embedding table
Aug 12, 2026
79716d0
Separate the Ovis2.5 visual tokenizer
Aug 12, 2026
45e9dc2
Build Ovis2.5 visual embeddings in image features
Aug 12, 2026
1618c22
Delegate Ovis2.5 video feature extraction
Aug 12, 2026
ddad5d8
Remove duplicate Ovis2.5 visual feature helper
Aug 12, 2026
527181b
Use standard Ovis2.5 placeholder token ids
Aug 12, 2026
ee5f0fb
Remove the duplicate Ovis2.5 visual atom id
Aug 12, 2026
c4d36b0
Base Ovis2.5 multimodal merging on Ovis2
Aug 12, 2026
431b47a
Base Ovis2.5 conditional generation on Ovis2
Aug 12, 2026
d4deeed
Reuse the Ovis2 output embeddings getter
Aug 12, 2026
50abc85
Use standard Ovis2.5 output embeddings setter
Aug 12, 2026
5c9bd4a
Reuse the Ovis2 image feature wrapper
Aug 12, 2026
5f7240e
Reuse the Ovis2 placeholder mask
Aug 12, 2026
2818257
Remove the duplicate Ovis2.5 token mask helper
Aug 12, 2026
29ad775
Follow the Ovis2 visual merge flow
Aug 12, 2026
f98ebf1
Remove duplicate Ovis2.5 visual merge helper
Aug 12, 2026
92fcfc6
Use standard Ovis2.5 grid validation
Aug 12, 2026
e0541aa
Use generated Ovis2.5 grid documentation
Aug 12, 2026
c476ba2
Format Ovis2.5 review fixes
Aug 12, 2026
3f79a3a
Document Ovis2.5 grid arguments
Aug 12, 2026
d704dbf
Refresh Ovis2.5 documentation metadata
Aug 12, 2026
2627fde
Reuse the recorded Ovis2.5 final vision state
Aug 12, 2026
0a70ae6
Tighten Ovis2.5 model typing
Aug 12, 2026
6887059
Move legacy Ovis2.5 vision config conversion
Aug 12, 2026
b359bd6
Use tokenizer Ovis2.5 special token IDs
Aug 12, 2026
207171f
Remove duplicate Ovis2.5 token validation
Aug 12, 2026
abe1360
Use standard Ovis2.5 input validation
Aug 12, 2026
6c304ed
Normalize Ovis2.5 visual inputs before validation
Aug 12, 2026
cf2ce69
Handle empty Ovis2.5 visual batches
Aug 12, 2026
61a6242
Validate normalized Ovis2.5 visual inputs
Aug 12, 2026
59cad44
Reuse image backend equivalence tests
Aug 12, 2026
88c024d
Reuse Ovis2.5 processor test inputs
Aug 12, 2026
3af404d
Clean up Ovis2.5 test modules
Aug 12, 2026
5cdd101
Document Ovis2.5 processor regressions
Aug 12, 2026
1f0f160
Move Ovis2.5 model testers outside torch guard
Aug 12, 2026
4dc5a7b
Explain Ovis2.5 common test overrides
Aug 12, 2026
3fb86a5
Refresh Ovis2.5 model documentation date
Aug 12, 2026
c25e32c
Expose Ovis2.5 tester model classes
Aug 12, 2026
d37b914
Merge branch 'main' into add-ovis2-5
zucchini-nlp Aug 18, 2026
9239137
Merge branch 'huggingface:main' into add-ovis2-5
sushmanthreddy Aug 18, 2026
a33c006
Fix video processor auto mapping order
Aug 18, 2026
14cd6f3
Regenerate Ovis2.5 after main sync
Aug 18, 2026
bbadf16
Document Ovis2.5 position embedding paths
Aug 18, 2026
50d7116
Keep Ovis2.5 position grids on device
Aug 18, 2026
3976512
Enable Ovis2.5 vision checkpointing
Aug 18, 2026
2e8f28f
Use standard Ovis2.5 vision output flags
Aug 18, 2026
a1cbb37
Delegate Ovis2.5 output capture
Aug 18, 2026
a13acab
Keep Ovis2.5 boundary counts traceable
Aug 18, 2026
9bf9e2b
Create Ovis2.5 generation markers on device
Aug 18, 2026
0677f50
Name Ovis2.5 visual projector layers
Aug 18, 2026
0c33064
Refresh Ovis2.5 generated metadata
Aug 18, 2026
8df2c27
Reuse standard Ovis2.5 layer validation
Aug 18, 2026
ba7abb7
Keep released Ovis2.5 position embeddings
Aug 18, 2026
30cb8a3
Keep released Ovis2.5 vision RoPE
Aug 18, 2026
5b0e5ac
Use generic Ovis2.5 text config
Aug 18, 2026
c84ace1
Keep Ovis2.5 visual vocabulary in vision config
Aug 18, 2026
dc9a2de
Reuse GLM4V Ovis2.5 image processing
Aug 18, 2026
63101cb
Use shared Ovis2.5 position interpolation
Aug 18, 2026
9742ddc
Use fixed Ovis2.5 indicator padding
Aug 18, 2026
a9c0664
Use standard Ovis2.5 vision embedding access
Aug 18, 2026
b6ee2a7
Reuse GLM4V Ovis2.5 video processing
Aug 18, 2026
d68dfde
Use tokenizer Ovis2.5 visual tokens
Aug 18, 2026
06fca64
Expand Ovis2.5 image tokens with standard names
Aug 18, 2026
b0f8054
Expand Ovis2.5 video tokens with standard names
Aug 18, 2026
e1f16fb
Use standard Ovis2.5 multimodal token checks
Aug 18, 2026
b0dc863
Remove Ovis2.5 visual token aliases
Aug 18, 2026
8e0bd13
Reuse Qwen2-VL conditional generation
Aug 18, 2026
0bcecf1
Normalize Ovis2.5 chat placeholders
Aug 18, 2026
2205d7a
Clarify Ovis2.5 vision output ordering
Aug 18, 2026
ffce069
Let Ovis2.5 validation consume audio kwargs
Aug 18, 2026
ff51263
Use standard Ovis2.5 text postprocessing
Aug 18, 2026
323fccf
Format Ovis2.5 processor
Aug 18, 2026
9f8f9ef
Use shared Ovis2.5 argument documentation
Aug 18, 2026
559f360
Cover Ovis2.5 fallback processor reload
Aug 18, 2026
ff3dfdd
Simplify Ovis2.5 visual feature merging
Aug 18, 2026
ba20182
Merge remote-tracking branch 'upstream/main' into add-ovis2-5
Aug 18, 2026
e73f052
Merge remote-tracking branch 'upstream/main' into add-ovis2-5
Aug 18, 2026
ea6043f
Use standard Ovis2.5 video size arguments
Aug 18, 2026
1e8ce32
Use standard Ovis2.5 hidden state capture
Aug 18, 2026
629165e
Restore Ovis2.5 patch order once
Aug 18, 2026
91dce73
Remove unused Ovis2.5 state recorder module
Aug 18, 2026
6b43134
Drop the Ovis2.5 patch order recorder
Aug 18, 2026
c5b3d76
Enable Ovis2.5 torch export
Aug 18, 2026
37cf216
Load legacy Ovis2.5 Hub configs
Aug 18, 2026
91057e5
Register released Ovis2.5 visual tokens
Aug 18, 2026
23d22ef
Cover released Ovis2.5 processor metadata
Aug 18, 2026
8b317a0
Load released Ovis2.5 checkpoints directly
Aug 18, 2026
a1614a8
Clean up Ovis2.5 loading example
Aug 19, 2026
c846b90
Simplify Ovis2.5 video input normalization
Aug 19, 2026
667eb5e
Reuse Qwen2VL generation expansion
Aug 19, 2026
e8a13d0
Load native Ovis2.5 processors from legacy metadata
Aug 19, 2026
6fedae3
Simplify Ovis2.5 processor loading example
Aug 19, 2026
eca7608
Simplify Ovis2.5 visual embedding initialization
Aug 19, 2026
363a498
Move Ovis2.5 legacy attention config handling
Aug 19, 2026
be9e1ab
Simplify Ovis2.5 legacy vision config loading
Aug 19, 2026
41612bc
Generate Ovis2.5 video processing from modular source
Aug 19, 2026
e57d3c3
Reuse Exaone4.5 generation helpers
Aug 19, 2026
48a7833
Use standard Ovis2.5 generation positions
Aug 19, 2026
4e8c776
Update Ovis2.5 contribution date
Aug 19, 2026
8e7ef36
Reuse packed vision embeddings for Ovis2.5
Aug 19, 2026
b9cb2ce
Reuse packed interpolation in Ovis2.5 vision embeddings
Aug 19, 2026
a18b8c6
Remove unused Ovis2.5 interpolation method
Aug 19, 2026
75afc71
Reuse Muse Glimmer vision structure for Ovis2.5
Aug 19, 2026
ff65a0a
Remove unused Ovis2.5 pixel shuffle
Aug 19, 2026
8968f75
Reuse windowed vision flow for Ovis2.5
Aug 19, 2026
52f9c87
Remove duplicate Ovis2.5 vision encoder flow
Aug 19, 2026
6817a23
Test Ovis2.5 window order and vision keys
Aug 19, 2026
b9a4cb2
Remove unused Ovis2.5 position buffer
Aug 19, 2026
6e0186b
Use shared Ovis2.5 video normalization defaults
Aug 20, 2026
a1ed9e8
Remove unused Ovis2.5 video defaults
Aug 20, 2026
a03d283
Reuse Cosmos3 Edge vision config for Ovis2.5
Aug 20, 2026
514dc12
Use standard merge size in Ovis2.5 embeddings
Aug 20, 2026
3a72197
Use standard merge size in Ovis2.5 projector
Aug 20, 2026
94286f1
Use standard merge size in Ovis2.5 vision
Aug 20, 2026
54ddcaa
Use standard merge size for Ovis2.5 positions
Aug 20, 2026
12bb07a
Use standard merge size for Ovis2.5 features
Aug 20, 2026
0d15922
Standardize Ovis2.5 spatial merge config
Aug 20, 2026
e71173a
Reuse Muse Glimmer rotary embeddings for Ovis2.5
Aug 20, 2026
4dd0424
Map Exaone generation model to Ovis2.5
Aug 20, 2026
a8232b5
Reuse Ovis2.5 conditional initialization
Aug 20, 2026
e71a29d
Reuse Exaone4.5 conditional forward
Aug 20, 2026
ada5629
Keep copied Ovis2.5 constructor private
Aug 20, 2026
3a4bbec
Remove unused Ovis2.5 causal output
Aug 20, 2026
5d1cb7e
Update Ovis2.5 rotary hook test
Aug 20, 2026
175a08a
Apply Ovis2.5 repository fixes
Aug 20, 2026
b0dd4f2
Reuse Cosmos3 Edge vision config defaults
Aug 20, 2026
b6759f9
Drop Ovis2.5 hidden stride remapping
Aug 20, 2026
0418b5d
Use Ovis2.5 model in copied constructor
Aug 20, 2026
e225ed8
Initialize Ovis2.5 indicator padding
Aug 24, 2026
4bf53d1
Update Ovis2.5 contribution date
Aug 24, 2026
0ff22ed
Refine Ovis2.5 processors and docs
Sep 5, 2026
310c51f
Remove Ovis2.5 video frame sampling
Sep 5, 2026
89b9e46
Remove unnecessary Ovis2.5 copy markers
Sep 5, 2026
59e2ecb
Document Ovis2.5 smart resize overrides
Sep 5, 2026
2cdf0ca
Preserve legacy Ovis2.5 config kwargs
Sep 5, 2026
1082780
Simplify Ovis2.5 vision embeddings
Sep 5, 2026
a4bff02
Refactor Ovis2.5 multimodal feature insertion
Sep 5, 2026
581d0f6
Fix Ovis2.5 tokenizer integration
Sep 5, 2026
2b619db
Fix Ovis2.5 vision weight mapping
Sep 23, 2026
e71ca18
Remove standalone Ovis2.5 conversion test
Sep 23, 2026
410c327
Document Ovis2.5 video processor differences
Sep 27, 2026
81e8565
Generalize Ovis2.5 vision config annotation
Sep 27, 2026
fe583f6
Mark Ovis2.5 legacy config mapping as BC
Sep 27, 2026
f15b6ef
Document native Ovis2.5 community checkpoints
sushmanthreddy Sep 27, 2026
6d03baf
Simplify Ovis2.5 vision interpolation
sushmanthreddy Sep 28, 2026
db8ff59
Reuse vision window helpers in Ovis2.5
sushmanthreddy Sep 28, 2026
7fb9bd8
Share visual feature insertion in Ovis2.5 forward
sushmanthreddy Sep 28, 2026
85f56ff
Move Ovis2.5 visual embedding merge into helper
sushmanthreddy Sep 28, 2026
2f5afca
Remove redundant Ovis2.5 modular post-init call
sushmanthreddy Sep 28, 2026
63952c3
Clarify Ovis2.5 generation reuse and processor tokens
sushmanthreddy Sep 28, 2026
70e068d
Simplify Ovis2.5 tests around shared VLM suites
sushmanthreddy Sep 28, 2026
50eeaec
Keep Ovis2.5 vision logic local
sushmanthreddy Sep 28, 2026
05879ae
Merge upstream main and resolve Ovis2.5 registration conflict
sushmanthreddy Sep 28, 2026
3bfd1d1
Fix Ovis2.5 checkpoint weight mappings
sushmanthreddy Oct 12, 2026
86755e2
Merge upstream main and resolve Ovis2.5 registrations
sushmanthreddy Oct 12, 2026
ce48626
Fix Ovis2.5 tests and modular consistency
sushmanthreddy Oct 13, 2026
d7cd4fa
Merge upstream main and resolve Ovis2.5 conflict
sushmanthreddy Oct 20, 2026
133cb51
added some changes
sushmanthreddy Nov 2, 2026
137dac5
Simplify Ovis2.5 tests and reuse shared processor fixtures
sushmanthreddy Nov 12, 2026
7c4d2df
Simplify Ovis2.5 model, image and video tests
sushmanthreddy Nov 12, 2026
f39f7ef
Merge branch 'main' into add-ovis2-5
sushmanthreddy Nov 12, 2026
7f12fad
Restore upstream gitattributes
sushmanthreddy Nov 12, 2026
09d77d3
Simplify Ovis2.5 processor usage wording
sushmanthreddy Nov 14, 2026
6342031
Show Ovis2.5 usage restrictions before examples
sushmanthreddy Nov 14, 2026
86ca641
Move Ovis2.5 thinking budget limitation into usage warning
sushmanthreddy Nov 14, 2026
f4cb282
Use native Ovis2.5 tokenizer token attributes
sushmanthreddy Nov 14, 2026
6ae61e7
Remove Ovis2.5 legacy processor loading workaround
sushmanthreddy Nov 14, 2026
559ea00
Reuse shared Ovis2.5 input layout handling
sushmanthreddy Nov 14, 2026
cbf9779
Remove redundant Ovis2.5 modular comments
sushmanthreddy Nov 14, 2026
b7e2413
Validate Ovis2.5 image resize bounds
sushmanthreddy Nov 14, 2026
ca80d1a
Improve Ovis2.5 patch-count helper spacing
sushmanthreddy Nov 14, 2026
98c1b33
Point Ovis2.5 config docs to community checkpoint
sushmanthreddy Nov 14, 2026
c7936d4
Sync main and migrate Ovis2.5 to cache API
sushmanthreddy Nov 14, 2026
9328bec
Remove legacy Ovis2.5 config aliases
sushmanthreddy Nov 14, 2026
4340d34
Remove Ovis2.5 weight-tying config fallback
sushmanthreddy Nov 14, 2026
46eb48e
Reuse MiniCPM vision embedding initialization in Ovis2.5
sushmanthreddy Nov 14, 2026
b970de5
Simplify Ovis2.5 visual projector layer names
sushmanthreddy Nov 14, 2026
4d7ada0
Move Ovis2.5 indicator ID helper into visual tokenizer
sushmanthreddy Nov 14, 2026
a13ac95
Enable Ovis2.5 fullgraph decoding
sushmanthreddy Nov 14, 2026
358ed2e
Precompute Ovis2.5 window attention sequence length
sushmanthreddy Nov 14, 2026
007a44f
Reuse LLaVA model initialization in Ovis2.5
sushmanthreddy Nov 14, 2026
cc6e3da
Align Ovis2.5 forward and pooled visual outputs
sushmanthreddy Nov 14, 2026
f28d3b3
Remove redundant Ovis2.5 model annotation
sushmanthreddy Nov 14, 2026
bf175cb
Reuse shared Ovis2.5 multimodal generation expansion
sushmanthreddy Nov 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,8 @@
title: OneFormer
- local: model_doc/ovis2
title: Ovis2
- local: model_doc/ovis2_5
title: Ovis2.5
- local: model_doc/owlvit
title: OWL-ViT
- local: model_doc/owlv2
Expand Down
187 changes: 187 additions & 0 deletions docs/source/en/model_doc/ovis2_5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<!--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 published in HF papers on 2025-08-16 and contributed to Hugging Face Transformers on 2026-11-12.*

# Ovis2.5

## Overview

[Ovis2.5](https://huggingface.co/papers/2508.11737) is a multimodal model from
[AIDC-AI](https://github.com/AIDC-AI/Ovis) for image, video, and text understanding. It combines a native-resolution
vision encoder with a visual tokenizer and a Qwen3 language backbone. Unlike a fixed-resolution tiled encoder, the
vision encoder keeps variable-resolution visual inputs as a sequence of patches. Ovis2.5 also provides an optional
thinking prompt format for tasks that benefit from a longer reasoning response.

Transformers-compatible checkpoints are available from the Ovis community:

- [ovis-community/Ovis2.5-2B](https://huggingface.co/ovis-community/Ovis2.5-2B)
- [ovis-community/ovis-2.5-9B](https://huggingface.co/ovis-community/ovis-2.5-9B)
Comment thread
sushmanthreddy marked this conversation as resolved.
Resolved

These checkpoints retain the original weights and include native model, tokenizer, and processor metadata. The
original repositories still use legacy processor metadata. Weight names are mapped during loading.

## Image inference

Use [`Ovis2_5Processor.apply_chat_template`] to load the image, format the conversation, and tokenize it in one call.
For the 9B checkpoint, replace the model ID.

```python
from transformers import AutoModelForImageTextToText, AutoProcessor


model_id = "ovis-community/Ovis2.5-2B"
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/bee.jpg",
},
{"type": "text", "text": "Describe this image."},
],
}
]

inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False,
).to(model.device, dtype=model.dtype)

generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids = generated_ids[:, inputs["input_ids"].shape[1] :]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```

Multiple images can be supplied by adding more `{"type": "image", ...}` items to the message in the same order in which
they should appear in the prompt.

## Video inference

The official example uniformly samples eight frames. Pass the video path directly in the conversation and let the
processor load and sample it. The processor returns `pixel_values_videos` and `video_grid_thw` along with the tokenized
prompt.
Comment thread
sushmanthreddy marked this conversation as resolved.
Resolved
Ovis2.5 accepts exactly one video per request and does not support mixing images and video in the same request.
Comment thread
sushmanthreddy marked this conversation as resolved.
Resolved

```python
messages = [
{
"role": "user",
"content": [
{"type": "video", "path": "path/to/video.mp4"},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

real vid pls

{"type": "text", "text": "Describe what happens in this video."},
],
}
]

inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False,
processor_kwargs={
"num_frames": 8,
"size": {"shortest_edge": 448 * 448, "longest_edge": 896 * 896},
},
).to(model.device, dtype=model.dtype)

generated_ids = model.generate(**inputs, max_new_tokens=256)
generated_ids = generated_ids[:, inputs["input_ids"].shape[1] :]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```

## Thinking mode

Set `enable_thinking=True` when applying the chat template to leave the model's reasoning block open. Set it to `False`
to request the immediate-answer prompt format.

```python
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=True,
).to(model.device, dtype=model.dtype)

generated_ids = model.generate(**inputs, max_new_tokens=1024)
```

`enable_thinking` changes the chat template; it is not a generation argument and does not impose a token budget. The
two-stage `thinking_budget` behavior implemented by the original custom remote code is not part of the native
Transformers generation API.
Comment thread
sushmanthreddy marked this conversation as resolved.
Resolved

## Ovis2_5Config

[[autodoc]] Ovis2_5Config

## Ovis2_5VisionConfig

[[autodoc]] Ovis2_5VisionConfig

## Ovis2_5Processor

[[autodoc]] Ovis2_5Processor
- __call__

## Ovis2_5ImageProcessor

[[autodoc]] Ovis2_5ImageProcessor
- preprocess

## Ovis2_5ImageProcessorPil

[[autodoc]] Ovis2_5ImageProcessorPil
- preprocess

## Ovis2_5VideoProcessor

[[autodoc]] Ovis2_5VideoProcessor
- preprocess

## Ovis2_5VisionModel

[[autodoc]] Ovis2_5VisionModel
- forward

## Ovis2_5Model

[[autodoc]] Ovis2_5Model
- forward
- get_image_features
- get_video_features

## Ovis2_5ForConditionalGeneration

[[autodoc]] Ovis2_5ForConditionalGeneration
- forward
- get_image_features
- get_video_features
14 changes: 14 additions & 0 deletions src/transformers/conversion_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@ def _build_checkpoint_conversion_mapping():
WeightRenaming(r"\.mlp\.up_proj\.", ".mlp.fc1."),
WeightRenaming(r"\.mlp\.down_proj\.", ".mlp.fc2."),
],
"ovis2_5": [
WeightRenaming(r"^llm\.model\.", "model.language_model."),
WeightRenaming(r"^llm\.lm_head\.", "lm_head."),
WeightRenaming(r"^visual_tokenizer\.vit\.vision_model\.embeddings\.", "model.vision_tower.embeddings."),
WeightRenaming(r"^visual_tokenizer\.vit\.vision_model\.encoder\.layers\.", "model.vision_tower.layers."),
WeightRenaming(
r"^visual_tokenizer\.vit\.vision_model\.post_layernorm\.", "model.vision_tower.post_layernorm."
),
WeightRenaming(
r"^visual_tokenizer\.head\.0\.", "model.multi_modal_projector.visual_tokenizer.head_linear."
),
WeightRenaming(r"^visual_tokenizer\.head\.1\.", "model.multi_modal_projector.visual_tokenizer.head_norm."),
WeightRenaming(r"^vte\.", "model.multi_modal_projector.visual_embeddings_table."),
],
"inkling_mm_model": [
WeightRenaming(source_patterns=r"model\.llm\.layers", target_patterns=r"model.language_model.layers"),
WeightRenaming(
Expand Down
1 change: 1 addition & 0 deletions src/transformers/exporters/exporter_dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ def _to_batched(t):
# Separate `_proj` + `(cos, sin)` rotary + `.out_proj` (tuple return)
"transformers.models.lfm3_vl.modeling_lfm3_vl.Lfm3VlVisionAttention.forward",
"transformers.models.video_llama_3.modeling_video_llama_3.VideoLlama3VisionAttention.forward",
"transformers.models.ovis2_5.modeling_ovis2_5.Ovis2_5VisionAttention.forward",
"transformers.models.paddleocr_vl.modeling_paddleocr_vl.PaddleOCRVisionAttention.forward",
"transformers.models.minimax_m3_vl.modeling_minimax_m3_vl.MiniMaxM3VLVisionAttention.forward",
# NaViT (1, T, D) + separate `_proj` + `.out_proj` (tuple return)
Expand Down
1 change: 1 addition & 0 deletions src/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@
from .openai_privacy_filter import *
from .opt import *
from .ovis2 import *
from .ovis2_5 import *
from .owlv2 import *
from .owlvit import *
from .paddleocr_vl import *
Expand Down
6 changes: 6 additions & 0 deletions src/transformers/models/auto/auto_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@
("openai_privacy_filter", "OpenAIPrivacyFilterConfig"),
("opt", "OPTConfig"),
("ovis2", "Ovis2Config"),
("ovis2_5", "Ovis2_5Config"),
("ovis2_5_vision", "Ovis2_5VisionConfig"),
("ovis2_vision", "Ovis2VisionConfig"),
("owlv2", "Owlv2Config"),
("owlv2_text_model", "Owlv2TextConfig"),
Expand Down Expand Up @@ -985,6 +987,7 @@
("nllb-moe", "nllb_moe"),
("omdet-turbo", "omdet_turbo"),
("openai-gpt", "openai"),
("ovis2_5_vision", "ovis2_5"),
("ovis2_vision", "ovis2"),
("owlv2_text_model", "owlv2"),
("owlv2_vision_model", "owlv2"),
Expand Down Expand Up @@ -1133,6 +1136,7 @@
("molmo2", {"torchvision": "Molmo2VideoProcessor"}),
("muse_glimmer", {"torchvision": "MuseGlimmerVideoProcessor"}),
("nemotron_h_omni", {"torchvision": "NemotronH_Omni_Reasoning_V3VideoProcessor"}),
("ovis2_5", {"torchvision": "Ovis2_5VideoProcessor"}),
("pe_video", {"torchvision": "PeVideoVideoProcessor"}),
("perception_lm", {"torchvision": "PerceptionLMVideoProcessor"}),
("qwen2_vl", {"torchvision": "Qwen2VLVideoProcessor"}),
Expand Down Expand Up @@ -1287,6 +1291,7 @@
("omdet-turbo", "OmDetTurboProcessor"),
("oneformer", "OneFormerProcessor"),
("ovis2", "Ovis2Processor"),
("ovis2_5", "Ovis2_5Processor"),
("owlv2", "Owlv2Processor"),
("owlvit", "OwlViTProcessor"),
("paddleocr_vl", "PaddleOCRVLProcessor"),
Expand Down Expand Up @@ -1427,6 +1432,7 @@
("nougat", {"pil": "NougatImageProcessorPil", "torchvision": "NougatImageProcessor"}),
("oneformer", {"pil": "OneFormerImageProcessorPil", "torchvision": "OneFormerImageProcessor"}),
("ovis2", {"pil": "Ovis2ImageProcessorPil", "torchvision": "Ovis2ImageProcessor"}),
("ovis2_5", {"pil": "Ovis2_5ImageProcessorPil", "torchvision": "Ovis2_5ImageProcessor"}),
("owlv2", {"pil": "Owlv2ImageProcessorPil", "torchvision": "Owlv2ImageProcessor"}),
("owlvit", {"pil": "OwlViTImageProcessorPil", "torchvision": "OwlViTImageProcessor"}),
("paddleocr_vl", {"pil": "PaddleOCRVLImageProcessorPil", "torchvision": "PaddleOCRVLImageProcessor"}),
Expand Down
3 changes: 3 additions & 0 deletions src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("openai_privacy_filter", "OpenAIPrivacyFilterModel"),
("opt", "OPTModel"),
("ovis2", "Ovis2Model"),
("ovis2_5", "Ovis2_5Model"),
("ovis2_5_vision", "Ovis2_5VisionModel"),
("owlv2", "Owlv2Model"),
("owlvit", "OwlViTModel"),
("paddleocr_vl", "PaddleOCRVLModel"),
Expand Down Expand Up @@ -1215,6 +1217,7 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("muse_spark", "MuseSparkForConditionalGeneration"),
("nemotron_h_omni", "NemotronH_Omni_Reasoning_V3"),
("ovis2", "Ovis2ForConditionalGeneration"),
("ovis2_5", "Ovis2_5ForConditionalGeneration"),
("paddleocr_vl", "PaddleOCRVLForConditionalGeneration"),
("paligemma", "PaliGemmaForConditionalGeneration"),
("perception_lm", "PerceptionLMForConditionalGeneration"),
Expand Down
37 changes: 37 additions & 0 deletions src/transformers/models/ovis2_5/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from the modules in `src/transformers/models/ovis2_5`.
# Do NOT edit this file manually as any edits will be overwritten by auto-generation of the file.
# A module is picked up once it exports a name through `__all__`.
# Regenerate the file with: `python utils/check_inits.py --fix_and_overwrite`
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Copyright 2026 The HuggingFace Inc. 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.
from typing import TYPE_CHECKING

from ...utils import _LazyModule
from ...utils.import_utils import define_import_structure


if TYPE_CHECKING:
from .configuration_ovis2_5 import *
from .image_processing_ovis2_5 import *
from .image_processing_pil_ovis2_5 import *
from .modeling_ovis2_5 import *
from .processing_ovis2_5 import *
from .video_processing_ovis2_5 import *
else:
import sys

_file = globals()["__file__"]
sys.modules[__name__] = _LazyModule(__name__, _file, define_import_structure(_file), module_spec=__spec__)
Loading
Loading