Skip to content

Commit 6877837

Browse files
committed
Applied comments.
1 parent 82131f3 commit 6877837

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

.github/workflows/causal_lm_cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ jobs:
717717
source ./ov/setupvars.sh
718718
export PYTHONPATH=./build/:$PYTHONPATH
719719
printf 'What is on the image?\nWhat is special on the image?\n' > ./input.txt
720-
timeout 300s python ./samples/python/vlm_chat_sample/vlm_chat_sample.py ./miniCPM-V-2_6/ d5fbbd1a-d484-415c-88cb-9986625b7b11 < input.txt > ./pred.txt || ( [[ $? -eq 124 ]] && \
720+
timeout 120s python ./samples/python/vlm_chat_sample/vlm_chat_sample.py ./miniCPM-V-2_6/ d5fbbd1a-d484-415c-88cb-9986625b7b11 < input.txt > ./pred.txt || ( [[ $? -eq 124 ]] && \
721721
echo "Timeout reached, but it's excpected." )
722722
723723
cpp-continuous-batching-ubuntu:

samples/python/vlm_chat_sample/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python vlm_chat_sample that supports VLM models
22

3-
This example showcases inference of text-generation Vision Language Models (VLMs): `miniCPM-V-2_6` and other models with the same signature. The application doesn't have many configuration options to encourage the reader to explore and modify the source code. For example, change the device for inference to GPU. The sample features `openvino_genai.VLMPipeline` and configures it for the chat scenario. #TODO: add a link to notebook when available
3+
This example showcases inference of text-generation Vision Language Models (VLMs): `miniCPM-V-2_6` and other models with the same signature. The application doesn't have many configuration options to encourage the reader to explore and modify the source code. For example, change the device for inference to GPU. The sample features `openvino_genai.VLMPipeline` and configures it for the chat scenario. There is also a Jupyter [notebook](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/minicpm-v-multimodal-chatbot) which provides an example of Visual-language assistant.
44

55
## Download and convert the model and tokenizers
66

@@ -14,7 +14,7 @@ pip install --upgrade-strategy eager -r ../../requirements.txt
1414
# TODO: add optimum cli command for miniCPM-V-2_6 when available
1515

1616
## Run:
17-
https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11 can be used as a sample image.
17+
[This image](https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11) can be used as a sample image.
1818

1919
`vlm_chat_sample.py ./miniCPM-V-2_6/ 319483352-d5fbbd1a-d484-415c-88cb-9986625b7b11.jpg`
2020

samples/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ optimum[openvino]==1.22.0
33
einops==0.8.0 # For Qwen
44
transformers_stream_generator==0.0.5 # For Qwen
55
diffusers==0.30.3
6-
torchvision
6+
pillow
7+
torchvision # needed for mini-CPM export script. Need to remove when we switch to exporting with optimum-intel.

src/python/py_vlm_pipeline.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,13 @@ void init_vlm_pipeline(py::module_& m) {
109109
ScopedVar env_manager(utils::ov_tokenizers_module_path());
110110
return std::make_unique<ov::genai::VLMPipeline>(model_path, device, utils::properties_to_any_map(config));
111111
}),
112-
py::arg("model_path"), "folder with openvino_model.xml and openvino_tokenizer[detokenizer].xml files",
112+
py::arg("model_path"), "folder with exported model files",
113113
py::arg("device") = "CPU", "device on which inference will be done",
114114
py::arg("config") = ov::AnyMap({}), "openvino.properties map"
115115
R"(
116116
VLMPipeline class constructor.
117-
model_path (str): Path to the model file.
117+
model_path (str): Path to the folder with exported model files.
118118
device (str): Device to run the model on (e.g., CPU, GPU). Default is 'CPU'.
119-
Add {"scheduler_config": ov_genai.SchedulerConfig} to config properties to create continuous batching pipeline.
120119
)")
121120

122121
.def(py::init([](
@@ -134,10 +133,9 @@ void init_vlm_pipeline(py::module_& m) {
134133
py::arg("config") = ov::AnyMap({}), "openvino.properties map"
135134
R"(
136135
VLMPipeline class constructor for manualy created openvino_genai.Tokenizer.
137-
model_path (str): Path to the model file.
136+
model_path (str): Path to the folder with exported model files.
138137
tokenizer (openvino_genai.Tokenizer): tokenizer object.
139138
device (str): Device to run the model on (e.g., CPU, GPU). Default is 'CPU'.
140-
Add {"scheduler_config": ov_genai.SchedulerConfig} to config properties to create continuous batching pipeline.
141139
)")
142140
.def("start_chat", &ov::genai::VLMPipeline::start_chat)
143141
.def("finish_chat", &ov::genai::VLMPipeline::finish_chat)

0 commit comments

Comments
 (0)