Repository navigation
Export Moonshine v2 models to sherpa-onnx - #3234
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 enhances the integration of Moonshine v2 Automatic Speech Recognition (ASR) models into the sherpa-onnx framework. It introduces a robust script for exporting and packaging these models, alongside updates to the Python API that simplify their configuration and loading. These changes aim to make it easier for users to utilize Moonshine v2 models within sherpa-onnx for various languages. Highlights
Changelog
Ignored Files
Activity
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 (4)
📝 WalkthroughWalkthroughThis PR adds Moonshine v2 model support to sherpa-onnx. Changes include a new GitHub Actions workflow for exporting Moonshine v2 models, a model preparation script that downloads language models and generates quantized variants, updates to make the Python binding constructor arguments optional with defaults, and a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Suggested labels
Poem
✨ 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. It includes a script to download and package models, updates Python bindings, and adds a from_moonshine_v2 factory method. The changes are well-structured. I've provided a few suggestions on the packaging script to remove unnecessary sleep commands and to address a potentially confusing hardcoded date in artifact names.
| mv -v models/download.moonshine.ai/model/$name/quantized/$name/* . | ||
| python3 ./generate_tokens.py | ||
| rm tokenizer.bin | ||
| d=sherpa-onnx-moonshine-$name-quantized-2026-02-27 |
There was a problem hiding this comment.
The hardcoded year 2026 in the directory name is unconventional for versioning and can be misleading as it points to a future date. If this is meant to be the release date, it appears to be a typo for 2024. Using a standard versioning scheme or the correct date would improve clarity and avoid confusion.
| python3 -m moonshine_voice.download --language vi --model-arch 1 | ||
| python3 -m moonshine_voice.download --language uk --model-arch 1 | ||
|
|
||
| sleep 2 |
|
|
||
| ls -lh models/download.moonshine.ai/model/*/*/* | ||
|
|
||
| sleep 2 |
You can download the models from
https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models
See also
Usage:
Output logs are:
cc @nshmyrev @nabil6391 @zhitao-zeng @jiangzhuo
CI logs
Summary by CodeRabbit
New Features
Chores