Repository navigation
Release to main: load local models on transformers 5 (#448) - #449
Merged
Merged
Conversation
…formers Installing from main into a fresh environment now resolves transformers 5.17.0 (CI resolves the same). transformers 5 no longer defines `use_auth_token` anywhere, and from_pretrained forwards keywords it does not recognise to the model's constructor. load_model_from_transformer passed `use_auth_token=token` to both AutoTokenizer and AutoModelForCausalLM, so the local-model path, including running on CPU with no API key, was exposed on any current install. CI did not catch it: the loader tests replace from_pretrained with fakes that accept any keyword. The loader now passes `token=` only when a token is given, and nothing when it is not, so public models load the same way on every transformers version. Two tests pin this: a given token reaches both from_pretrained calls as `token` and `use_auth_token` is never sent, and no token keyword is sent when the token is None or empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix(llm): pass token, not use_auth_token, so local models load on transformers 5
|
Code Hygiene The following items are defined but not yet in active use. Routine cleanup — no impact on functionality.
|
|
Complexity Analysis Average: C — Moderate (13.75) Hotspots tracked below. These are functional, well-exercised components — listed for visibility as the codebase scales.
|
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.
Brings #448 from
devtomain. It was reviewed and merged intodevin #448; this PR only promotes it.Why this is urgent
On
main, a fresh install cannot create a local-model extractor. That includes the CPU, no-API-key path that the documentation and the JOSS review thread point reviewers to:A fresh install now resolves transformers 5.17.0, which removed
use_auth_token. The loader still passed it.What reaches
mainb015a10fix(llm): passtoken, notuse_auth_token, when loading with transformers. The loader sendstoken=only when a token is given, so public models load the same way on every transformers version. Two tests guard against a regression.Verification (from #448)
black,isortandflake8: clean. Tests (-m "not index"): 61 passed, 5 skipped (need API keys), 1 deselected.Qwen/Qwen2.5-0.5B-Instructon CPU with no API key and returned aligned skills. The same run onmainfails with the error above.After merge
pip install "git+https://github.com/LAiSER-Software/extract-module@main", in a fresh environment, and confirm the no-API-key example works.🤖 Generated with Claude Code