You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] #4972 (fix of #4945) rejects the Hub options it forwards: GPTQModel.load(quantized, token=...) now raises 'unexpected token (did you mean token?)' #5007
#4972 (fix of #4945) made ModelLoader.from_quantized raise TypeError for every keyword left in kwargs_without_internal after the known pops (gptqmodel/models/loader.py, the leftover = set(kwargs_without_internal) check in from_quantized). But the Hub staging options of huggingface_hub.snapshot_download are never popped: they are forwarded un-popped to get_model_local_path(model_id_or_path, **kwargs_without_internal) (which calls snapshot_download for a remote id) and are only added to the accepted set used for the error message (_accepted_quantized_load_kwargs -> inspect.signature(snapshot_download)). So token=, max_workers=, local_dir=, endpoint=, headers=, etag_timeout=, allow_patterns=, ignore_patterns=, repo_type= ... are first passed to snapshot_download and then rejected, with a self-contradicting message: "unexpected keyword token (did you mean token?) ... A quantized load accepts ..., max_workers, ..., token, ...".
GPTQModel.load("<org>/<private-gptq-repo>", token=...) worked before #4972 (the token reached snapshot_download) and now always raises. The commit message of #4972 itself says the accepted set includes "the Hub staging options", so this is unintended.
ERR ['token'] TypeError LlamaQModel.from_quantized: unexpected keyword argument(s) for a quantized checkpoint: `token` (did you mean `token`?). A quantized load accepts `_commit_hash`, ... `max_workers`, ... `token`, ...
ERR ['max_workers'] TypeError ... `max_workers` (did you mean `max_workers`?). A quantized load accepts ... `max_workers` ...
OK ['revision']
Pop the snapshot_download options that the loader forwards (or compute leftover as set(kwargs_without_internal) - accepted, where accepted includes the snapshot_download parameters), so the check and the message agree. token should also be forwarded consistently (config detection in GPTQModel.load currently uses only CONFIG_SELECTION_KWARGS, which lacks token).
Test that should have caught it
tests/test_load_strict_kwargs_4945.py::test_quantized_load_accepts_its_documented_keywords covers only the explicit/popped keywords; add token=None and max_workers= (any snapshot_download option) to it.
Severity
Medium: loading a private/gated quantized repo with an explicit token= (the standard HF pattern) now always fails; any snapshot_download tuning keyword fails too.
Agent release:agent-root-5007 finished this issue. Fix: #5016, squash-merged as eedb59498.
The leftover-keyword check now compares against the same accepted set its error message prints, so the snapshot_download staging options the loader forwards (token, max_workers, local_dir, endpoint, headers, etag_timeout, allow_patterns, ignore_patterns, repo_type) are accepted instead of rejected with the self-contradicting "unexpected keyword token (did you mean token?)". A real typo of a Hub option still raises (tokn= -> "did you mean token?"). token also joined CONFIG_SELECTION_KWARGS, so model-type detection reads the config with the caller's credential.
Red on unmodified main (5 failed / 8 passed: four Hub-option cases plus the config-selection test) -> 13 passed; neighbouring loader suites 73 passed; tests/test_local_model_paths.py 29 passed; ruff clean.
Activity
Qubitium commentedon Nov 17, 2026
Agent claim:
agent-root-5007is working on this issue now.Qubitium commentedon Nov 17, 2026
Agent release:
agent-root-5007finished this issue. Fix: #5016, squash-merged aseedb59498.The leftover-keyword check now compares against the same accepted set its error message prints, so the
snapshot_downloadstaging options the loader forwards (token,max_workers,local_dir,endpoint,headers,etag_timeout,allow_patterns,ignore_patterns,repo_type) are accepted instead of rejected with the self-contradicting "unexpected keywordtoken(did you meantoken?)". A real typo of a Hub option still raises (tokn=-> "did you meantoken?").tokenalso joinedCONFIG_SELECTION_KWARGS, so model-type detection reads the config with the caller's credential.Red on unmodified
main(5 failed / 8 passed: four Hub-option cases plus the config-selection test) -> 13 passed; neighbouring loader suites 73 passed;tests/test_local_model_paths.py29 passed; ruff clean.fix(load): accept the Hub staging options a quantized load forwards (M…