Repository navigation
Commit ca68c9e
authored
fix(config): forward token kwarg to get_config_dict in PreTrainedConfig.from_pretrained (#50081)
`token` is an explicit parameter of `PreTrainedConfig.from_pretrained` but was
never added to `kwargs` before calling `get_config_dict`. This caused it to
arrive as `None` in `cached_files`, silently dropping the caller's token.
Consequence: loading from private or gated repos using `token=` as a kwarg
only worked if `HF_TOKEN` was also set as an env var. In clean environments
(e.g. CI pipelines that pass the token explicitly without `hf auth login`),
it would fail with a 401 / RepositoryNotFoundError.
All other `from_pretrained` entry points (tokenizers, processors, feature
extractors) already forward `token` correctly. This was specific to the config
loading path.
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>1 parent 5e83c28 commit ca68c9e
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
880 | 881 | | |
881 | 882 | | |
882 | 883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
479 | 506 | | |
480 | 507 | | |
481 | 508 | | |
| |||
0 commit comments