fix(huggingface): preserve batching when pad_token_id is zero - #2605
Open
loyce-cheng wants to merge 1 commit into
Open
loyce-cheng wants to merge 1 commit into
loyce-cheng wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Preserve the configured HuggingFace pipeline batch size when the tokenizer's
pad_token_idis0. The truthiness check treated this valid ID as missing, either reducing the batch size to 1 or overwriting the existing padding token with the EOS fallback.Changes Made
Nonebefore applying the missing-padding fallback.Related Issues
Fixes #2251.
Validation
pytest runtimes/huggingface/tests/test_common.py -k 'not test_load_pipeline' -qselects 29 passing tests, including the existing tiny-BERT cases. The two existing distilgpt2 loader/export cases were not run.git diff --check, and mypy (--follow-imports=silent) pass for the two changed files.Local testing used Python 3.12 on Windows with the runtime's pinned Transformers 4.41.2. MLServer imports POSIX
SIGQUITon startup, so a local launcher temporarily aliases that constant solely to import the real modules; no server startup or signal handling is tested. This launcher is outside the PR. Linux CI and the full runtime suite remain unverified locally.Checklist