diff --git a/scripts/download-frank-dragoon-npu.sh b/scripts/download-frank-dragoon-npu.sh index 04a7fe8..ca7dfab 100755 --- a/scripts/download-frank-dragoon-npu.sh +++ b/scripts/download-frank-dragoon-npu.sh @@ -105,7 +105,18 @@ for MODEL in ${MODELS//,/ }; do # 62 GiB fetch hit this on 2026-10-18). url=$(curl -sfIL -o /dev/null -w '%{url_effective}' "$HF/$NPU_REPO/resolve/$NPU_REV/$f") \ || { echo "cannot resolve $NPU_REPO/$f" >&2; exit 1; } - curl -fL --retry 5 -C - -o "$path" "$url" + # Resume ONLY into a genuinely partial file. A staged file of a + # DIFFERENT size is an artifact of another revision (a version + # bump re-cuts the device programs), and `-C -` against it + # appends the tail to the old bytes: the result is the right + # BYTE COUNT with the wrong content, which reads as a corrupt + # program, not as a fetch fault (measured 2026-10-30 on + # consts.hnpb). Fetch those from zero. + resume=() + if [ -f "$path" ] && [ "$(stat -c %s "$path")" -lt "$want" ]; then + resume=(-C -) + fi + curl -fL --retry 5 "${resume[@]+"${resume[@]}"}" -o "$path" "$url" fi fi [ -f "$path" ] || { echo "MISSING $path (run without --verify-only)" >&2; exit 1; }