Skip to content

FIX: Create mask function signature change in transformers 4.53.1 #2633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

BenjaminBossan
Copy link
Member

We use create_mask_for_generate from transformers. It was introduced in v4.53.0 but in v4.53.1, the function signature was changed to include position_ids as mandatory argument:

huggingface/transformers#39194

This breaks our function call in PEFT. This PR fixes the function call by passing position_ids. This in turn would break the function call with transformers v4.53.0, thus a strict version check is being used for >= v4.53.1.

We use create_mask_for_generate from transformers. It was introduced in
v4.53.0 but in v4.53.1, the function signature was changed to include
position_ids as mandatory argument:

huggingface/transformers#39194

This breaks our function call in PEFT. This PR fixes the function call
by passing position_ids. This in turn would break the function call with
transformers v4.53.0, thus a strict version check is being used for >=
v4.53.1.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@BenjaminBossan BenjaminBossan requested a review from githubnemo July 4, 2025 13:14
@BenjaminBossan
Copy link
Member Author

@githubnemo This fix is required to make our CI pass again.

@BenjaminBossan BenjaminBossan merged commit d76f3fe into huggingface:main Jul 7, 2025
23 of 27 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-create-mask-signature-transformers-4.53.1 branch July 7, 2025 09:47
efraimdahl pushed a commit to efraimdahl/peft that referenced this pull request Jul 12, 2025
We use create_mask_for_generate from transformers. It was introduced in
v4.53.0 but in v4.53.1, the function signature was changed to include
position_ids as mandatory argument:

huggingface/transformers#39194

This breaks our function call in PEFT. This PR fixes the function call
by passing position_ids. This in turn would break the function call with
transformers v4.53.0, thus a strict version check is being used for >=
v4.53.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants