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 a dedicated padding token to beam search to avoid padding with the start sentence token #11181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laxmareddyp
Copy link
Collaborator

Description

So far, the beam search module pads its predictions using the initial token ids, it is more modular and easy to use to have the capacity to specify the padding token. By default this padding token should be zero and not the initial token id.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Tests

I have added a naive unittest which failed before my modification and passes now.

Checklist

@laxmareddyp laxmareddyp requested review from Chen-Zhe and removed request for saberkun, rachellj218 and lehougoogle March 5, 2024 22:15
@laxmareddyp laxmareddyp added the models:official models that come under official repository label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models:official models that come under official repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant