Pull requests / #3028

#3028 setup: --skip-gguf-sha256, for a model file that is another build of the model setup pins

open · @iMilnb · 0 comentários · No GitHub

Setup & installModels & quantsDocumentation

Descrição

## What this adds

One opt-in setup flag: `python setup.py --skip-gguf-sha256`. With it, `verify_sha256`
compares neither the pinned size nor the pinned SHA-256 of the model files (GGUF shards
and the mmproj), warns with the size on disk next to the pinned size and the pinned
hash prefix, and keeps the file instead of deleting it. Without the flag the default
path is byte-identical to v0.1.45.

## Why

We often want to run a variant of a model Strata officially supports instead of the
pinned repository file: for example huihui-ai's
[Huihui-Qwen3.8-Flash-Next-abliterated-v2-GGUF](https://huggingface.co/huihui-ai/Huihui-Qwen3.8-Flash-Next-abliterated-v2-GGUF)
instead of unsloth's [Qwen3.8-Flash-Next-GGUF](https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF)
(the same model, refusal answers edited out, re-sharded: same architecture, so the
engine runs it, but neither the file sizes nor the hashes match the pins in `setup.py`).
Today setup deletes such a file and stops, and the only workaround is editing
`verify_sha256` out of `setup.py` by hand. Same symptom from #2635 and #2346, where a
repository moved its file after the pin was taken; see also #1979 and #2842.

## What it leaves alone

- The ready-made engine keeps its own separate switch (`STRATA_SKIP_SHA256`,
  `check_engine_digest`); neither one implies the other, and a test pins that.
- `check_shards` still reads the GGUF headers, so a truncated or incompatible file is
  refused even with the flag.
- A skipped file's `.done` mark records `sha256 skipped (N bytes)`, so a later run
  without the flag hashes it again and re-arms the normal check.
- ModelScope's published-hash check, the Vulkan SDK archive and `metal/setup_mac.py`
  keep verifying as before (the Mac path does not take the flag yet).

## How I checked

- New tests in `tools/test_setup_unsloth.py`: the skip accepts a different build and
  keeps the file, skips the hashing, re-hashes a mark from an earlier skipped run, and
  `STRATA_SKIP_SHA256=1` alone does not relax the model-file check; one end-to-end test
  shows the flag reaching every pinned model file (`main()` with `--skip-gguf-sha256`).
- All 41 `tools/test_setup_*.py` suites pass on this branch, except
  `test_setup_engine_hash` (2) and `test_setup_golden` (8), which fail identically on a
  clean `477ac13c` in the same checkout (verified with the branch's changes stashed).
- Docs: one line in `docs/INSTALL.md` and the `docs/DETAILS.md` option list, plus a
  `docs/TROUBLESHOOTING.md` entry for "setup says a model file has the wrong SHA-256,
  or the wrong size" that spells out the two separate switches.

No site

Links install, modelos, releases.