Skip to content

feat(sherpa-onnx): add approx_size_bytes to ModelPreset#14

Merged
wavekat-eason merged 3 commits into
mainfrom
feat/preset-size-metadata
May 17, 2026
Merged

feat(sherpa-onnx): add approx_size_bytes to ModelPreset#14
wavekat-eason merged 3 commits into
mainfrom
feat/preset-size-metadata

Conversation

@wavekat-eason

Copy link
Copy Markdown
Contributor

Summary

  • Add approx_size_bytes: u64 to ModelPreset with a ~5 MB-rounded estimate per bundled preset (bilingual zipformer, English zipformer, Mandarin paraformer, bilingual paraformer).
  • Lets consumers render an honest "Download (~N MB)" affordance ahead of the fetch instead of inventing a number or staying silent.
  • Bytes (u64) to share a unit with DownloadProgress::bytes_total; consumers pick their own display granularity.

Test plan

  • make test — new test pins every bundled preset to a plausible MB range (non-zero, under 500 MB)
  • cargo check --all-features

🤖 Generated with Claude Code

wavekat-eason and others added 3 commits May 17, 2026 17:51
Static, ~5 MB-rounded estimate of the total on-disk size of the
files each bundled preset pulls from HuggingFace. Consumers that
want to show a "Download (~N MB)" affordance ahead of the fetch
can read this directly instead of hardcoding the figure
themselves; the previous "ask the user to download but tell them
nothing about cost" gap forced every consumer to either invent a
number or stay silent.

Bytes (`u64`) rather than mibibytes or megabytes so the field
shares a unit with `DownloadProgress::bytes_total` and consumers
choose their own display granularity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pre-commit runs cargo fmt --check on staged Rust files; pre-push runs
make ci-fast (fmt + clippy + sherpa-onnx tests). Install with `make hooks`,
bypass with --no-verify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wavekat-eason wavekat-eason merged commit b77a994 into main May 17, 2026
3 checks passed
@wavekat-eason wavekat-eason deleted the feat/preset-size-metadata branch May 17, 2026 05:59
@github-actions github-actions Bot mentioned this pull request May 17, 2026
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