Skip to content

Upload Vietnamese ASR models - #3159

Merged
csukuangfj merged 2 commits into
k2-fsa:masterfrom
csukuangfj:upload-models
Feb 9, 2026
Merged

csukuangfj merged 2 commits into
k2-fsa:masterfrom
csukuangfj:upload-models

Conversation

@csukuangfj

@csukuangfj csukuangfj commented Feb 9, 2026 •

Copy link
Copy Markdown
Collaborator

The model is from
https://huggingface.co/hynt/Zipformer-30M-RNNT-6000h

Please see the doc at
https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-transducer/zipformer-transducer-models.html#sherpa-onnx-zipformer-vi-30m-int8-2026-02-09-vietnamese

Screenshot 2026-02-09 at 11 53 44

Summary by CodeRabbit

  • New Features

    • Added Vietnamese Zipformer 30M speech recognition model with both standard and quantized (int8) variants.
    • Extended model distribution to include new Vietnamese model variants across all publishing platforms.
  • Improvements

    • Fixed directory handling in model setup and packaging scripts.
  • Deprecated

    • Removed legacy Bengali small streaming model from distribution.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 9, 2026
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @csukuangfj, 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 introduces a new Vietnamese Automatic Speech Recognition (ASR) model, sherpa-onnx-zipformer-vi-30M-int8-2026-02-09, to the project. The changes ensure that this model is properly integrated into both the APK generation process and the Kotlin API for offline recognition, thereby broadening the language capabilities of the sherpa-onnx toolkit.

Highlights

  • New Vietnamese ASR Model: Integration of the sherpa-onnx-zipformer-vi-30M-int8-2026-02-09 model, expanding language support for Automatic Speech Recognition within the project.
  • APK Script Update: The APK generation script now includes configuration for the new Vietnamese model, ensuring its proper packaging and deployment for Android applications.
  • Kotlin API Integration: The Kotlin API's OfflineRecognizer has been updated to support the new Vietnamese model, allowing its use in Android applications for offline recognition.
Changelog
  • scripts/apk/generate-vad-asr-apk-script.py
    • Added a new Model entry for the sherpa-onnx-zipformer-vi-30M-int8-2026-02-09 model, assigning it index 49 and specifying its language as Vietnamese.
    • Included a command to remove test_wavs within the model directory after setup.
  • sherpa-onnx/kotlin-api/OfflineRecognizer.kt
    • Implemented a new case for model index 49 in getOfflineModelConfig to correctly load the Vietnamese ASR model's ONNX files (encoder, decoder, joiner) and tokens.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/upload-models.yaml
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Feb 9, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR registers a new Vietnamese Zipformer 30M model across the build and deployment pipeline by adding workflow packaging steps, APK script entries, and Kotlin API configuration. One model packaging step is disabled, and a missing directory operation is fixed in an existing APK script entry.

Changes

Cohort / File(s) Summary
Workflow Model Packaging & Publishing
.github/workflows/upload-models.yaml
Adds disabled workflow step for Zipformer-30M-RNNT model packaging (both standard and int8 archives), disables existing vosk-model-small-streaming-bn step, and extends HuggingFace and ModelScope publishing lists with Vi Zipformer 30M variants.
APK Script Model Registration
scripts/apk/generate-vad-asr-apk-script.py
Registers new sherpa-onnx-zipformer-vi-30M-int8-2026-02-09 model entry with setup script; fixes missing popd directory operation in preceding model entry (wenetspeech-wu-u2pp-conformer-ctc-zh).
Kotlin API Configuration
sherpa-onnx/kotlin-api/OfflineRecognizer.kt
Adds model configuration case 49 for sherpa-onnx-zipformer-vi-30M-int8-2026-02-09 transducer model with encoder, decoder, joiner, tokens, and modelType definition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • #3003: Extends the same workflow file with additional model packaging and publishing steps.
  • #2656: Adds analogous model entries to generate-vad-asr-apk-script.py and OfflineRecognizer.kt with the same structural pattern.
  • #2932: Extends getOfflineModelConfig in OfflineRecognizer.kt with new model configuration cases following the same pattern.

