mirror of
https://github.com/unslothai/unsloth.git
synced 2026-04-28 03:19:57 +00:00
fix: derive HF_HUB_CACHE from HF_HOME when set
Previously HF_HUB_CACHE always defaulted to ~/.cache/huggingface/hub even when HF_HOME was explicitly set (e.g. in Docker). This caused models to download to the wrong location instead of the configured HF_HOME path.
This commit is contained in:
parent
c26d909265
commit
b362c60719
1 changed files with 3 additions and 2 deletions
|
|
@ -148,10 +148,11 @@ def _setup_cache_env() -> None:
|
|||
os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")
|
||||
).expanduser()
|
||||
hf_default = xdg_cache / "huggingface"
|
||||
hf_home = Path(os.environ.get("HF_HOME", str(hf_default)))
|
||||
defaults: dict[str, str] = {
|
||||
"HF_HOME": str(hf_default),
|
||||
"HF_HUB_CACHE": str(hf_default / "hub"),
|
||||
"HF_XET_CACHE": str(hf_default / "xet"),
|
||||
"HF_HUB_CACHE": str(hf_home / "hub"),
|
||||
"HF_XET_CACHE": str(hf_home / "xet"),
|
||||
"UV_CACHE_DIR": str(root / "uv"),
|
||||
"VLLM_CACHE_ROOT": str(root / "vllm"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue