Downloads · 30 days
17
12% of all-time downloads
helenai/Phi-3.5-vision-instruct-ov-int4
Phi-3.5-vision-instruct-ov-int4 is a machine learning model from helenai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is the microsoft/Phi-3.5-vision-instruct model, converted to OpenVINO, with int4 weights for the language model, int8 weights for the other models.
Downloads · 30 days
17
12% of all-time downloads
All-time downloads
144
Public
Repo size
2.4 GB
Likes
0
Public
Click a slice to open those files.
.bin2.4 GB · 100%
From the Hugging Face model README
This is the microsoft/Phi-3.5-vision-instruct model, converted to OpenVINO, with int4 weights for the language model, int8 weights for the other models.
Use OpenVINO GenAI to run inference on this model:
pip install --upgrade --pre pillow openvino-genai openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
curl -O "https://storage.openvinotoolkit.org/test_data/images/dog.jpg"import numpy as np
import openvino as ov
import openvino_genai
from PIL import Image
# Choose GPU instead of CPU in the line below to run the model on Intel integrated or discrete GPU
pipe = openvino_genai.VLMPipeline("Phi-3.5-vision-instruct-ov-int4", "CPU")
pipe.start_chat()
# Setting eos_token_id to tokenizer's eos token id is necessary for Phi-3.5-vision-instruct
config = openvino_genai.GenerationConfig()
config.set_eos_token_id(pipe.get_tokenizer().get_eos_token_id())
config.max_new_tokens = 100
image = Image.open("dog.jpg")
image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
image_data = ov.Tensor(image_data)
prompt = "Can you describe the image?"
result = pipe.generate(prompt, image=image_data, generation_config=config)
print(result.texts[0])