Update README.md
Browse files
README.md
CHANGED
|
@@ -20,14 +20,14 @@ import openvino as ov
|
|
| 20 |
import openvino_genai
|
| 21 |
from PIL import Image
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Setting eos_token_id to tokenizer's eos token id is necessary for Phi-3.5-vision-instruct
|
| 24 |
config = openvino_genai.GenerationConfig()
|
| 25 |
config.set_eos_token_id(pipe.get_tokenizer().get_eos_token_id())
|
| 26 |
config.max_new_tokens = 100
|
| 27 |
-
# Choose GPU instead of CPU in the line below to run the model on Intel integrated or discrete GPU
|
| 28 |
-
pipe = openvino_genai.VLMPipeline("Phi-3.5-vision-instruct-ov-int4", "CPU")
|
| 29 |
-
|
| 30 |
-
pipe.start_chat()
|
| 31 |
|
| 32 |
image = Image.open("dog.jpg")
|
| 33 |
image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
|
|
|
|
| 20 |
import openvino_genai
|
| 21 |
from PIL import Image
|
| 22 |
|
| 23 |
+
# Choose GPU instead of CPU in the line below to run the model on Intel integrated or discrete GPU
|
| 24 |
+
pipe = openvino_genai.VLMPipeline("Phi-3.5-vision-instruct-ov-int4", "CPU")
|
| 25 |
+
pipe.start_chat()
|
| 26 |
+
|
| 27 |
# Setting eos_token_id to tokenizer's eos token id is necessary for Phi-3.5-vision-instruct
|
| 28 |
config = openvino_genai.GenerationConfig()
|
| 29 |
config.set_eos_token_id(pipe.get_tokenizer().get_eos_token_id())
|
| 30 |
config.max_new_tokens = 100
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
image = Image.open("dog.jpg")
|
| 33 |
image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
|