Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Oct 22, 2024
1 parent b2496c0 commit b9bfb6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_visual_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def get_vision_embeddings(self, pixel_values, input_ids=None, **kwargs):
if input_ids is not None and input_ids.shape[1] == 1:
return None
if isinstance(pixel_values, list) or pixel_values.ndim == 5:
concat_images = torch.cat([image for image in pixel_values], dim=0)
concat_images = torch.cat(pixel_values, dim=0) if isinstance(pixel_values, list) else pixel_values
image_features = torch.from_numpy(self.vision_embeddings(concat_images).last_hidden_state)
split_sizes = [image.shape[0] for image in pixel_values]
image_features = torch.split(image_features, split_sizes, dim=0)
Expand Down

0 comments on commit b9bfb6d

Please sign in to comment.