fix(inference): pass the token through when loading the encoder - #362
Merged
stephantul merged 2 commits intoSep 10, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
stephantul
approved these changes
Sep 10, 2026
stephantul
left a comment
Contributor
There was a problem hiding this comment.
Hey @serhiizghama,
Thanks for spotting this, great find!
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.
StaticModelPipeline.from_pretraineddocuments that a private hub model needs a token, and it does use it — but only forhead.safetensors. The encoder load right after it callsStaticModel.from_pretrained(folder_or_repo_path)with no token, so on a private repo the head downloads fine and the model itself then fails auth. Same call inconvert_legacy_pipeline, so the legacy path has it too. Passedtokenthrough in both places.test_load_pipeline_from_hubdoesn't catch this because it patchesStaticModel.from_pretrainedwholesale and only asserts on the head download, so I added two tests that check the token actually reaches the encoder call — one per path. Both fail on main (assert None == 'secret') and pass with the change; full suite 295 passed, ruff clean.