download_model.sh: stale SHA-256 for the 1017 Q2 checkpoint rejects a correct 341 GiB download
What happens
After 5379c1c switched DS41_Q2_FILE to DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf, artifact_identity() still expects the previous hash. hf download fetches the file correctly, then verify_download() aborts:
Downloading DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf
✓ Downloaded
Verifying SHA-256: .../DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf
Checksum mismatch: .../DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf. The file was not accepted.
Why it is the script, not the download
| Source | SHA-256 |
|---|---|
lfs.oid from the HF tree API for that file |
5296e85ff64b42ecb62c8d0c0c54e1caa07e3df8e93112f2365ebbaed62ce93a |
shasum -a 256 of the local file, all 365713686528 bytes |
5296e85ff64b42ecb62c8d0c0c54e1caa07e3df8e93112f2365ebbaed62ce93a |
download_model.sh, line 462 at 5379c1c |
1ce6a8f8806205c13330d7ca287bd198331dc5ca35ccc5d8a9a92a188a6f6f42 |
The size check passes (365713686528 bytes); only the hash comparison fails. The vision encoder entry (line 478) is already correct, so this is specific to the Q2 entry.
Impact
- 341 GiB are downloaded and then discarded.
- Re-running does not help: the file is present, so
verify_download()hashes it again and fails the same way.ds41f-q2cannot be completed with this commit. - The check also loses its diagnostic value here: "checksum mismatch" is indistinguishable from real corruption.
Patch
--- a/download_model.sh
+++ b/download_model.sh
@@ -459,7 +459,7 @@
"$DS41_Q2_FILE")
expected_bytes=365713686528
- expected_sha=1ce6a8f8806205c13330d7ca287bd198331dc5ca35ccc5d8a9a92a188a6f6f42
+ expected_sha=5296e85ff64b42ecb62c8d0c0c54e1caa07e3df8e93112f2365ebbaed62ce93a
;;
I have the same change on a fork branch (cropduster/ds4, branch fix/ds41-1017-sha256) and can open a PR if you prefer that over applying it here.
Environment
macOS 27.2, arm64 (Metal), hf 1.27.0, checkout at 5379c1c, file fetched from antirez/deepseek-v4.1-flash-gguf.
Unrelated: #1189 reports Model 'antirez/deepseek-v4.1-flash-gguf' not found with the older DeepSeek-V4.1-Flash-Q2.gguf name — different failure, not covered by this patch.
Update (Nov 6): fixed on main by a101246, which sets expected_sha=5296e85ff64b42ecb62c8d0c0c54e1caa07e3df8e93112f2365ebbaed62ce93a for this file. Nothing left to do here.
Independent confirmation, checked without downloading the model.
At current main (5379c1c, the same commit that renamed DS41_Q2_FILE), download_model.sh:462 expects 1ce6a8f8806205c13330d7ca287bd198331dc5ca35ccc5d8a9a92a188a6f6f42 for DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf. That is the SHA-256 of the previous file, DeepSeek-V4.1-Flash-Q2.gguf, which is still in the HF repo with exactly the same size, so the size check passes and only the hash check fails:
$ B=https://huggingface.co/antirez/deepseek-v4.1-flash-gguf/resolve/main
$ curl -sIL $B/DeepSeek-V4.1-Flash-1017-IQ2_XXS-Q2_K-imatrix.gguf | grep -i '^x-linked'
x-linked-size: 365713686528
x-linked-etag: "5296e85ff64b42ecb62c8d0c0c54e1caa07e3df8e93112f2365ebbaed62ce93a"
$ curl -sIL $B/DeepSeek-V4.1-Flash-Q2.gguf | grep -i '^x-linked'
x-linked-size: 365713686528
x-linked-etag: "1ce6a8f8806205c13330d7ca287bd198331dc5ca35ccc5d8a9a92a188a6f6f42"
/api/models/antirez/deepseek-v4.1-flash-gguf/tree/main gives the same lfs.oid values (HF repo commit 9dcee51).
The offline test sees it too: at 5379c1c python3 -m unittest tests.test_model_download fails 7 of 9 tests, because its fixture still names the old Q2 file.
The fix already exists in three open PRs, all with the same 2-line change (download_model.sh:462 plus the test fixture) and the correct hash. None of them links this issue:
- #1232 (676297c): only this fix
- #1242 (f75e48e, 158b751): the same fix
- #1233: includes it as e44cd19, together with unrelated CUDA multi-GPU work
With any of the three on top of 5379c1c, tests.test_model_download passes 9/9. #1232 or #1242 can be merged on their own, without the CUDA changes in #1233.
Disclosure: written by an AI agent (Claude) operating this account with its owner's permission; the checks above were actually run.
Fixed in a101246: download_model.sh now expects 5296e85f...ce93a for the 1017 Q2 file. It can be closed.