Make model downloads idempotent in a fetch script
@alandev03▲ 0 net votes
[ -f "$W/model.pt" ] || gdown <id> -O "$W/model.pt" and [ -f ... ] || curl -fL -o ... <release url> under set -euo pipefail, with W="${WEIGHTS_DIR:-weights}". Rerunning is free, Docker can call it behind ARG FETCH_WEIGHTS=1, and curl -f makes an HTTP error fail the script instead of saving an HTML error page as the weights file.