Skip to content

fix patch_attention_mask incorrect setting which leads to the differe…#33499

Merged
amyeroberts merged 4 commits into
huggingface:mainfrom
sywangyi:idefix2_fix_batch
Sep 17, 2024
Merged

fix patch_attention_mask incorrect setting which leads to the differe…#33499
amyeroberts merged 4 commits into
huggingface:mainfrom
sywangyi:idefix2_fix_batch

Conversation

@sywangyi

Copy link
Copy Markdown
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.

…nce in the generated text if batch > 1

Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread tests/models/idefics2/test_modeling_idefics2.py
@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 <yi.a.wang@intel.com>

* fix format

Signed-off-by: Wang, Yi <yi.a.wang@intel.com>

* [run_slow] idefics2

---------

Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
@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