Skip to content

fix: clean config-only export cache metadata#3929

Open
liding-nv wants to merge 1 commit into
mainfrom
liding/hf_download_cleanup
Open

fix: clean config-only export cache metadata#3929
liding-nv wants to merge 1 commit into
mainfrom
liding/hf_download_cleanup

Conversation

@liding-nv
Copy link
Copy Markdown
Contributor

Follow-up to #3924, which removed stale remote-code metadata from HF exports and added cleanup for Hugging Face Hub local_dir metadata.

This extends the same .cache/huggingface/ cleanup to the config-only export path, where remote-code files are downloaded directly with hf_hub_download(...). The added unit test verifies that downloaded Python files remain while Hub metadata is removed from the exported model directory.

Signed-off-by: Li Ding <liding@nvidia.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 22, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@liding-nv
Copy link
Copy Markdown
Contributor Author

/ok to test b89d123

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2026

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.

@yaoyu-33 yaoyu-33 added area:ckpt Checkpoint conversion, loading, export, and save paths bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ckpt Checkpoint conversion, loading, export, and save paths bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants