fix: clean config-only export cache metadata#3929
Open
liding-nv wants to merge 1 commit into
Open
Conversation
Signed-off-by: Li Ding <liding@nvidia.com>
Contributor
Author
|
/ok to test b89d123 |
Contributor
|
LGTM -- small, focused fix that extends the .cache/huggingface/ cleanup from PR 3924 to the config-only export path. The finally block placement is correct: it runs after both the success and exception paths, and _cleanup_hf_local_dir_cache is safe to call when no cache directory exists. The test update realistically simulates hf_hub_download side effects (file + metadata) and verifies both that the downloaded file survives and that the cache is removed. Suggested test cases: No perf tests impacted. |
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.
Follow-up to #3924, which removed stale remote-code metadata from HF exports and added cleanup for Hugging Face Hub
local_dirmetadata.This extends the same
.cache/huggingface/cleanup to the config-only export path, where remote-code files are downloaded directly withhf_hub_download(...). The added unit test verifies that downloaded Python files remain while Hub metadata is removed from the exported model directory.