Skip to content

[OpenVINO] Support Youtu-VL-4B-Instruct with task image-text-to-text#1834

Open
Mohamed-Ashraf273 wants to merge 3 commits into
huggingface:mainfrom
Mohamed-Ashraf273:add-youtu-vl-support
Open

[OpenVINO] Support Youtu-VL-4B-Instruct with task image-text-to-text#1834
Mohamed-Ashraf273 wants to merge 3 commits into
huggingface:mainfrom
Mohamed-Ashraf273:add-youtu-vl-support

Conversation

@Mohamed-Ashraf273

@Mohamed-Ashraf273 Mohamed-Ashraf273 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Added OpenVINO export + runtime support for the custom youtu_vl (YoutuVLForConditionalGeneration) image-text-to-text VLM: MLA (DeepSeek/MiniCPM3-style) language model + Qwen2.5-VL-style windowed Siglip2 vision tower split into patch-embed + transformer/merger submodels. Export succeeds (4 submodels) and OV generation matches PyTorch ground truth exactly. Fixed the spatial_shapes generate() blocker. Added and locally verified VLM integration, 4-bit CLI, and auto-compression tests, plus docs entry.

Conversion

optimum-cli export openvino -m /home/mohamed-ashraf/Desktop/projects/GSoC26/auto-openvino-bot/workspace/tiny-youtu-vl ov_youtu --task image-text-to-text --trust-remote-code

Reproduce generation

import torch
from PIL import Image
from transformers import AutoProcessor
from optimum.intel.openvino import OVModelForVisualCausalLM

model_id = '/home/mohamed-ashraf/Desktop/projects/GSoC26/auto-openvino-bot/workspace/tiny-youtu-vl'
ov_dir = 'ov_youtu'

processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = OVModelForVisualCausalLM.from_pretrained(ov_dir, trust_remote_code=True)

image = Image.new('RGB', (64, 64), (120, 120, 120))
messages = [{'role': 'user', 'content': [{'type': 'image'}, {'type': 'text', 'text': 'What is this?'}]}]
prompt = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = processor(images=image, text=prompt, return_tensors='pt')

output = model.generate(**inputs, max_new_tokens=20, do_sample=False)
print(processor.decode(output[0, inputs['input_ids'].shape[1]:], skip_special_tokens=True))

Validation

  • WWB similarity: 1.0

Related model-support PRs

Before submitting

  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Changed files

  • docs/source/openvino/models.mdx
  • optimum/exporters/openvino/model_configs.py
  • optimum/exporters/openvino/model_patcher.py
  • optimum/exporters/openvino/utils.py
  • optimum/intel/openvino/modeling_visual_language.py
  • tests/openvino/test_exporters_cli.py
  • tests/openvino/test_quantization.py
  • tests/openvino/test_seq2seq.py
  • tests/openvino/utils_tests.py

Related model-support PRs

Related model-support PRs

Comment thread tests/openvino/utils_tests.py Outdated
"qwen3_eagle3": "AngelSlim/Qwen3-1.7B_eagle3",
"qwen3_vl_eagle3": "optimum-intel-internal-testing/tiny-random-qwen3-vl-eagle3",
"videochat_flash_qwen": "optimum-intel-internal-testing/tiny-videochat-flash-qwen",
"youtu_vl": "optimum-intel-internal-testing/tiny-random-youtu-vl",

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.

please create tiny model during test. Let us not upload tiny model to HF space if this is new arch.
You can check kokoro model

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

# is shipped as remote code, so unlike the in-library deepseek/minicpm3 configs we do
# not constrain the maximum transformers version.
MIN_TRANSFORMERS_VERSION = "4.49.0"
MAX_TRANSFORMERS_VERSION = "999.9.9"

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.

this is trust-remote code model, we should have accurate MIN/Max versions. Let us retrieve it from model config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants