加载中…
加载中…
Qwen/Qwen3.5-0.8BThis is Qwen3.5-0.8B model converted to the OpenVINO™ IR (Intermediate Representation) format.
The model includes openvino_mtp_model.xml for built-in Multi-Token Prediction (MTP) speculative decoding.
The provided OpenVINO™ IR model is compatible with:
pip install -U "git+https://github.com/huggingface/optimum-intel.git" torchvision Pillow --extra-index-url https://download.pytorch.org/whl/cpu
pip install -U "openvino==2026.4.0"
pip install -U "transformers==5.2.0"
import requests
from PIL import Image
from transformers import AutoProcessor
from optimum.intel.openvino import OVModelForVisualCausalLM
model_id = "OpenVINO/Qwen3.5-0.8B-fp16-ov"
processor = AutoProcessor.from_pretrained(model_id)
model = OVModelForVisualCausalLM.from_pretrained(model_id)
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
image = Image.open(requests.get(url, stream=True).raw)
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Describe this image."},
],
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(processor.batch_decode(outputs[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0])
For more examples and possible optimizations, refer to the Inference with Optimum Intel.
pip install -U huggingface_hub "Pillow"
pip install -U "openvino==2026.4.0" "openvino-tokenizers==2026.4.0.0" "openvino-genai==2026.4.0.0"
import huggingface_hub as hf_hub
model_id = "OpenVINO/Qwen3.5-0.8B-fp16-ov"
model_path = "Qwen3.5-0.8B-fp16-ov"
hf_hub.snapshot_download(model_id, local_dir=model_path)
import numpy as np
import openvino as ov
import openvino_genai as ov_genai
import requests
from PIL import Image
device = "CPU"
scheduler_config = ov_genai.SchedulerConfig()
scheduler_config.enable_prefix_caching = False
draft = ov_genai.draft_model(model_path, device)
pipe = ov_genai.VLMPipeline(
model_path,
device,
draft_model=draft,
scheduler_config=scheduler_config,
)
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
image_tensor = ov.Tensor(np.array(image)[None])
generation_config = ov_genai.GenerationConfig()
generation_config.max_new_tokens = 200
generation_config.do_sample = False
generation_config.num_return_sequences = 1
generation_config.num_assistant_tokens = 2
print(pipe.generate("Describe this image.", image=image_tensor, generation_config=generation_config))
OpenVINO GenAI currently supports this MTP path with greedy decoding and prefix caching disabled, as demonstrated in the Qwen3.8 MTP notebook.
More GenAI usage examples can be found in OpenVINO GenAI library docs and samples
You can find more detailed usage examples in OpenVINO Notebooks:
Check the original model card for limitations.
The original model is distributed under Apache License Version 2.0 license. More details can be found in Qwen3.5-0.8B.
Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel's Global Human Rights Principles. Intel's products and software are intended only to be used in applications that do not cause or contribute to adverse impacts to human rights.