Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

fix(models): every download is checked against a digest, and the upstreams are pinned

Jareer8ea74dc07a58
diff --git a/.github/workflows/models.yml b/.github/workflows/models.yml
index 361f711f..c40f5529 100644
--- a/.github/workflows/models.yml
+++ b/.github/workflows/models.yml
@@ -16,8 +16,8 @@ name: Mirror models
# A model whose row has no digest yet is recorded: the job fetches it,
# computes the sha256, writes it into models/manifest.toml and into the
# engine's table beside it, and uploads the patch as an artifact for a
-# maintainer to commit. Until that lands, the app accepts the download
-# unverified, which is what the empty digest means.
+# maintainer to commit. Until that lands, the app refuses the download:
+# a row with no digest is a model nobody can check.
on:
workflow_dispatch:
inputs:
diff --git a/models/manifest.toml b/models/manifest.toml
index ec6736a8..7eeb693a 100644
--- a/models/manifest.toml
+++ b/models/manifest.toml
@@ -23,10 +23,12 @@
# tag only when a model's bytes change - app releases point at it by name,
# so an unchanged model is never re-uploaded.
#
-# `sha256` is what the app verifies a finished download against. An empty
-# digest means the mirror has not been filled since the model was added;
-# the workflow prints what it computed, and that goes here and into the
-# engine's table beside it.
+# `sha256` is what the app verifies a finished download against, and a
+# download with no digest to check is refused, so a model added here is
+# unusable until its digest is: the workflow prints what it computed, and
+# that goes here and into the engine's table beside it. Hugging Face
+# upstreams are pinned to a commit rather than `main`, so the bytes the
+# fallback fetches are the bytes the digest names.
# The release every model is mirrored on.
release = "models-v1"
@@ -48,7 +50,7 @@ id = "cutout-object"
family = "cutout"
file = "isnet-general-use.onnx"
bytes = 178648008
-sha256 = ""
+sha256 = "60920e99c45464f2ba57bee2ad08c919a52bbf852739e96947fbb4358c0d964a"
licence = "Apache-2.0"
upstream = "https://github.com/danielgatis/rembg/releases/download/v0.0.0/isnet-general-use.onnx"
@@ -57,18 +59,18 @@ id = "cutout-brush-encoder"
family = "cutout"
file = "slimsam-77-encoder.onnx"
bytes = 23276014
-sha256 = ""
+sha256 = "9f8433273a6750b587779baa0cf5508111001bf7e7acfcf585d370139fd366d0"
licence = "Apache-2.0"
-upstream = "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/main/onnx/vision_encoder.onnx"
+upstream = "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/5850ab45f587c112167512ffef949107115e26a0/onnx/vision_encoder.onnx"
[[model]]
id = "cutout-brush-decoder"
family = "cutout"
file = "slimsam-77-decoder.onnx"
bytes = 16557892
-sha256 = ""
+sha256 = "f4514391764fbd56e08e119060d874ecd7d52994bfb1968af159e12d4943b5bb"
licence = "Apache-2.0"
-upstream = "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/main/onnx/prompt_encoder_mask_decoder.onnx"
+upstream = "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/5850ab45f587c112167512ffef949107115e26a0/onnx/prompt_encoder_mask_decoder.onnx"
# Enhance's restoration model. In the cutout family because the family is
# the engine table a row is checked against, and this one lives in the
@@ -80,7 +82,7 @@ file = "realesr-general-x4v3.onnx"
bytes = 4866417
sha256 = "1940a93ee08283a0a7286183186357b1688fe9fa8ede74604b424586aaddf112"
licence = "BSD-3-Clause"
-upstream = "https://huggingface.co/CoderViking/realesr-general-x4v3-onnx/resolve/main/realesr-general-x4v3.onnx"
+upstream = "https://huggingface.co/CoderViking/realesr-general-x4v3-onnx/resolve/c6a971706797c7502945a2b4c4274fce4900d4ab/realesr-general-x4v3.onnx"
# ── Text to speech ───────────────────────────────────────────────────────
# src/crates/concat-speech/src/tts.rs. Kokoro v1.0 multi-language, the
@@ -90,8 +92,8 @@ upstream = "https://huggingface.co/CoderViking/realesr-general-x4v3-onnx/resolve
id = "kokoro-int8-multi-lang-v1_0"
family = "tts"
file = "kokoro-int8-multi-lang-v1_0.tar.bz2"
-bytes = 131839838
-sha256 = ""
+bytes = 132303094
+sha256 = "4c3052abaa60943a341f193888cf6abd68787dae6ab8ae5c925a706caa247e4e"
licence = "Apache-2.0"
upstream = "https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-int8-multi-lang-v1_0.tar.bz2"
@@ -99,8 +101,8 @@ upstream = "https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/k
id = "kokoro-multi-lang-v1_0"
family = "tts"
file = "kokoro-multi-lang-v1_0.tar.bz2"
-bytes = 349418188
-sha256 = ""
+bytes = 349906910
+sha256 = "c5f7e2d2caf082bc1d20fb70334a61d99d20b484500aad32e7cf84c128ea3298"
licence = "Apache-2.0"
upstream = "https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2"
@@ -127,81 +129,81 @@ id = "chatterbox-turbo-tokenizer.json"
family = "chatterbox"
file = "chatterbox-turbo-tokenizer.json"
bytes = 3562272
-sha256 = ""
+sha256 = "3f04e34bea22f9144d1a19151154095bc9ce0430bf421304f5797e716288a906"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/tokenizer.json"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/tokenizer.json"
[[model]]
id = "chatterbox-turbo-embed_tokens_quantized.onnx"
family = "chatterbox"
file = "chatterbox-turbo-embed_tokens_quantized.onnx"
bytes = 2887
-sha256 = ""
+sha256 = "0efe1bc01c2c48a98425a74444fd9887924d887f922c2722a6ec961ebb9e1db6"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/embed_tokens_quantized.onnx"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/embed_tokens_quantized.onnx"
[[model]]
id = "chatterbox-turbo-language_model_quantized.onnx"
family = "chatterbox"
file = "chatterbox-turbo-language_model_quantized.onnx"
bytes = 279670
-sha256 = ""
+sha256 = "0b40581277e30b7034331ec8c3ad47ed71d321f015b387a95221e54e2fcbfde8"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/language_model_quantized.onnx"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/language_model_quantized.onnx"
[[model]]
id = "chatterbox-turbo-speech_encoder_quantized.onnx"
family = "chatterbox"
file = "chatterbox-turbo-speech_encoder_quantized.onnx"
bytes = 1205728
-sha256 = ""
+sha256 = "5b6f15870a43cf97892df86fc550a0ef4763522d527cde72b2a4316f80a34de4"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/speech_encoder_quantized.onnx"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/speech_encoder_quantized.onnx"
[[model]]
id = "chatterbox-turbo-conditional_decoder_quantized.onnx"
family = "chatterbox"
file = "chatterbox-turbo-conditional_decoder_quantized.onnx"
bytes = 2202035
-sha256 = ""
+sha256 = "2af3b150196d9d559cd3c91e03da80eb27a466032369dc2b57ea729cddad3ebb"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/conditional_decoder_quantized.onnx"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/conditional_decoder_quantized.onnx"
[[model]]
id = "chatterbox-turbo-embed_tokens_quantized.onnx_data"
family = "chatterbox"
file = "chatterbox-turbo-embed_tokens_quantized.onnx_data"
bytes = 67297376
-sha256 = ""
+sha256 = "9025d04c124899823124b1d7bb7069b1f535fb8a6c2d88f97520eb6fecced986"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/embed_tokens_quantized.onnx_data"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/embed_tokens_quantized.onnx_data"
[[model]]
id = "chatterbox-turbo-conditional_decoder_quantized.onnx_data"
family = "chatterbox"
file = "chatterbox-turbo-conditional_decoder_quantized.onnx_data"
bytes = 326548688
-sha256 = ""
+sha256 = "4918ca09e05e41d2b4aa1ace6201d1cd911ffc58a42801002bab177d495cfe0a"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/conditional_decoder_quantized.onnx_data"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/conditional_decoder_quantized.onnx_data"
[[model]]
id = "chatterbox-turbo-speech_encoder_quantized.onnx_data"
family = "chatterbox"
file = "chatterbox-turbo-speech_encoder_quantized.onnx_data"
bytes = 354676576
-sha256 = ""
+sha256 = "d59861fb55e806fbeee731da9d4f8ff819fb5735de5d15e262d902594ee4dbb6"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/speech_encoder_quantized.onnx_data"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/speech_encoder_quantized.onnx_data"
[[model]]
id = "chatterbox-turbo-language_model_quantized.onnx_data"
family = "chatterbox"
file = "chatterbox-turbo-language_model_quantized.onnx_data"
bytes = 367962860
-sha256 = ""
+sha256 = "ec9945df36cb5d131d46688f2609fd715fbfcb0b8ee9681af5c84118de2d55a2"
licence = "MIT"
-upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/language_model_quantized.onnx_data"
+upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/language_model_quantized.onnx_data"
# ── Transcription ────────────────────────────────────────────────────────
# src/crates/concat-speech/src/transcribe.rs. whisper.cpp's GGML
@@ -211,52 +213,52 @@ upstream = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main
id = "whisper-tiny.en"
family = "whisper"
file = "ggml-tiny.en.bin"
-bytes = 77700000
-sha256 = ""
+bytes = 77704715
+sha256 = "921e4cf8686fdd993dcd081a5da5b6c365bfde1162e72b08d75ac75289920b1f"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-tiny.en.bin"
[[model]]
id = "whisper-tiny"
family = "whisper"
file = "ggml-tiny.bin"
-bytes = 77700000
-sha256 = ""
+bytes = 77691713
+sha256 = "be07e048e1e599ad46341c8d2a135645097a538221678b7acdd1b1919c6e1b21"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-tiny.bin"
[[model]]
id = "whisper-base.en"
family = "whisper"
file = "ggml-base.en.bin"
-bytes = 147400000
-sha256 = ""
+bytes = 147964211
+sha256 = "a03779c86df3323075f5e796cb2ce5029f00ec8869eee3fdfb897afe36c6d002"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-base.en.bin"
[[model]]
id = "whisper-base"
family = "whisper"
file = "ggml-base.bin"
-bytes = 147500000
-sha256 = ""
+bytes = 147951465
+sha256 = "60ed5bc3dd14eea856493d334349b405782ddcaf0028d4b5df4088345fba2efe"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-base.bin"
[[model]]
id = "whisper-small.en"
family = "whisper"
file = "ggml-small.en.bin"
-bytes = 487600000
-sha256 = ""
+bytes = 487614201
+sha256 = "c6138d6d58ecc8322097e0f987c32f1be8bb0a18532a3f88f734d1bbf9c41e5d"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-small.en.bin"
[[model]]
id = "whisper-small"
family = "whisper"
file = "ggml-small.bin"
-bytes = 487600000
-sha256 = ""
+bytes = 487601967
+sha256 = "1be3a9b2063867b937e64e2ec7483364a79917e157fa98c5d94b5c1fffea987b"
licence = "MIT"
-upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin"
+upstream = "https://huggingface.co/ggerganov/whisper.cpp/resolve/5359861c739e955e79d9a303bcbc70fb988958b1/ggml-small.bin"
diff --git a/scripts/models.py b/scripts/models.py
index 053a554f..ede81767 100755
--- a/scripts/models.py
+++ b/scripts/models.py
@@ -196,7 +196,11 @@ def check() -> int:
for family, path in TABLES.items():
rows = [model for model in models if model.get("family") == family]
text = re.split(r'\n(?:#\[cfg\(test\)\]\s*)?mod tests?\s*\{', path.read_text(encoding="utf-8"))[0]
+ # An id may be a string constant rather than a literal, as the
+ # Pocket row's is: resolve `const NAME: &str = "..."` first.
+ consts = dict(re.findall(r'const (\w+): &str = "([^"]+)"', text))
ids = set(re.findall(r'^\s*(?:pub )?id: "([^"]+)"', text, re.M))
+ ids |= {consts[name] for name in re.findall(r'^\s*(?:pub )?id: (\w+),', text, re.M) if name in consts}
if family == "cutout":
ids = set(re.findall(r'^\s*file: "([^"]+)"', text, re.M))
wanted = {engine_id(model) for model in rows}
@@ -213,9 +217,10 @@ def check() -> int:
total = sum(model.get("bytes", 0) for model in models)
print(f"{len(models)} models, {total / 1e9:.2f} GB, mirrored on {release}")
if empty:
- # Not a failure: a model added here is unverified until the mirror
- # workflow has run once and reported what it fetched.
- print(f" {len(empty)} awaiting a digest from the mirror: {', '.join(empty)}")
+ # Not a failure here, since the mirror workflow runs this check
+ # before it fills a digest in - but the app refuses a download it
+ # cannot check, so a model listed here is unusable until then.
+ print(f" {len(empty)} awaiting a digest, refused by the app until then: {', '.join(empty)}")
return failed
diff --git a/src/crates/concat-host/src/models.rs b/src/crates/concat-host/src/models.rs
index c837b7c0..7d0d450e 100644
--- a/src/crates/concat-host/src/models.rs
+++ b/src/crates/concat-host/src/models.rs
@@ -18,7 +18,9 @@
//!
//! The table of what is mirrored is `models/manifest.toml` at the root of
//! the repository, and `scripts/models.py --check` is what keeps it and the
-//! engine's own tables saying the same thing. The tables are here rather
+//! engine's own tables saying the same thing. Every row carries the SHA-256
+//! of its bytes, and a download is refused without one to check against;
+//! Hugging Face upstreams are pinned to a commit, since `main` moves. The tables are here rather
//! than parsed from that file because a model's identity is something the
//! engine should not be able to start without.
@@ -283,13 +285,19 @@ pub fn download(
/// Checks a finished download against the digest the table carries.
///
-/// An empty `expected` passes: a model added to the tables is unverified
-/// until the mirror has been filled once and has reported what it holds.
-/// Anything else is compared, and a file that does not match is refused -
-/// the caller deletes it rather than leaving something that looks installed.
+/// A file that does not match is refused - the caller deletes it rather
+/// than leaving something that looks installed - and so is a download with
+/// no digest to check against: a model added to a table is unusable until
+/// its digest is there too, rather than trusted until someone gets round
+/// to it. The sources include mirrors and a base the user can set, so a
+/// download nobody can check is a download anyone can substitute
+/// (audit 2026-09-23, #6).
pub fn verify(file: &Path, expected: &str) -> Result<(), String> {
if expected.is_empty() {
- return Ok(());
+ return Err(format!(
+ "{} cannot be checked: the model table carries no digest for it",
+ file.display()
+ ));
}
let actual = sha256(file)?;
if actual == expected {
@@ -461,14 +469,14 @@ mod tests {
}
#[test]
- fn a_digest_is_checked_and_an_empty_one_is_not() {
+ fn a_digest_is_checked_and_an_empty_one_is_refused() {
let dir = std::env::temp_dir().join("concat-models-verify");
std::fs::create_dir_all(&dir).expect("a temp dir");
let file = dir.join("bytes");
std::fs::write(&file, b"concat").expect("a temp file");
// echo -n concat | sha256sum
let known = "3f4c1a4b3c9fb1b0e24bd1ec0bd7b16d0db4dbf1fe2f3b5dcdba0bd38b8f8b3a";
- assert!(verify(&file, "").is_ok());
+ assert!(verify(&file, "").is_err(), "nothing to check against");
assert!(verify(&file, known).is_err());
let actual = sha256(&file).expect("a digest");
assert_eq!(actual.len(), 64);
diff --git a/src/crates/concat-speech/src/chatterbox.rs b/src/crates/concat-speech/src/chatterbox.rs
index f1350beb..de9c70df 100644
--- a/src/crates/concat-speech/src/chatterbox.rs
+++ b/src/crates/concat-speech/src/chatterbox.rs
@@ -117,65 +117,65 @@ const FILES: &[KnownModel] = &[
KnownModel {
id: "chatterbox-turbo-tokenizer.json",
local: "tokenizer.json",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/tokenizer.json",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/tokenizer.json",
bytes: 3_562_272,
- sha256: "",
+ sha256: "3f04e34bea22f9144d1a19151154095bc9ce0430bf421304f5797e716288a906",
},
KnownModel {
id: "chatterbox-turbo-embed_tokens_quantized.onnx",
local: "onnx/embed_tokens_quantized.onnx",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/embed_tokens_quantized.onnx",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/embed_tokens_quantized.onnx",
bytes: 2_887,
- sha256: "",
+ sha256: "0efe1bc01c2c48a98425a74444fd9887924d887f922c2722a6ec961ebb9e1db6",
},
KnownModel {
id: "chatterbox-turbo-language_model_quantized.onnx",
local: "onnx/language_model_quantized.onnx",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/language_model_quantized.onnx",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/language_model_quantized.onnx",
bytes: 279_670,
- sha256: "",
+ sha256: "0b40581277e30b7034331ec8c3ad47ed71d321f015b387a95221e54e2fcbfde8",
},
KnownModel {
id: "chatterbox-turbo-speech_encoder_quantized.onnx",
local: "onnx/speech_encoder_quantized.onnx",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/speech_encoder_quantized.onnx",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/speech_encoder_quantized.onnx",
bytes: 1_205_728,
- sha256: "",
+ sha256: "5b6f15870a43cf97892df86fc550a0ef4763522d527cde72b2a4316f80a34de4",
},
KnownModel {
id: "chatterbox-turbo-conditional_decoder_quantized.onnx",
local: "onnx/conditional_decoder_quantized.onnx",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/conditional_decoder_quantized.onnx",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/conditional_decoder_quantized.onnx",
bytes: 2_202_035,
- sha256: "",
+ sha256: "2af3b150196d9d559cd3c91e03da80eb27a466032369dc2b57ea729cddad3ebb",
},
KnownModel {
id: "chatterbox-turbo-embed_tokens_quantized.onnx_data",
local: "onnx/embed_tokens_quantized.onnx_data",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/embed_tokens_quantized.onnx_data",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/embed_tokens_quantized.onnx_data",
bytes: 67_297_376,
- sha256: "",
+ sha256: "9025d04c124899823124b1d7bb7069b1f535fb8a6c2d88f97520eb6fecced986",
},
KnownModel {
id: "chatterbox-turbo-conditional_decoder_quantized.onnx_data",
local: "onnx/conditional_decoder_quantized.onnx_data",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/conditional_decoder_quantized.onnx_data",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/conditional_decoder_quantized.onnx_data",
bytes: 326_548_688,
- sha256: "",
+ sha256: "4918ca09e05e41d2b4aa1ace6201d1cd911ffc58a42801002bab177d495cfe0a",
},
KnownModel {
id: "chatterbox-turbo-speech_encoder_quantized.onnx_data",
local: "onnx/speech_encoder_quantized.onnx_data",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/speech_encoder_quantized.onnx_data",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/speech_encoder_quantized.onnx_data",
bytes: 354_676_576,
- sha256: "",
+ sha256: "d59861fb55e806fbeee731da9d4f8ff819fb5735de5d15e262d902594ee4dbb6",
},
KnownModel {
id: "chatterbox-turbo-language_model_quantized.onnx_data",
local: "onnx/language_model_quantized.onnx_data",
- upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/onnx/language_model_quantized.onnx_data",
+ upstream: "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/onnx/language_model_quantized.onnx_data",
bytes: 367_962_860,
- sha256: "",
+ sha256: "ec9945df36cb5d131d46688f2609fd715fbfcb0b8ee9681af5c84118de2d55a2",
},
];
@@ -958,7 +958,7 @@ pub fn bundle_dir(models: &Path) -> PathBuf {
mod tests {
use super::*;
- const UPSTREAM: &str = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/main/";
+ const UPSTREAM: &str = "https://huggingface.co/ResembleAI/chatterbox-turbo-ONNX/resolve/d21799bd0354adb85e348b8a0442a8405110a2cf/";
#[test]
fn the_table_names_nine_distinct_files_with_the_bundle_in_front() {
diff --git a/src/crates/concat-speech/src/transcribe.rs b/src/crates/concat-speech/src/transcribe.rs
index 9031a180..0a400c78 100644
--- a/src/crates/concat-speech/src/transcribe.rs
+++ b/src/crates/concat-speech/src/transcribe.rs
@@ -38,8 +38,8 @@ struct KnownModel {
/// One line for the settings row: what this size trades away.
blurb: &'static str,
approx_bytes: u64,
- /// What the finished file must hash to. Empty until the mirror has been
- /// filled once and reported what it holds; see [`concat_host::models`].
+ /// What the finished file must hash to; a download with nothing to
+ /// check against is refused. See [`concat_host::models`].
sha256: &'static str,
english_only: bool,
}
@@ -54,48 +54,48 @@ const KNOWN_MODELS: &[KnownModel] = &[
id: "tiny.en",
label: "Tiny (English)",
blurb: "Fastest draft. Rough on names and punctuation.",
- approx_bytes: 77_700_000,
- sha256: "",
+ approx_bytes: 77_704_715,
+ sha256: "921e4cf8686fdd993dcd081a5da5b6c365bfde1162e72b08d75ac75289920b1f",
english_only: true,
},
KnownModel {
id: "tiny",
label: "Tiny (Multilingual)",
blurb: "Fastest draft, any language.",
- approx_bytes: 77_700_000,
- sha256: "",
+ approx_bytes: 77_691_713,
+ sha256: "be07e048e1e599ad46341c8d2a135645097a538221678b7acdd1b1919c6e1b21",
english_only: false,
},
KnownModel {
id: "base.en",
label: "Base (English)",
blurb: "The sweet spot: solid captions at ~10x realtime.",
- approx_bytes: 147_400_000,
- sha256: "",
+ approx_bytes: 147_964_211,
+ sha256: "a03779c86df3323075f5e796cb2ce5029f00ec8869eee3fdfb897afe36c6d002",
english_only: true,
},
KnownModel {
id: "base",
label: "Base (Multilingual)",
blurb: "Solid captions, any language.",
- approx_bytes: 147_500_000,
- sha256: "",
+ approx_bytes: 147_951_465,
+ sha256: "60ed5bc3dd14eea856493d334349b405782ddcaf0028d4b5df4088345fba2efe",
english_only: false,
},
KnownModel {
id: "small.en",
label: "Small (English)",
blurb: "Noticeably better wording; a few times slower.",
- approx_bytes: 487_600_000,
- sha256: "",
+ approx_bytes: 487_614_201,
+ sha256: "c6138d6d58ecc8322097e0f987c32f1be8bb0a18532a3f88f734d1bbf9c41e5d",
english_only: true,
},
KnownModel {
id: "small",
label: "Small (Multilingual)",
blurb: "Best quality offered, any language.",
- approx_bytes: 487_600_000,
- sha256: "",
+ approx_bytes: 487_601_967,
+ sha256: "1be3a9b2063867b937e64e2ec7483364a79917e157fa98c5d94b5c1fffea987b",
english_only: false,
},
];
@@ -109,9 +109,13 @@ fn model_archive(id: &str) -> String {
format!("ggml-{id}.bin")
}
+/// The whisper.cpp commit the table's digests were taken at: what the
+/// fallback fetches is pinned to it, so `main` moving on changes nothing.
+const UPSTREAM_COMMIT: &str = "5359861c739e955e79d9a303bcbc70fb988958b1";
+
/// Where the mirror was filled from, and the second place a download tries.
fn model_upstream(id: &str) -> String {
- format!("https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-{id}.bin")
+ format!("https://huggingface.co/ggerganov/whisper.cpp/resolve/{UPSTREAM_COMMIT}/ggml-{id}.bin")
}
/// Where downloaded models live: `<app data>/whisper-models/ggml-<id>.bin`.
diff --git a/src/crates/concat-speech/src/tts.rs b/src/crates/concat-speech/src/tts.rs
index 0b849442..dc4cd29d 100644
--- a/src/crates/concat-speech/src/tts.rs
+++ b/src/crates/concat-speech/src/tts.rs
@@ -105,6 +105,8 @@ const KNOWN_MODELS: &[KnownModel] = &[
label: "Chatterbox Turbo (studio)",
blurb: "The closest to a studio voice; reads in Pocket's recordings or any sample of your own. English, slow, a gigabyte.",
approx_bytes: crate::chatterbox::BUNDLE_BYTES,
+ // Nine files, each checked against its own digest in
+ // `chatterbox::FILES`; this row never reaches `verify`.
sha256: "",
},
KnownModel {
@@ -118,15 +120,15 @@ const KNOWN_MODELS: &[KnownModel] = &[
id: "kokoro-int8-multi-lang-v1_0",
label: "Kokoro (compact)",
blurb: "The recommended build: same voices, a third of the download.",
- approx_bytes: 131_839_838,
- sha256: "",
+ approx_bytes: 132_303_094,
+ sha256: "4c3052abaa60943a341f193888cf6abd68787dae6ab8ae5c925a706caa247e4e",
},
KnownModel {
id: "kokoro-multi-lang-v1_0",
label: "Kokoro (full precision)",
blurb: "Bit-perfect weights for the skeptical; rarely audibly better.",
- approx_bytes: 349_418_188,
- sha256: "",
+ approx_bytes: 349_906_910,
+ sha256: "c5f7e2d2caf082bc1d20fb70334a61d99d20b484500aad32e7cf84c128ea3298",
},
];
diff --git a/src/crates/concat-vision/src/models.rs b/src/crates/concat-vision/src/models.rs
index 4514084f..095d813d 100644
--- a/src/crates/concat-vision/src/models.rs
+++ b/src/crates/concat-vision/src/models.rs
@@ -52,8 +52,8 @@ pub struct ModelSpec {
pub upstream: &'static str,
/// Its size, for a progress bar before the server says.
pub bytes: u64,
- /// What a finished download must hash to. Empty until the mirror has
- /// been filled once and reported what it holds.
+ /// What a finished download must hash to; a download with nothing to
+ /// check against is refused.
pub sha256: &'static str,
/// The licence it comes under, for the notices.
pub licence: &'static str,
@@ -74,29 +74,29 @@ pub const MODELS: [ModelSpec; 5] = [
file: "isnet-general-use.onnx",
upstream: "https://github.com/danielgatis/rembg/releases/download/v0.0.0/isnet-general-use.onnx",
bytes: 178_648_008,
- sha256: "",
+ sha256: "60920e99c45464f2ba57bee2ad08c919a52bbf852739e96947fbb4358c0d964a",
licence: "Apache-2.0",
},
ModelSpec {
id: ModelId::BrushEncoder,
file: "slimsam-77-encoder.onnx",
- upstream: "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/main/onnx/vision_encoder.onnx",
+ upstream: "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/5850ab45f587c112167512ffef949107115e26a0/onnx/vision_encoder.onnx",
bytes: 23_276_014,
- sha256: "",
+ sha256: "9f8433273a6750b587779baa0cf5508111001bf7e7acfcf585d370139fd366d0",
licence: "Apache-2.0",
},
ModelSpec {
id: ModelId::BrushDecoder,
file: "slimsam-77-decoder.onnx",
- upstream: "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/main/onnx/prompt_encoder_mask_decoder.onnx",
+ upstream: "https://huggingface.co/Xenova/slimsam-77-uniform/resolve/5850ab45f587c112167512ffef949107115e26a0/onnx/prompt_encoder_mask_decoder.onnx",
bytes: 16_557_892,
- sha256: "",
+ sha256: "f4514391764fbd56e08e119060d874ecd7d52994bfb1968af159e12d4943b5bb",
licence: "Apache-2.0",
},
ModelSpec {
id: ModelId::Enhance,
file: "realesr-general-x4v3.onnx",
- upstream: "https://huggingface.co/CoderViking/realesr-general-x4v3-onnx/resolve/main/realesr-general-x4v3.onnx",
+ upstream: "https://huggingface.co/CoderViking/realesr-general-x4v3-onnx/resolve/c6a971706797c7502945a2b4c4274fce4900d4ab/realesr-general-x4v3.onnx",
bytes: 4_866_417,
sha256: "1940a93ee08283a0a7286183186357b1688fe9fa8ede74604b424586aaddf112",
licence: "BSD-3-Clause",