fix(docker): use hf_hub_download for HuggingFace models to fix CDN 504s

urlretrieve against the HuggingFace CDN was consistently returning HTTP
504 in GitHub Actions runners for LaMa, NAFNet, and the OpenCV caffemodel.
The huggingface_hub library has built-in retry logic, resumable downloads,
and better CDN routing than bare urlretrieve.

- download_lama_model: urlretrieve → hf_hub_download (Carve/LaMa-ONNX)
- download_nafnet_model: urlretrieve → hf_hub_download (mikestealth/nafnet-models)
- download_opencv_colorize_models: caffemodel → hf_hub_download (space repo_type)
- _urlretrieve: retry count 3→5, flat 10s delay → exponential backoff (10/20/40/80s)
- Also reverts the SKIP_MODEL_DOWNLOADS=true from CI workflow (wrong approach)
This commit is contained in:
Siddharth Kumar Sah
2026-04-14 23:05:09 +08:00
parent a8ce0a7559
commit b7033b3f53
2 changed files with 58 additions and 28 deletions
-1
View File
@@ -93,6 +93,5 @@ jobs:
file: docker/Dockerfile
push: false
tags: ashim:ci
build-args: SKIP_MODEL_DOWNLOADS=true
cache-from: type=gha,scope=unified
cache-to: type=gha,mode=max,scope=unified