feat(sherpa-onnx): add approx_size_bytes to ModelPreset#14
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
approx_size_bytes: u64toModelPresetwith a ~5 MB-rounded estimate per bundled preset (bilingual zipformer, English zipformer, Mandarin paraformer, bilingual paraformer).u64) to share a unit withDownloadProgress::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