Poem

🐰 A zipformer from Vietnam arrives with care,
Through workflows, scripts, and APIs laid bare,
Int8 and full precision both align,
Each registration branch a perfect sign,
Models packaged, published—all divine! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upload Vietnamese ASR models' is clear and directly describes the main change in the PR—uploading Vietnamese automatic speech recognition models including the sherpa-onnx-zipformer-vi-30M-int8 model to release repositories.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new Vietnamese ASR model. The changes in the Python script and Kotlin code correctly define and configure the new model. I have one suggestion to improve the naming convention for the model's short name to make it more concise.

idx=49,
lang="vi",
lang2="Vietnamese",
short_name="zipformer_vi_30M_int8_2026_02_09",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The short_name is quite long and includes the date, which is often omitted in other short names in this file for brevity. A more concise name would improve readability and consistency, especially since this name is used in the generated APK filename.

Suggested change
short_name="zipformer_vi_30M_int8_2026_02_09",
short_name="zipformer_vi_30M",

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/apk/generate-vad-asr-apk-script.py`:
- Around line 828-843: The Model entry for idx=49
("sherpa-onnx-zipformer-vi-30M-int8-2026-02-09") fails to remove bpe.model like
the similar Vietnamese model at idx=26, causing unnecessary APK bloat; update
the cmd block in the Model(...) for idx=49 to remove bpe.model (in the same way
idx=26 does) so only needed artifacts (encoder.int8.onnx, decoder.onnx,
joiner.int8.onnx, tokens.txt) are packaged, ensuring the script deletes
bpe.model before finishing.

Comment on lines +828 to 843
Model(
model_name="sherpa-onnx-zipformer-vi-30M-int8-2026-02-09",
idx=49,
lang="vi",
lang2="Vietnamese",
short_name="zipformer_vi_30M_int8_2026_02_09",
cmd="""
pushd $model_name

rm -rfv test_wavs

ls -lh

popd
""",
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

bpe.model is not removed, unlike the other Vietnamese zipformer model (idx=26).

The existing Vietnamese zipformer at idx=26 (line 474) removes bpe.model to reduce APK size. The Kotlin config for type 49 only references encoder.int8.onnx, decoder.onnx, joiner.int8.onnx, and tokens.txt — so bpe.model is unused and will unnecessarily inflate the APK.

Proposed fix
             pushd $model_name
 
             rm -rfv test_wavs
+            rm -fv bpe.model
 
             ls -lh
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Model(
model_name="sherpa-onnx-zipformer-vi-30M-int8-2026-02-09",
idx=49,
lang="vi",
lang2="Vietnamese",
short_name="zipformer_vi_30M_int8_2026_02_09",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-zipformer-vi-30M-int8-2026-02-09",
idx=49,
lang="vi",
lang2="Vietnamese",
short_name="zipformer_vi_30M_int8_2026_02_09",
cmd="""
pushd $model_name
rm -rfv test_wavs
rm -fv bpe.model
ls -lh
popd
""",
),
🤖 Prompt for AI Agents
In `@scripts/apk/generate-vad-asr-apk-script.py` around lines 828 - 843, The Model
entry for idx=49 ("sherpa-onnx-zipformer-vi-30M-int8-2026-02-09") fails to
remove bpe.model like the similar Vietnamese model at idx=26, causing
unnecessary APK bloat; update the cmd block in the Model(...) for idx=49 to
remove bpe.model (in the same way idx=26 does) so only needed artifacts
(encoder.int8.onnx, decoder.onnx, joiner.int8.onnx, tokens.txt) are packaged,
ensuring the script deletes bpe.model before finishing.

@csukuangfj
csukuangfj merged commit 0c1e877 into k2-fsa:master Feb 9, 2026
1 check passed
@csukuangfj
csukuangfj deleted the upload-models branch February 9, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant