Skip to content
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

Fix register_buffer parameter #1036

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Conversation

xu-song
Copy link
Contributor

@xu-song xu-song commented Sep 20, 2023

This PR make it compatible with new version of transformers.

before transformers v4.30.0

before transformers v4.30.0

self.register_buffer("masked_bias", torch.tensor(-1e9))

After transformers v4.31.0

After transformers v4.31.0 , attention.bias and attention.masked_bias is not part of this module's state_dict any more.

self.register_buffer("masked_bias", torch.tensor(-1e9), persistent=False)

@xu-song xu-song requested a review from a team as a code owner September 20, 2023 03:24
@Quentin-Anthony
Copy link
Member

Nice catch

@Quentin-Anthony Quentin-Anthony merged commit 0ce77ab into EleutherAI:main Sep 20, 2023
0 of 3 checks passed
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.

2 participants