Add prefetch-models.sh to download AI models on host when container DNS is blocked

Lets SAM, U2Net, BEN2, and BiRefNet-HR (optionally SDXL via --sdxl) be
downloaded outside Docker into ./data/, which is already bind-mounted
into the GPU container — so a blocked container network no longer blocks
first-run setup. Reuses the existing dual-mode download_sam_model.py and
download_u2net_model.py as-is. For the HuggingFace Hub models, sets
HF_HOME (rather than --cache-dir) so the host-side cache layout matches
the container's default ~/.cache/huggingface resolution exactly, avoiding
a path-nesting mismatch between the two.

Wired into install-local-gpu.sh's completion banner and
bring-up-local-gpu.sh's header, and referenced from the relevant README
troubleshooting sections and the hf_cache bind-mount comment in
docker-compose.gpu.yml.
This commit is contained in:
Claude
2026-06-18 16:13:11 +00:00
parent 38e80f8fb8
commit 3a977c7438
5 changed files with 123 additions and 7 deletions
+4
View File
@@ -162,4 +162,8 @@ echo ""
echo "=================================================="
echo " Setup complete."
echo " Start the app with: ./bring-up-local-gpu.sh"
echo ""
echo " If models fail to download inside the container (DNS/firewall"
echo " blocked), fetch them on the host first instead:"
echo " ./prefetch-models.sh"
echo "=================================================="