mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #908] [CLOSED] setup: ModelScope as a download source (--source), used when Hugging Face's files do not answer #2909
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2909
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/908
Author: @star1872
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:setup-modelscope📝 Commits (10+)
fa16567setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it📊 Changes
5 files changed (+256 additions, -4 deletions)
View changed files
📝
docs/INSTALL.md(+9 -0)📝
setup.py(+98 -3)📝
tools/mtp_fetch.py(+6 -0)➕
tools/test_setup_modelscope.py(+140 -0)📝
tools/test_setup_pins.py(+3 -1)📄 Description
setup can download every file from ModelScope:
--source auto|modelscope|huggingface(or
STRATA_SOURCE).auto(the default) keeps Hugging Face; it takes ModelScope only when a model file onhuggingface.co does not answer, which is the usual case in mainland China.
HF_ENDPOINT(#495) still means HuggingFace (a mirror chosen on purpose).
What is on ModelScope
Every repository setup downloads from exists there under the same name with the same paths and sizes (checked
2026-10-05 through ModelScope's file API):
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF,...-Coder-GGUF,ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF,unsloth/Qwen3.8-Flash-Next-GGUFandQwen/Qwen3.8-Flash-Next(the MTP tensors).
How it is checked
ModelScope serves a repository's current files, not a pinned revision. So:
download()maps a Hugging Face file of a known repository (HF_REVISIONS) to ModelScope's URL and, when done,checks the file against the SHA-256 ModelScope publishes for it (
verify_sha256, kept in the.donemark as forthe Unsloth files). A wrong file is deleted and setup stops, as before.
tools/mtp_fetch.pywithSTRATA_SOURCE=modelscopereads the checkpoint from ModelScope;REPOandPINNEDarethen the same URL, so every MTP tensor is still checked against the pinned revision's SHA-256 (#327).
HF_ENDPOINT/ Hugging Face as before.Why a file and not the site
From a PC in mainland China on 2026-10-05:
huggingface.coitself answered, but a file's redirect to its CDN did not(connection reset), so
autoasks for a model file (a HEAD request, following the redirect, 10 s). ModelScope's APIanswers HEAD with 404, so its side is asked for a file too, the same request
download()makes.Measured on that PC
STRATA_SOURCE=autopicked ModelScope (in under a second) anddownload()fetched and verified a file;STRATA_SOURCE=huggingfacestopped with "cannot reach huggingface.co" as before.ModelScope's SHA-256, and Q2_0's shard 1 matching the copy from hf-mirror.com byte for byte; the MTP tensors from
Qwen/Qwen3.8-Flash-Nextall matched the pinned hashes (31 tensors, 5.2 GB, ~3.3 MB/s).Tests
tools/test_setup_modelscope.py(8, no network: a local HTTP server laid out as ModelScope): the source choice(explicit,
HF_ENDPOINT,autowith either side answering), the URL mapping, a right hash kept, a wrong one deleted,no published hash, and the fall back to Hugging Face.
tools/test_setup_pins.py's gone-revision test now setsSTRATA_SOURCE=huggingface, since it counts Hugging Face requests andautoprobes first. Alltools/test_setup_*.pypass.
Not done
A whole install through setup from ModelScope (the files were fetched by these functions and by hand, not by one setup
run); the ready-made engine and llama.cpp's zip still come from GitHub.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.