Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(docker): clarify conditional ModelScope digest verification

gqchend717361eebc7
diff --git a/docker/prefetch_modelscope.py b/docker/prefetch_modelscope.py
index 95ca680c..b986542f 100644
--- a/docker/prefetch_modelscope.py
+++ b/docker/prefetch_modelscope.py
@@ -9,13 +9,13 @@ way the Hub would have, and every code path that names a checkpoint keeps its id
revision handling: `Agent(...)`, the `Router` laya-serve builds, `laya.cli`, the integrations.
Only the standard library is used, because an image build has no reason to install the
-ModelScope SDK for a handful of HTTP calls. Every file is streamed with resume and its size and SHA-256
-are checked against the values the repository API reports, so a truncated or substituted
-download fails the build instead of shipping inside a layer that looks healthy.
+ModelScope SDK for a handful of HTTP calls. Every file is streamed with resume and its size is
+checked against the value the repository API reports. SHA-256 is checked only when the API
+publishes a digest; without one, a same-size substitution cannot be detected.
Usage inside a Dockerfile RUN:
- python prefetch_modelscope.py --models convaiinnovations/laya:multilingual \
+ python prefetch_modelscope.py --model convaiinnovations/laya:multilingual \
--revision master --cache-dir "$HF_HOME/hub"
Each spec is `repo[:subfolder]`; the subfolder selects one checkpoint from the bundled
diff --git a/docs/docker.md b/docs/docker.md
index 3aafb4b8..458664e6 100644
--- a/docs/docker.md
+++ b/docs/docker.md
@@ -204,10 +204,9 @@ snapshot. Nothing else changes: `Agent`, the `Router` that `laya-serve` builds,
`laya.cli` and the integrations keep their repo ids and resolve them to the baked
snapshot, so a container built this way needs no network at all. Each file's size
is checked against what the repository reports before the snapshot is published,
-and its SHA-256 as well when the repository publishes one, so a truncated or
-substituted download fails the build instead of shipping inside a layer that
-looks healthy. A repository that publishes no digest leaves the check to size
-alone.
+and its SHA-256 as well when the repository publishes one. A size or digest
+mismatch fails the build. A repository that publishes no digest leaves the
+check to size alone, which cannot detect a same-size substitution.
| Variable | Default | Purpose |
| --- | --- | --- |
@@ -256,7 +255,8 @@ repository-wide key there is. Hub-side pins do not describe a mirror snapshot:
artifact hashes, so neither applies here, and no digest pin exists for a mirror
snapshot either. The build already refuses a download that does not match the
mirror's own reported size -- and its digest, when the mirror publishes one --
-which is the equivalent guarantee for this path. And the weights come from
+but this checks consistency with mirror metadata, not an independently pinned
+digest. The weights come from
whichever mirror account the argument names, which is its own supply-chain
decision for the deployment to make.