Skip to content

Conversation

@sywangyi
Copy link
Contributor

…nce in the generated text if batch > 1

Fixes # (issue)
found the evaluate accuracy differ between batch=1 and batch>1.
if batch>1, some image would have padding pixel. and patch_attention_mask incorrect setting makes the generated result different.

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing and adding a test!

Final step is running the slow tests for the model before merge. Could you push an empty commit with the message [run_slow] idefics2?

@amyeroberts amyeroberts merged commit 454a0f2 into huggingface:main Sep 17, 2024
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
huggingface#33499)

* fix patch_attention_mask incorrect setting which leads to the difference in the generated text if batch > 1

Signed-off-by: Wang, Yi <[email protected]>

* fix format

Signed-off-by: Wang, Yi <[email protected]>

* [run_slow] idefics2

---------

Signed-off-by: Wang, Yi <[email protected]>
@sywangyi sywangyi deleted the idefix2_fix_batch branch November 19, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants