From e1eb45d3973fc8d48f9c980095f08a84d801fc4a Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Mon, 17 Mar 2025 10:18:50 -0400 Subject: [PATCH] [Bugfix] Fix precommit - line too long in pixtral.py (#14960) Signed-off-by: Tyler Michael Smith Co-authored-by: DarkLight1337 --- requirements/test.txt | 2 +- vllm/model_executor/models/pixtral.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index 10fb1f14..c733364f 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -235,7 +235,7 @@ mbstrdecoder==1.1.3 # typepy mdurl==0.1.2 # via markdown-it-py -mistral-common==1.5.1 +mistral-common==1.5.4 # via -r requirements/test.in more-itertools==10.5.0 # via lm-eval diff --git a/vllm/model_executor/models/pixtral.py b/vllm/model_executor/models/pixtral.py index 8e545432..f9facdf1 100644 --- a/vllm/model_executor/models/pixtral.py +++ b/vllm/model_executor/models/pixtral.py @@ -73,7 +73,7 @@ class PixtralImagePixelInputs(TypedDict): """ A boolean mask indicating which image embeddings correspond to patch tokens. - + Shape: `(batch_size, num_images, num_embeds)` """ @@ -849,10 +849,10 @@ class VisionTransformer(nn.Module): ) -> torch.Tensor: """ Args: - images: list of N_img images of variable sizes, + images: list of N_img images of variable sizes, each of shape (C, H, W) Returns: - image_features: tensor of token features for + image_features: tensor of token features for all tokens of all images of shape (N_toks, D) """ # pass images through initial convolution independently @@ -935,7 +935,8 @@ class PatchMerger(nn.Module): # x is (N, vision_encoder_dim) x = self.permute(x, image_sizes) - # x is (N / spatial_merge_size ** 2, vision_encoder_dim * spatial_merge_size ** 2) + # x is (N / spatial_merge_size ** 2, + # vision_encoder_dim * spatial_merge_size ** 2) x = self.merging_layer(x) # x is (N / spatial_merge_size ** 2, vision_encoder_dim)