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

Ignore past_key_values during GPT-Neo inference #13521

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

aphedges
Copy link
Contributor

What does this PR do?

Applies #8633 to GPT-Neo.

I was getting errors like RuntimeError: Sizes of tensors must match except in dimension 2. Got 20 and 19 (The offending index is 0) during the evaluation step of Trainer.train() with GPT-Neo.

This was fixed in an internal implementation of GPTNeoForSequenceClassification by @manuelciosici before an official version of the class was released for transformers. I converted our code to use the transformers version of the class and realized the solution should be upstreamed. I'm just mentioning this here because I don't get all the credit for this patch.

This might be needed for other models as well, but I don't know of a good way to figure that out without testing them all.

Who can review?

trainer: @sgugger

Copy link
Collaborator

@sgugger sgugger 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!

@sgugger sgugger merged commit 68b0bae into huggingface:master Sep 13, 2021
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.

None yet

2 participants