Skip to content

Commit

Permalink
review amy
Browse files Browse the repository at this point in the history
  • Loading branch information
andimarafioti committed Sep 20, 2024
1 parent c14da26 commit 1bbf7ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/transformers/models/idefics3/modeling_idefics3.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def forward(
return attn_output, attn_weights


# Copied from transformers.models.idefics2.modeling_idefics2.Idefics2VisionFlashAttention2
# Copied from transformers.models.idefics2.modeling_idefics2.Idefics2VisionFlashAttention2 with Idefics2->Idefics3
class Idefics3VisionFlashAttention2(Idefics3VisionAttention):
"""
Idefics3Vision flash attention module. This module inherits from `Idefics3VisionAttention` as the weights of the module stays
Expand Down
4 changes: 3 additions & 1 deletion tests/models/idefics3/test_image_processing_idefics3.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def get_expected_values(self, image_inputs, batched=False):

def expected_output_image_shape(self, images):
height, width = self.get_expected_values(images, batched=True)
effective_nb_images = self.num_images * 5 if self.do_image_splitting else 1
effective_nb_images = (
self.num_images * 5 if self.do_image_splitting else 1
) # 5 is a squared image divided into 4 + global image resized
return effective_nb_images, self.num_channels, height, width

def prepare_image_inputs(
Expand Down

0 comments on commit 1bbf7ba

Please sign in to comment.