w2v-bert-2.0-kinyarwanda-onnx

ONNX export of badrex/w2v-bert-2.0-kinyarwanda-asr for use with onnx-asr.

This is the 1st-place solution of the "Kinyarwanda Automatic Speech Recognition β€” Track A" Kaggle competition, published by Badr M. Abdullah / the ASRwanda team and Digital Umuganda. See the writeup: ASRwanda: 1st place solution for Kinyarwanda ASR Track A.

Kinyarwanda has roughly 15 million speakers. This is the first specialized Kinyarwanda model in the OpenVoiceOS onnx-asr collection.

License and attribution

  • License: CC-BY-4.0 (as declared on the source model card), inherited verbatim.
  • Base model: facebook/w2v-bert-2.0 (Meta).
  • Fine-tuned by Badr M. Abdullah and Digital Umuganda (2025), trained on ~1000 hours of transcribed Kinyarwanda speech from the Kinyarwanda ASR hackathon Track B dataset (Gates Foundation funded, sourced via Digital Umuganda).
  • Attribution required per CC-BY-4.0: credit Badr M. Abdullah / the ASRwanda team.

How this was exported

The source model is a Wav2Vec2BertForCTC (Wav2Vec2-BERT 2.0 conformer encoder + CTC head, add_adapter: false, i.e. no additional temporal downsampling beyond the feature frontend).

Its feature frontend is transformers.SeamlessM4TFeatureExtractor: Kaldi-style log-mel filterbanks (Povey window) with per-utterance mean/variance normalization and 2-frame stacking into 160-dim vectors. This is exactly what onnx-asr's w2vbert NumPy preprocessor (W2vBertPreprocessorNumpy) reproduces β€” verified elsewhere in this collection to ~6e-05 max abs error against the reference feature extractor. So the encoder + CTC head was exported as a single ONNX graph taking the already-stacked 160-dim features (not raw waveform), matching the existing espnet-ctc model contract:

features (B, T, 160) f32, features_lens (B,) i64
  -> logprobs (B, T', V) f32 (log_softmax), logprobs_lens (B,) i64

Loads with:

import onnx_asr
model = onnx_asr.load_model("espnet-ctc", "OpenVoiceOS/w2v-bert-2.0-kinyarwanda-onnx")

(on the feat/espnet-ebranchformer-ctc integration branch of the OpenVoiceOS onnx-asr fork until it lands on dev.)

Subsampling factor: 1 β€” measured empirically (output frame count equals input feature frame count for several lengths), consistent with add_adapter: false in the source config: the conformer encoder does no extra temporal downsampling beyond the preprocessor's own 2x frame-stacking, so the CTC output rate is one frame per stacked (20ms) feature frame.

Files

  • model.onnx (+ model.onnx_data) β€” fp32 graph, ~2.2GB weights.
  • model.int8.onnx β€” dynamic-range int8 quantized weights.
  • vocab.txt β€” 32-token char vocabulary (kaldi-style token id lines), blank kept at its trained index (<blk> = index 29, the original [PAD] token id).
  • config.json β€” {"model_type": "espnet-ctc", "subsampling_factor": 1}.

Notes

  • Not a substitute for anything β€” this is the actual, HF-published 1st-place competition checkpoint, exported unmodified to ONNX.

Verification

Verified against 3 real Kinyarwanda clips from KYAGABA/kinyarwanda_cleaned_testset_verified (FLEURS has no Kinyarwanda config; Common Voice rw config was not resolvable via the datasets library at test time, so this verified test set was used instead).

  • ONNX fp32 (onnx_asr.load_model("espnet-ctc", ...)) output is identical to the native transformers.Wav2Vec2BertForCTC greedy-CTC decode on all 3 clips (byte-for-byte on 2/3; one clip differs only by a collapsed double space) β€” confirms the ONNX export and the w2vbert preprocessor reproduce the reference model exactly.
  • int8 (dynamic-range quantized) shows small, expected degradation vs fp32 on the same clips.

RTF (real-time factor, CPU, OMP_NUM_THREADS=6, on a shared/contended host β€” treat as upper bounds, not clean single-tenant numbers):

variant avg RTF (3 clips)
native transformers fp32 ~7.0 (noisy, one contended outlier at 19.4)
onnx-asr fp32 ~2.2
onnx-asr int8 ~1.35

ONNX is consistently faster than native transformers under the same contention, and int8 is faster again than fp32.

Downloads last month
18
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for OpenVoiceOS/w2v-bert-2.0-kinyarwanda-onnx

Quantized
(1)
this model

Collections including OpenVoiceOS/w2v-bert-2.0-kinyarwanda-onnx