unsloth/studio
Daniel Han 6e91d1dff8
Studio: scan HF cache snapshot loads by their repo id (#7398)
* Studio: scan HF cache snapshot loads by their repo id

Inactive Hugging Face caches (legacy, default, and previously selected
download locations) are loaded by their resolved snapshot path so they
keep using the selected cache instead of re-downloading. That path is a
local filesystem path, so evaluate_file_security exempted it with
"local path; no Hub scan" and skipped Hugging Face's pickle/malware
scan. Active caches load by repo id and are still scanned, so the same
model could dodge the gate simply by being in an inactive cache.

An HF cache snapshot keeps the canonical models--org--repo/snapshots/<rev>
layout, so recover the repo id from that path and scan it instead of
exempting it. Non-cache local paths (models directory, custom folders)
still skip the scan, and a remote ref is still scanned by repo id.

Adds a regression test that a flagged pickle in an inactive-cache
snapshot path blocks the load.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Studio: scan the exact cached commit for inactive HF caches

An HF cache snapshot path encodes the commit, not just the repo id
(models--org--repo/snapshots/<rev>). Recover the revision alongside the
repo id and pass it to model_info and the shard-index lookup so the scan
covers the exact files that will be deserialized, rather than the repo's
default branch. Without this, a pickle in an older cached commit that was
later removed from the branch would scan clean and still load.

Extends the regression test to assert the recovered revision is forwarded
to the Hub scan.

---------

Co-authored-by: danielhanchen <unslothai@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-24 02:12:00 -07:00
..
backend Studio: scan HF cache snapshot loads by their repo id (#7398) 2026-07-24 02:12:00 -07:00
frontend Studio: register text-ui tokens with tailwind-merge so cn() keeps them (#7396) 2026-07-24 00:48:54 -07:00
src-tauri Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py fix(studio): opt-in source-build GPU smoke validation (#7322) 2026-07-23 19:13:54 -07:00
install_node_prebuilt.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
install_python_stack.py fix(install): infer Strix gfx when ROCm runtime is absent (#7305) 2026-07-22 20:16:45 -05:00
install_whisper_prebuilt.py Studio whisper: pair slim bundles on the ggml commit, not the full llama tag (#7381) 2026-07-23 20:18:36 -07:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
MCP.md Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
node_prebuilt_pins.json Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
package-lock.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
package.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
prebuilt_core.py Studio: add local speech-to-text dictation engine (#7095) 2026-07-23 01:39:03 -07:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 Studio: add local speech-to-text dictation engine (#7095) 2026-07-23 01:39:03 -07:00
setup.sh fix(studio): opt-in source-build GPU smoke validation (#7322) 2026-07-23 19:13:54 -07:00
Unsloth_Studio_Colab.ipynb Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00