Views
No views yet
nncf.compress_weights with the following parameters:pip install -U "git+https://github.com/huggingface/optimum-intel.git" torchvision "Pillow" --extra-index-url https://download.pytorch.org/whl/cpu
pip install --pre -U openvino --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
pip install -U "transformers==5.2"1import requests
2from PIL import Image
3from transformers import AutoProcessor
4from optimum.intel.openvino import OVModelForVisualCausalLM
5
6model_id = "OpenVINO/Qwen3.5-27B-int4-ov"
7processor = AutoProcessor.from_pretrained(model_id)
8model = OVModelForVisualCausalLM.from_pretrained(model_id)
9
10url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
11image = Image.open(requests.get(url, stream=True).raw)
12
13messages = [
14 {
15 "role": "user",
16 "content": [
17 {"type": "image"},
18 {"type": "text", "text": "Describe this image."},
19 ],
20 }
21]
22
23text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
24inputs = processor(text=[text], images=[image], return_tensors="pt")
25
26outputs = model.generate(**inputs, max_new_tokens=200)
27print(processor.batch_decode(outputs[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0])pip install huggingface_hub "Pillow"
pip install --pre -U openvino openvino-tokenizers openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly1import huggingface_hub as hf_hub
2
3model_id = "OpenVINO/Qwen3.5-27B-int4-ov"
4model_path = "Qwen3.5-27B-int4-ov"
5
6hf_hub.snapshot_download(model_id, local_dir=model_path)1import numpy as np
2import openvino as ov
3import openvino_genai as ov_genai
4import requests
5from PIL import Image
6
7device = "CPU"
8pipe = ov_genai.VLMPipeline(model_path, device)
9
10url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
11image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
12image_tensor = ov.Tensor(np.array(image)[None])
13
14print(pipe.generate("Describe this image.", image=image_tensor, max_new_tokens=200))