Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Wovchena committed Jan 9, 2025
1 parent 6e24a25 commit 3fd78e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cpp/src/visual_language/inputs_embedder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ class InputsEmbedderPhi3V : public InputsEmbedder::IInputsEmbedder {
):
IInputsEmbedder(vlm_config, model_dir, device, device_config), m_image_id{0},
m_hd_feature_transformer{phi3_v::create_hd_feature_transformer()},
m_vision_projection{utils::singleton_core().compile_model(model_dir / "openvino_vision_projection_model.xml", device).create_infer_request()} {}
m_vision_projection{utils::singleton_core().compile_model(model_dir / "openvino_vision_projection_model.xml", device, {}).create_infer_request()} {}

ov::Tensor get_inputs_embeds(const std::string& prompt, const std::vector<ov::Tensor>& images, ov::genai::VLMPerfMetrics& metrics) override {
OPENVINO_ASSERT(images.empty() || m_history.empty(), "Images can only be provided for initial prompt");
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/src/visual_language/vision_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,11 @@ ov::Tensor HD_transform(const ov::Tensor& uint8, size_t num_crops) {
clip_image_u8 src{}, dst{};
uint8_t* uint8_data = uint8.data<uint8_t>();
if (trans) {
src = clip_image_u8{height, width, {uint8_data, uint8_data + uint8.get_size()}};
src = clip_image_u8{int(height), int(width), {uint8_data, uint8_data + uint8.get_size()}};
bilinear_resize(src, dst, new_h, new_w);
return padding_336(ov::Tensor{ov::element::u8, {1, new_w, new_h, 3}, dst.buf.data()});
}
src = clip_image_u8{width, height, {uint8_data, uint8_data + uint8.get_size()}};
src = clip_image_u8{int(width), int(height), {uint8_data, uint8_data + uint8.get_size()}};
bilinear_resize(src, dst, new_w, new_h);
return padding_336(ov::Tensor{ov::element::u8, {1, new_h, new_w, 3}, dst.buf.data()});
}
Expand Down Expand Up @@ -826,7 +826,7 @@ ov::Tensor pad_to_max_num_crops_tensor(const ov::Tensor& nchw, size_t max_crops)
std::tuple<ov::Tensor, ImageSize> get_pixel_values_phi3_v(const ov::Tensor& image, const ProcessorConfig& config) {
ov::Tensor hd_image = HD_transform(image, config.phi3_v.num_crops);
ImageSize image_size{hd_image.get_shape().at(2), hd_image.get_shape().at(1)};
clip_image_u8 img{hd_image.get_shape().at(2), hd_image.get_shape().at(1), {hd_image.data<uint8_t>(), hd_image.data<uint8_t>() + hd_image.get_size()}};
clip_image_u8 img{int(hd_image.get_shape().at(2)), int(hd_image.get_shape().at(1)), {hd_image.data<uint8_t>(), hd_image.data<uint8_t>() + hd_image.get_size()}};
clip_image_u8 dst;
bicubic_resize(img, dst, INPUT_IMAGE_SIZE, INPUT_IMAGE_SIZE);
ov::Tensor global_image{ov::element::u8, {1, INPUT_IMAGE_SIZE, INPUT_IMAGE_SIZE, 3}, dst.buf.data()};
Expand Down

0 comments on commit 3fd78e4

Please sign in to comment.