Scan HuggingFace Hub cache during model discovery using hf-hub crate#17
Open
DylanSchell wants to merge 1 commit into
Open
Scan HuggingFace Hub cache during model discovery using hf-hub crate#17DylanSchell wants to merge 1 commit into
DylanSchell wants to merge 1 commit into
Conversation
Contributor
Author
|
working on the download code |
93e21c2 to
bc7ad0a
Compare
Contributor
Author
|
Download to HF cache is working. delete is working, but it only deletes the symlink under the snapshots folder ( I assume this is expected behavior for hf cache management, since the blob might be used by multiple models. like mmproj files? ) |
7740f37 to
20b047e
Compare
Add opt-in support for downloading models directly into the HuggingFace Hub cache (HF_HOME or ~/.cache/huggingface/) via the hf-hub crate, and scanning that cache during model discovery. - Toggle HF cache on/off at runtime with a config flag - Download models into HF cache structure (blobs/ + snapshots/) with proper progress tracking using cumulative atomic byte counters - Scan existing HF cache alongside configured model directories - Skip redundant downloads by checking if cached files already exist - Clean up stale .lock files left by hf-hub after downloads - Show mmproj picker dialog when downloading from the recommended tab, using actual HF API file sizes instead of estimates - Delete all symlinks in a snapshot commit directory when pruning HF cache models (model weights + mmproj companions), then prune orphaned blobs and empty directories - Accept any mmproj symlink in HF cache snapshot directories as a valid companion, since the shared commit directory proves they belong to the same repo
48aa5c2 to
9e45aed
Compare
Contributor
Author
|
delete code now also in place. I've tested this on a macOs machine, not quite sure if windows would need special handling, since I assume HF cache does not use symlinks on windows. |
Contributor
Author
|
the mmproj picker did not appear when downloading from the recommended models page, so that was also added |
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.
Use hf_hub::Cache::from_env() to discover GGUF files in the HuggingFace Hub cache (respects HF_HOME environment variable). Models are scanned alongside user-configured directories and shown with an 'HF' badge in the UI so users can distinguish them from their own directories.
Partial implementation of #14