models icon indicating copy to clipboard operation
models copied to clipboard

Add a dedicated padding token to beam search to avoid padding with the start sentence token

Open laxmareddyp opened this issue 11 months ago • 0 comments

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

  • [ ] I have signed the Contributor License Agreement.
  • [ ] I have read guidelines for pull request.
  • [ ] My code follows the coding guidelines.
  • [ ] I have performed a self code review of my own code.
  • [ ] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have made corresponding changes to the documentation.
  • [ ] My changes generate no new warnings.
  • [ ] I have added tests that prove my fix is effective or that my feature works.

laxmareddyp avatar Mar 05 '24 22:03 laxmareddyp