helenai commited on
Commit
4c3d673
·
verified ·
1 Parent(s): eef6ca0

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -0
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - OpenGVLab/InternVL2-2B
4
+ ---
5
+
6
+ This is the [OpenGVLab/InternVL2-2B](https://huggingface.co/OpenGVLab/InternVL2-2B) model, converted to OpenVINO
7
+ with INT4 compressed weights for the language model, INT8 weights for the other models.
8
+
9
+ To run inference on this model with OpenVINO GenAI (`pip install openvino-genai pillow`):
10
+
11
+ ```python
12
+ import numpy as np
13
+ import openvino as ov
14
+ import openvino_genai
15
+ from PIL import Image
16
+
17
+ # Choose GPU instead of CPU in the line below to run the model on Intel integrated or discrete GPU
18
+ pipe = openvino_genai.VLMPipeline("./InternVL2-2B-ov", "CPU")
19
+ pipe.start_chat()
20
+
21
+ image = Image.open("dog.jpg")
22
+ image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.uint8)
23
+ image_data = ov.Tensor(image_data)
24
+
25
+ prompt = "Can you describe the image?"
26
+ result = pipe.generate(prompt, image=image_data, max_new_tokens=100)
27
+ print(result.texts[0])
28
+ ```
29
+
30
+ See [OpenVINO GenAI repository](https://github.com/openvinotoolkit/openvino.genai?tab=readme-ov-file#performing-visual-language-text-generation)