Views
No views yet
pip install huggingface-hub[cli] and then:huggingface-cli download helenai/Qwen2.5-VL-3B-Instruct-ov-int4-npu --local-dir Qwen2.5-VL-3B-Instruct-ov-int4-npupip install --upgrade openvino-genai pillowcurl -O "https://storage.openvinotoolkit.org/test_data/images/dog.jpg"1import numpy as np
2import openvino as ov
3import openvino_genai
4from PIL import Image
5
6# Choose GPU instead of NPU to run the model on Intel integrated or discrete GPU, or CPU to run on CPU.
7# CACHE_DIR caches the model the first time, so subsequent model loading will be faster
8pipeline_config = {"CACHE_DIR": "model_cache"}
9pipe = openvino_genai.VLMPipeline("Qwen2.5-VL-3B-Instruct-ov-int4-npu", "NPU", **pipeline_config)
10
11image = Image.open("dog.jpg")
12# optional: resizing to a smaller size (depending on image and prompt) is often useful to speed up inference.
13image = image.resize((128, 128))
14
15image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
16image_data = ov.Tensor(image_data)
17
18prompt = "Can you describe the image?"
19result = pipe.generate(prompt, image=image_data, max_new_tokens=100)
20print(result.texts[0])optimum-cli export openvino -m Qwen/Qwen2.5-VL-3B-Instruct --weight-format int4 --group-size -1 --sym --awq --scale-estimation --dataset contextual Qwen2.5-VL-3B-Instruct-ov-int4-
npuopenvino_version : 2025.3.0-19807-44526285f24-releases/2025/3
nncf_version : 2.17.0
optimum_intel_version : 1.26.0.dev0+0e2ccef
optimum_version : 1.27.0
pytorch_version : 2.7.1
transformers_version : 4.51.3all_layers : False
awq : True
backup_mode : int8_asym
compression_format : dequantize
gptq : False
group_size : -1
ignored_scope : []
lora_correction : False
mode : int4_sym
ratio : 1.0
scale_estimation : True
sensitivity_metric : max_activation_variance