Spaces:
Paused
Fix: Pre-download models in Dockerfile to avoid runtime hang
Browse filesRoot cause analysis:
- preload_from_hub ignores HF_HOME (documented limitation)
- Previous approach caused permission conflicts → fallback to /tmp
- local_files_only=True + no models in /tmp = startup failure
Solution (best practice from research):
- Manually download models in Dockerfile to default ~/.cache location
- Download as 'user' to avoid permission issues
- Keep local_files_only=True (models already cached)
- Build logs show download progress (transparent to user)
Changes:
- README.md: Remove preload_from_hub (has limitations)
- Dockerfile: Add manual model download step (lines 100-119)
- All models download during build → instant runtime startup
Benefits:
✅ Build logs show download progress (no "hanging" confusion)
✅ Runtime startup is instant (models already in image)
✅ No permission conflicts (consistent user ownership)
✅ Works on free tier (no /data persistent storage needed)
Updated: README.md
|
@@ -7,9 +7,6 @@ sdk: docker
|
|
| 7 |
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
-
preload_from_hub:
|
| 11 |
-
- 0xZohar/object-assembler-models
|
| 12 |
-
- openai/clip-vit-base-patch32
|
| 13 |
env:
|
| 14 |
HF_HOME: /home/user/.cache/huggingface
|
| 15 |
HF_HUB_CACHE: /home/user/.cache/huggingface/hub
|
|
|
|
| 7 |
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
|
|
|
|
|
|
|
|
|
| 10 |
env:
|
| 11 |
HF_HOME: /home/user/.cache/huggingface
|
| 12 |
HF_HUB_CACHE: /home/user/.cache/huggingface/hub
|