Repository navigation
Build huggingface spaces for Moonshine v2 with WebAssembly - #3249
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the capabilities of the WebAssembly VAD-ASR system by integrating a new generation of Moonshine v2 models. It enables support for a wider array of languages and model sizes within the existing framework, ensuring that the WebAssembly application can correctly utilize these new models. The changes also refine the deployment process for these models to various platforms. Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Moonshine v2 model entries and runtime detection, makes ms-related shell steps conditional, updates a GitHub Actions matrix to run more parallel jobs, and changes a Hugging Face push target URL. All changes are factual and do not alter public APIs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds support for Moonshine v2 models for WebAssembly deployment. The changes include updating the model generation script with new model definitions, modifying the build script to handle model-specific deployment, and updating the JavaScript application to recognize and use the new model structure. My review has identified a recurring typo in the model short names within scripts/wasm/generate-vad-asr.py and a hardcoded username in scripts/wasm/run-vad-asr.sh.in. These are medium-severity issues that should be addressed to improve maintainability and prevent potential issues with generated artifacts.
| model_name="sherpa-onnx-moonshine-tiny-en-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-en", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-en", | ||
| short_name="vad-asr-mooshine-v2-tiny-en", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-tiny-en", | |
| short_name="vad-asr-moonshine-v2-tiny-en", |
| model_name="sherpa-onnx-moonshine-tiny-ja-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-ja", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-ja", | ||
| short_name="vad-asr-mooshine-v2-tiny-ja", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-tiny-ja", | |
| short_name="vad-asr-moonshine-v2-tiny-ja", |
| model_name="sherpa-onnx-moonshine-tiny-ko-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-ko", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-tiny-ko", | ||
| short_name="vad-asr-mooshine-v2-tiny-ko", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-tiny-ko", | |
| short_name="vad-asr-moonshine-v2-tiny-ko", |
| model_name="sherpa-onnx-moonshine-base-en-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-en", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-en", | ||
| short_name="vad-asr-mooshine-v2-base-en", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-en", | |
| short_name="vad-asr-moonshine-v2-base-en", |
| model_name="sherpa-onnx-moonshine-base-zh-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-zh", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-zh", | ||
| short_name="vad-asr-mooshine-v2-base-zh", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-zh", | |
| short_name="vad-asr-moonshine-v2-base-zh", |
| model_name="sherpa-onnx-moonshine-base-vi-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-vi", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-vi", | ||
| short_name="vad-asr-mooshine-v2-base-vi", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-vi", | |
| short_name="vad-asr-moonshine-v2-base-vi", |
| model_name="sherpa-onnx-moonshine-base-es-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-es", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-es", | ||
| short_name="vad-asr-mooshine-v2-base-es", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-es", | |
| short_name="vad-asr-moonshine-v2-base-es", |
| model_name="sherpa-onnx-moonshine-base-ar-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-ar", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-ar", | ||
| short_name="vad-asr-mooshine-v2-base-ar", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-ar", | |
| short_name="vad-asr-moonshine-v2-base-ar", |
| model_name="sherpa-onnx-moonshine-base-uk-quantized-2026-02-27", | ||
| hf="k2-fsa/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-uk", | ||
| ms="csukuangfj/web-assembly-vad-asr-sherpa-onnx-moonshine-v2-base-uk", | ||
| short_name="vad-asr-mooshine-v2-base-uk", |
There was a problem hiding this comment.
There appears to be a typo in the short_name. It should probably be moonshine instead of mooshine. This name is used in build scripts, so correcting it is important for consistency and to avoid potential issues with generated artifacts.
| short_name="vad-asr-mooshine-v2-base-uk", | |
| short_name="vad-asr-moonshine-v2-base-uk", |
| git add . | ||
| git commit -m "update model" || true | ||
| git push https://csukuangfj:$HF_TOKEN@huggingface.co/spaces/$hf_name main || true | ||
| git push https://csukuangfj2:$HF_TOKEN@huggingface.co/spaces/$hf_name main || true |
There was a problem hiding this comment.
The Hugging Face username csukuangfj2 is hardcoded. It's better to use an environment variable (e.g., HF_USERNAME) for this to avoid committing user-specific details and to make the script more configurable. You would then need to set this environment variable in your CI/build environment.
git push https://${HF_USERNAME}:$HF_TOKEN@huggingface.co/spaces/$hf_name main || true
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/wasm/generate-vad-asr.py (1)
101-101: Minor inconsistency: "日语" vs "日文" for Japanese.Line 101 (tiny-ja) uses "日语" while line 169 (base-ja) uses "日文". Both mean Japanese but using different terms. Consider standardizing to one term for consistency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/wasm/generate-vad-asr.py` at line 101, Standardize the Japanese term used in the sed replacement lines: locate the two sed commands that replace the model titles (the tiny-ja replacement containing "日语" and the base-ja replacement containing "日文") and make them use the same term across both lines (choose either "日语" or "日文" consistently), updating the replacement strings in both sed invocations so the index.html substitutions match.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/wasm/generate-vad-asr.py`:
- Line 75: Fix the typo in each model entry where the short_name is set (e.g.,
the entries defining short_name="vad-asr-mooshine-v2-tiny-en" and the nine other
Moonshine v2 variants); replace "mooshine" with "moonshine" so short_name reads
"vad-asr-moonshine-v2-<variant>" for all listed variants (tiny-ja, tiny-ko,
base-en, base-zh, base-ja, base-vi, base-es, base-ar, base-uk, etc.) to ensure
generated artifact filenames using ${short_name} are correct.
---
Nitpick comments:
In `@scripts/wasm/generate-vad-asr.py`:
- Line 101: Standardize the Japanese term used in the sed replacement lines:
locate the two sed commands that replace the model titles (the tiny-ja
replacement containing "日语" and the base-ja replacement containing "日文") and
make them use the same term across both lines (choose either "日语" or "日文"
consistently), updating the replacement strings in both sed invocations so the
index.html substitutions match.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/wasm-simd-hf-space-vad-asr.yamlscripts/wasm/generate-vad-asr.pyscripts/wasm/run-vad-asr.sh.inwasm/vad-asr/app-vad-asr.js
You can find them in the following addresses
A screenshot is given below:

Summary by CodeRabbit
New Features
Chores