Repository navigation
[Generate] Avoid unconditionally downloading remote hub file - #48620
Merged
Merged
Conversation
Collaborator
Author
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
VI-Arthur
approved these changes
Sep 8, 2026
Comment on lines
+607
to
+616
| # Check for the existence of the file without actually downloading it | ||
| # (preventing unwanted downloads of files, even if not executed) | ||
| has_file_kwargs = { | ||
| "revision": kwargs.get("_commit_hash") or kwargs.get("revision") or "main", | ||
| "proxies": kwargs.get("proxies"), | ||
| "token": kwargs.get("token"), | ||
| "cache_dir": kwargs.get("cache_dir"), | ||
| "local_files_only": kwargs.get("local_files_only", False), | ||
| "repo_type": kwargs.get("repo_type"), | ||
| } |
There was a problem hiding this comment.
can't you just use the kwargs? Or just pop the one you don't need before coming here?
Collaborator
Author
There was a problem hiding this comment.
Yea true that I kinda wanted to follow
transformers/src/transformers/modeling_utils.py
Lines 647 to 654 in 0514b65
but it's not really necessary / makes it bloated
vasqu
marked this pull request as ready for review
September 8, 2026 15:01
vasqu
enabled auto-merge
September 8, 2026 15:08
vasqu
disabled auto-merge
September 8, 2026 15:21
vasqu
enabled auto-merge
September 8, 2026 15:22
Contributor
CI recapDashboard: View test results in Grafana |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 8, 2026
Collaborator
Author
|
Gh was messing with me, finally |
sbucaille
pushed a commit
to sbucaille/transformers
that referenced
this pull request
Sep 16, 2026
…ngface#48620) * fix * oops * simplify * my own nits * style
shanaiabuggy
added a commit
to NVIDIA-NeMo/nemo-compass
that referenced
this pull request
Sep 21, 2026
## Summary - Bump the optional `local-embedding` dependency from `transformers==5.16.1` to `transformers==5.17.0` and refresh its lockfile artifacts. - Address the reported unauthorized remote-module cache write in `GenerationMixin.load_custom_generate()`: 5.17.0 checks remote-code consent before downloading the module. - Regenerate the third-party inventory and preserved license notices for the new version. No new dependencies or license types are introduced. ## Upstream fix huggingface/transformers#48620 Although the supplied advisory lists affected versions only through 5.8.1, inspection of 5.16.1 shows the download still occurs before the consent check. The 5.17.0 implementation contains the reordered consent check, and its behavior was verified locally. ## Validation - `pytest`: 321 passed (two existing LangSmith deprecation warnings). - Ruff lint and formatting, ty, and copyright-header checks passed. - Generated license freshness check passed for all 121 inventory entries. - Both workspace packages built successfully; license contents matched in wheels, source distributions, and wheels rebuilt from source distributions. - Installed the optional local-embedding dependencies and verified AutoModel/AutoTokenizer imports. A mocked remote-file existence check with `trust_remote_code=False` raised the expected error without calling `get_cached_module_file`. - `git diff --check` passed. No model weights were downloaded and full embedding inference was not exercised.
This was referenced Nov 19, 2026
This was referenced Dec 3, 2026
3 tasks done
1 of 2 tasks
This was referenced Dec 4, 2026
Closed
1 task
Vidit-Ostwal
pushed a commit
to crewAIInc/crewAI
that referenced
this pull request
Dec 4, 2026
- transformers 5.10.2 (locked) is affected by GHSA-x9r9-c232-4q39 (CVE-2026-80047, high): load_custom_generate downloads custom_generate/generate.py before the trust_remote_code check. - The advisory lists <= 5.8.1, but the fix (huggingface/transformers#48620) first shipped in 5.17.0, so scanners miss 5.9.0-5.16.1. - Raise the floor in pyproject.toml to transformers>=5.17.0 so downstream installs can't resolve an affected release. - Regenerated uv.lock with uv lock: transformers 5.20.2 (py<3.11) / 5.24.1 (py>=3.11); also bumps hf-xet, huggingface-hub, tokenizers. Co-authored-by: Vidit <[email protected]>
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.
As per title