Skip to content

fix(speech): pin the voice models to a revision instead of someone else's HEAD - #294

Merged
d4vid87 merged 1 commit into
mainfrom
fix/pin-piper-revision
Sep 3, 2026
Merged

fix(speech): pin the voice models to a revision instead of someone else's HEAD#294
d4vid87 merged 1 commit into
mainfrom
fix/pin-piper-revision

Conversation

@d4vid87

@d4vid87 d4vid87 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

What

voice_url built https://huggingface.co/rhasspy/piper-voices/resolve/**main**/…. It now resolves a pinned commit.

const VOICES_REVISION: &str = "39ab474be869e9181350af6a65e4953eef67aaa0";

Why

These are ONNX models the app downloads and then runs. resolve/main means whatever is at the head of someone else's repository at the moment the button is pressed — a different model tomorrow than today, and potentially a different model for two people on the same build of this app. A mutable ref is not a URL for something you execute.

Pinning makes the download reproducible and makes a change to it a change to this file, reviewable like any other.

Not a per-file sha256: that would need a hash for every voice in VOICES and a way to keep them current, for a weaker guarantee than pinning the tree they all come from.

Verification

  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace — pass. a_voice_id_derives_its_own_download_url now builds its expectation from the constant, so it cannot drift, and asserts the constant is a 40-character hex sha — pasting a branch name back in is a red test.
  • The pinned URL was fetched live: HTTP/2 302 to the CDN, so this revision really does serve the voices.
  • ./scripts/shots/shoot.sh check — pass
  • ./scripts/web/build.sh — pass

wasm

Before 4048966, after 4048962. Native-only code; the four bytes are noise.

🤖 Generated with Claude Code

…se's HEAD

`voice_url` resolved `main`. These are ONNX models the app downloads and then
runs, and `resolve/main` is whatever is at the head of someone else's repository
at the moment the button is pressed — a different model tomorrow, and possibly a
different one for two people on the same build.

Pinned to a commit, so the download is reproducible and changing it is a change
to this file. Not a per-file sha256: that needs a hash for every voice in
`VOICES` and a way to keep them current, for a weaker guarantee than pinning the
tree they all come from.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@d4vid87
d4vid87 merged commit 21de690 into main Sep 3, 2026
6 checks passed
@d4vid87
d4vid87 deleted the fix/pin-piper-revision branch September 3, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant