Views
No views yet
pip install huggingface-hub[cli] and then:huggingface-cli download helenai/Qwen2.5-VL-7B-Instruct-ov-int4 --local-dir Qwen2.5-VL-7B-Instruct-ov-int4pip 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 CPU in the line below to run the model on Intel integrated or discrete GPU
7pipe = openvino_genai.VLMPipeline("Qwen2.5-VL-7B-Instruct-ov-int4", "CPU")
8
9image = Image.open("dog.jpg")
10# optional: resizing to a smaller size (depending on image and prompt) is often useful to speed up inference.
11image = image.resize((128, 128))
12
13image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
14image_data = ov.Tensor(image_data)
15
16prompt = "Can you describe the image?"
17result = pipe.generate(prompt, image=image_data, max_new_tokens=100)
18print(result.texts[0])optimum-cli export openvino -m Qwen/Qwen2.5-VL-7B-Instruct --weight-format int4 Qwen2.5-VL-7B-Instruct-ov-int4openvino : 2025.2.0-19140-c01cd93e24d-releases/2025/2
nncf : 2.17.0.dev0+c6296072
optimum_intel : 1.26.0.dev0+0e2ccef
optimum : 1.27.0
pytorch : 2.7.0+cpu
transformers : 4.51.3all_layers : False
awq : False
backup_mode : int8_asym
compression_format : dequantize
gptq : False
group_size : 128
ignored_scope : []
lora_correction : False
mode : int4_asym
ratio : 1.0
scale_estimation : False
sensitivity_metric : weight_quantization_error