Repository navigation
README: mount the Hugging Face cache in the Docker quickstart - #11062
Conversation
Reported in #10923: models downloaded in the container disappear on docker rm. Measured in unsloth/unsloth@sha256:3b88aa35b378: HF_HOME is /workspace/.cache/huggingface, huggingface_hub and Studio's own resolver both put downloads under it, and it is on no volume, so it lives in the container's writable layer. The unsloth-studio volume covers accounts, chats and Studio state, not model weights. Reproduced by container replacement rather than restart: a fresh container from the same digest could not resolve a previously downloaded model with HF_HUB_OFFLINE=1, and could once the cache was mounted. The mount is copied verbatim from docker/DOCKERHUB.md, which already documents it, so the README stops being the outlier rather than inventing a third variant. The surrounding sentence now says which store keeps what, since 'keeps your accounts, chats and trained models' reads as though downloads are covered too.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e13d45145a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| -p 8000:8000 -p 8888:8888 \ | ||
| -e UNSLOTH_STUDIO_PASSWORD="mypassword" -e JUPYTER_PASSWORD="mypassword" \ | ||
| -v "$PWD":/workspace/host \ | ||
| -v "$HOME/.cache/huggingface":/workspace/.cache/huggingface \ |
There was a problem hiding this comment.
Avoid writing the host Hugging Face cache as root
When this quickstart is used on Linux/WSL and native Hugging Face tools also use $HOME/.cache/huggingface, the latest image runs its services as root (docker/DOCKERHUB.md:129), so models downloaded through the container leave root-owned directories, refs, and lock files in the user's cache. Subsequent host-side downloads or cache maintenance can then fail with permission errors, breaking the advertised shared-cache workflow; use a named volume or otherwise arrange host-UID ownership rather than binding the live user cache to this root process.
Useful? React with 👍 / 👎.
…hai#11062) Reported in unslothai#10923: models downloaded in the container disappear on docker rm. Measured in unsloth/unsloth@sha256:3b88aa35b378: HF_HOME is /workspace/.cache/huggingface, huggingface_hub and Studio's own resolver both put downloads under it, and it is on no volume, so it lives in the container's writable layer. The unsloth-studio volume covers accounts, chats and Studio state, not model weights. Reproduced by container replacement rather than restart: a fresh container from the same digest could not resolve a previously downloaded model with HF_HUB_OFFLINE=1, and could once the cache was mounted. The mount is copied verbatim from docker/DOCKERHUB.md, which already documents it, so the README stops being the outlier rather than inventing a third variant. The surrounding sentence now says which store keeps what, since 'keeps your accounts, chats and trained models' reads as though downloads are covered too.
Reported in #10923: models downloaded inside the container disappear on
docker rm.The cause, measured
Inside
unsloth/unsloth@sha256:3b88aa35b378e83db3f567cfb668931695f7bac951dcef37fa6a1f5e2e96fae1:huggingface_huband Studio'sget_hf_cache_paths().hub_cacheagree on the destination, and that destination is on no volume, so it lives in the container's writable layer. Theunsloth-studiovolume covers accounts, chats and Studio state, not model weights.Reproduced and fixed, by container replacement
A restart does not cross the boundary where the writable layer is discarded, so the test removes the container and starts a fresh one from the same digest, then resolves the model with
HF_HUB_OFFLINE=1:The change
docker/DOCKERHUB.mdalready mounts$HOME/.cache/huggingfacein its quickstart and documents the path in its volume table, anddocker/run.shpasses the same flag. The README was the outlier, so the mount here is copied fromdocker/DOCKERHUB.mdverbatim rather than inventing a third variant. A host bind mount also lets the container reuse models the host has already downloaded.The surrounding sentence changes too: "the
unsloth-studiovolume keeps your accounts, chats and trained models" reads as though downloads are covered, so it now says which store keeps what.Not fixed here
This does not close #10923. The command that reporter followed is on
unsloth.ai/docs/get-started/install/docker, which documents neither this mount nor theunsloth-studiovolume and describes a container layout that no longer matches the image. That page is maintained outside this repository and needs the same correction.