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

Add shift-right method to T5 model #2131

Conversation

yohann-benchetrit
Copy link
Contributor

We add a _shift_right method to the T5 Model. This is used for training (see Issue 2127).

It shifts an input batch of sequences of token-indices, one index to the right.
Their first token is replaced with the start-of-sequence token, which is the padding-token index for T5 models

@github-advanced-security
Copy link

You have successfully added a new CodeQL configuration .github/workflows/codeql.yml:build. As part of the setup process, we have scanned this repository and found 3 existing alerts. Please check the repository Security tab to see all alerts.

@joecummings joecummings self-requested a review March 28, 2023 14:33
@joecummings
Copy link
Contributor

@yohann-benchetrit Can you add a unittest for this?

@joecummings joecummings linked an issue Mar 28, 2023 that may be closed by this pull request
Copy link
Contributor

@Nayef211 Nayef211 left a comment

Choose a reason for hiding this comment

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

This looks fine to me. @joecummings do you want to take a look and stamp if everything looks okay?

@yohann-benchetrit yohann-benchetrit force-pushed the ybenchetrit-add-shift-right-helper-T5 branch 2 times, most recently from 10dc158 to a8b8bee Compare March 28, 2023 15:41
@joecummings
Copy link
Contributor

@yohann-benchetrit Looks like there's an error in how the config is being called within _shift_right

@yohann-benchetrit yohann-benchetrit force-pushed the ybenchetrit-add-shift-right-helper-T5 branch 2 times, most recently from a84d8a2 to 56d1316 Compare March 28, 2023 16:53
@yohann-benchetrit yohann-benchetrit force-pushed the ybenchetrit-add-shift-right-helper-T5 branch from 56d1316 to 4708c20 Compare March 28, 2023 16:53
Copy link
Contributor

@joecummings joecummings left a comment

Choose a reason for hiding this comment

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

LGTM!

@joecummings joecummings merged commit cc0b7b0 into pytorch:main Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add _shift_right helper function to T5 model
4 participants