jssaluja/zipformer-large-sggs-ncer-train-epochs-90-scratch-20261021
This model is a Zipformer transducer (icefall zipformer size large) trained from scratch on private Punjabi Gurbani speech.
It achieves the following results on the evaluation set:
- Loss: 1.4586
- Wer: 0.3753
- Wil: 0.5707
- Mer: 0.3664
- Cer: 0.1446
- Ncer: 0.1254
- Ccer: 0.1590
Model description
- Architecture: icefall Zipformer
largetransducer, 150,362,074 parameters - train_scope:
verse_only - best_model_metric:
ncer(0.12163461538461538 at epoch 87) - smoke_test: False
- train rows: 108629
- test rows: 1569
- Checkpoint selection uses full-dev greedy decode, not a subsample.
Intended uses & limitations
Punjabi Gurbani and general-Punjabi ASR. Not a transformers CTC checkpoint; load model.pt with the icefall Zipformer used to train it.
ONNX v0.1 inference
For CPU inference without rebuilding the Icefall model, use the dynamically quantized v0.1 ONNX export at jssaluja/zipformer-large-sggs-ncer-train-epochs-90-scratch-20261021-onnx. It was exported from the final epoch-90 checkpoint (the best-NCER checkpoint for this training run is epoch 87). It accepts 16 kHz mono float32 PCM and returns frame-level CTC scores (1,000 classes, blank ID 0); it does not return text or timestamps directly.
Install the inference dependencies:
pip install huggingface_hub onnxruntime sentencepiece soundfile scipy numpy
This example loads an audio file, converts it to 16 kHz mono, runs greedy CTC decoding, removes blank ID 0, collapses repeated IDs, and decodes with the matching SentencePiece model:
from math import gcd
import numpy as np
import onnxruntime as ort
import sentencepiece as spm
import soundfile as sf
from huggingface_hub import hf_hub_download
from scipy.signal import resample_poly
repo_id = "jssaluja/zipformer-large-sggs-ncer-train-epochs-90-scratch-20261021-onnx"
model_path = hf_hub_download(repo_id, "sggs-large-epoch90.int8.onnx")
tokenizer_path = hf_hub_download(repo_id, "bpe.model")
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
tokenizer = spm.SentencePieceProcessor(model_file=tokenizer_path)
def transcribe(audio_path):
audio, sample_rate = sf.read(audio_path, dtype="float32", always_2d=True)
audio = audio.mean(axis=1)
if sample_rate != 16000:
divisor = gcd(sample_rate, 16000)
audio = resample_poly(audio, 16000 // divisor, sample_rate // divisor)
audio = np.ascontiguousarray(audio, dtype=np.float32)
if audio.size == 0:
raise ValueError("Audio file is empty")
scores, output_lengths = session.run(
["log_probs", "out_len"],
{
"audio": audio[None, :],
"audio_len": np.array([audio.size], dtype=np.int64),
},
)
frame_ids = scores[0, : int(output_lengths[0])].argmax(axis=-1)
token_ids = []
previous = -1
for token_id in frame_ids:
token_id = int(token_id)
if token_id != previous and token_id != 0:
token_ids.append(token_id)
previous = token_id
return tokenizer.decode(token_ids)
print(transcribe("audio.wav"))
The example returns a transcript only; it does not calculate word timestamps. Use the matching bpe.model from the ONNX repository, not a tokenizer from another SGGS checkpoint.
Inference
model.pt is the Zipformer state dict and bpe.model is the SentencePiece model trained with it (vocab 1000, blank id 0). This is not a transformers checkpoint, so pipeline() will not load it. Greedy CTC on the auxiliary head is the decode used for the CER numbers above.
pip install torch torchaudio sentencepiece lhotse datasets huggingface_hub soundfile
git clone https://github.com/k2-fsa/icefall
import torch, sentencepiece as spm
from huggingface_hub import hf_hub_download
repo = 'jssaluja/zipformer-large-sggs-ncer-train-epochs-90-scratch-20261021'
weights = hf_hub_download(repo, 'model.pt')
bpe = spm.SentencePieceProcessor(model_file=hf_hub_download(repo, 'bpe.model'))
# build the network with train_zipformer's build_model() from the training
# CLI defaults, then: model.load_state_dict(torch.load(weights, map_location='cpu'))
# 16 kHz mono -> 80-dim Lhotse fbank -> per-utterance mean/std.
# ids = greedy argmax over model.ctc_output(encoder_out), drop blank 0 and repeats.
# text = bpe.decode(ids)
Training and evaluation data
Train rows: 108629. Eval rows: 1569. Source collection names are not published.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.045
- max_duration: 600.0
- seed: 20260830
- optimizer: ScaledAdam with clipping_scale=2.0 and Eden (lr_batches=7500, lr_epochs=3.5)
- num_epochs: 90
- mixed_precision_training: Native BF16 AMP
Training results
(table generated directly from epoch-end full-dev history, keyed by metric name -- avoids a transformers model-card column-ordering bug seen in earlier runs. Validation Loss is the training objective on the dev cuts, sum / target tokens, not MMS CTC eval_loss.)
| Training Loss | Epoch | Step | Ccer | Cer | Validation Loss | Mer | Ncer | Wer | Wil |
|---|---|---|---|---|---|---|---|---|---|
| 4.7214 | 1.0 | 942 | 0.4556 | 0.4191 | 3.2124 | 0.7679 | 0.4163 | 0.7955 | 0.9358 |
| 1.8578 | 2.0 | 1886 | 0.3419 | 0.3155 | 2.7283 | 0.6752 | 0.2937 | 0.7057 | 0.8797 |
| 1.6864 | 3.0 | 2828 | 0.3307 | 0.3051 | 2.6861 | 0.6585 | 0.2810 | 0.6797 | 0.8668 |
| 1.5812 | 4.0 | 3770 | 0.3141 | 0.2881 | 2.5092 | 0.6324 | 0.2644 | 0.6517 | 0.8462 |
| 1.5229 | 5.0 | 4712 | 0.2958 | 0.2724 | 2.3462 | 0.6120 | 0.2450 | 0.6386 | 0.8308 |
| 1.4780 | 6.0 | 5655 | 0.2998 | 0.2752 | 2.4338 | 0.6085 | 0.2521 | 0.6338 | 0.8272 |
| 1.4309 | 7.0 | 6597 | 0.2845 | 0.2605 | 2.2847 | 0.5872 | 0.2360 | 0.6070 | 0.8092 |
| 1.4071 | 8.0 | 7540 | 0.2916 | 0.2664 | 2.2849 | 0.5861 | 0.2470 | 0.6069 | 0.8066 |
| 1.3786 | 9.0 | 8483 | 0.2762 | 0.2528 | 2.2636 | 0.5839 | 0.2311 | 0.6117 | 0.8081 |
| 1.3695 | 10.0 | 9427 | 0.2631 | 0.2397 | 2.2387 | 0.5675 | 0.2105 | 0.5872 | 0.7934 |
| 1.3722 | 11.0 | 10369 | 0.2445 | 0.2230 | 2.0381 | 0.5403 | 0.1992 | 0.5578 | 0.7667 |
| 1.3714 | 12.0 | 11311 | 0.2623 | 0.2426 | 2.2015 | 0.5624 | 0.2172 | 0.5802 | 0.7841 |
| 1.3892 | 13.0 | 12253 | 0.2803 | 0.2561 | 2.2679 | 0.5707 | 0.2338 | 0.5826 | 0.7916 |
| 1.3870 | 14.0 | 13196 | 0.2627 | 0.2409 | 2.1384 | 0.5548 | 0.2183 | 0.5657 | 0.7767 |
| 1.3576 | 15.0 | 14140 | 0.2644 | 0.2417 | 2.2763 | 0.5659 | 0.2208 | 0.5809 | 0.7904 |
| 1.3418 | 16.0 | 15084 | 0.2554 | 0.2334 | 2.1658 | 0.5536 | 0.2123 | 0.5685 | 0.7790 |
| 1.3015 | 17.0 | 16027 | 0.2567 | 0.2343 | 2.1592 | 0.5446 | 0.2091 | 0.5599 | 0.7693 |
| 1.2828 | 18.0 | 16970 | 0.2597 | 0.2346 | 2.2310 | 0.5498 | 0.2127 | 0.5688 | 0.7776 |
| 1.2533 | 19.0 | 17912 | 0.2432 | 0.2223 | 2.0963 | 0.5310 | 0.2006 | 0.5484 | 0.7566 |
| 1.2349 | 20.0 | 18856 | 0.2447 | 0.2228 | 2.0447 | 0.5224 | 0.2025 | 0.5347 | 0.7469 |
| 1.2129 | 21.0 | 19798 | 0.2355 | 0.2157 | 1.9878 | 0.5117 | 0.1932 | 0.5268 | 0.7363 |
| 1.1876 | 22.0 | 20741 | 0.2394 | 0.2177 | 2.0852 | 0.5195 | 0.1940 | 0.5318 | 0.7454 |
| 1.1630 | 23.0 | 21683 | 0.2270 | 0.2065 | 1.8984 | 0.4932 | 0.1821 | 0.5047 | 0.7178 |
| 1.1431 | 24.0 | 22627 | 0.2253 | 0.2050 | 1.8896 | 0.5055 | 0.1815 | 0.5158 | 0.7315 |
| 1.1268 | 25.0 | 23570 | 0.2268 | 0.2062 | 1.8578 | 0.4949 | 0.1856 | 0.5050 | 0.7191 |
| 1.1117 | 26.0 | 24512 | 0.2584 | 0.2367 | 2.1474 | 0.5447 | 0.2145 | 0.5544 | 0.7669 |
| 1.0871 | 27.0 | 25455 | 0.2272 | 0.2070 | 1.9487 | 0.4950 | 0.1818 | 0.5068 | 0.7191 |
| 1.0693 | 28.0 | 26398 | 0.2202 | 0.2014 | 1.8732 | 0.4876 | 0.1810 | 0.4949 | 0.7103 |
| 1.0563 | 29.0 | 27341 | 0.2274 | 0.2080 | 1.9542 | 0.5062 | 0.1874 | 0.5166 | 0.7304 |
| 1.0324 | 30.0 | 28285 | 0.2289 | 0.2094 | 1.9808 | 0.5033 | 0.1838 | 0.5171 | 0.7291 |
| 1.0134 | 31.0 | 29227 | 0.2040 | 0.1856 | 1.7544 | 0.4578 | 0.1630 | 0.4695 | 0.6807 |
| 0.9906 | 32.0 | 30170 | 0.1944 | 0.1777 | 1.6960 | 0.4482 | 0.1553 | 0.4598 | 0.6683 |
| 0.9812 | 33.0 | 31113 | 0.2253 | 0.2041 | 1.9117 | 0.4743 | 0.1912 | 0.4856 | 0.6968 |
| 0.9628 | 34.0 | 32055 | 0.2178 | 0.1976 | 1.8837 | 0.4775 | 0.1785 | 0.4920 | 0.7022 |
| 0.9507 | 35.0 | 32997 | 0.2087 | 0.1888 | 1.8008 | 0.4635 | 0.1701 | 0.4768 | 0.6876 |
| 0.9334 | 36.0 | 33939 | 0.1935 | 0.1738 | 1.6895 | 0.4404 | 0.1537 | 0.4511 | 0.6646 |
| 0.9188 | 37.0 | 34882 | 0.2115 | 0.1925 | 1.8045 | 0.4683 | 0.1669 | 0.4798 | 0.6916 |
| 0.9070 | 38.0 | 35825 | 0.2114 | 0.1942 | 1.7376 | 0.4679 | 0.1710 | 0.4751 | 0.6868 |
| 0.8926 | 39.0 | 36768 | 0.1994 | 0.1823 | 1.7625 | 0.4538 | 0.1633 | 0.4644 | 0.6754 |
| 0.8841 | 40.0 | 37711 | 0.2095 | 0.1916 | 1.7505 | 0.4639 | 0.1733 | 0.4741 | 0.6843 |
| 0.8647 | 41.0 | 38653 | 0.1877 | 0.1708 | 1.6577 | 0.4322 | 0.1523 | 0.4410 | 0.6515 |
| 0.8519 | 42.0 | 39595 | 0.2142 | 0.1956 | 1.8578 | 0.4700 | 0.1736 | 0.4774 | 0.6907 |
| 0.8425 | 43.0 | 40539 | 0.1870 | 0.1697 | 1.5987 | 0.4272 | 0.1508 | 0.4378 | 0.6469 |
| 0.8303 | 44.0 | 41483 | 0.1970 | 0.1794 | 1.6666 | 0.4450 | 0.1589 | 0.4537 | 0.6647 |
| 0.8199 | 45.0 | 42425 | 0.2006 | 0.1831 | 1.6802 | 0.4297 | 0.1654 | 0.4371 | 0.6440 |
| 0.8102 | 46.0 | 43369 | 0.1836 | 0.1668 | 1.6029 | 0.4205 | 0.1467 | 0.4314 | 0.6385 |
| 0.7896 | 47.0 | 44311 | 0.2071 | 0.1891 | 1.8632 | 0.4586 | 0.1667 | 0.4709 | 0.6804 |
| 0.7827 | 48.0 | 45254 | 0.1908 | 0.1745 | 1.6353 | 0.4410 | 0.1523 | 0.4522 | 0.6614 |
| 0.7765 | 49.0 | 46197 | 0.1833 | 0.1655 | 1.5917 | 0.4240 | 0.1457 | 0.4327 | 0.6433 |
| 0.7689 | 50.0 | 47140 | 0.1947 | 0.1763 | 1.7343 | 0.4403 | 0.1556 | 0.4516 | 0.6612 |
| 0.7532 | 51.0 | 48082 | 0.1987 | 0.1809 | 1.7239 | 0.4398 | 0.1606 | 0.4477 | 0.6577 |
| 0.7530 | 52.0 | 49025 | 0.1940 | 0.1785 | 1.6797 | 0.4373 | 0.1606 | 0.4448 | 0.6521 |
| 0.7380 | 53.0 | 49968 | 0.1888 | 0.1729 | 1.6797 | 0.4281 | 0.1511 | 0.4386 | 0.6444 |
| 0.7298 | 54.0 | 50910 | 0.1858 | 0.1704 | 1.6268 | 0.4250 | 0.1493 | 0.4365 | 0.6414 |
| 0.7222 | 55.0 | 51853 | 0.1823 | 0.1653 | 1.5903 | 0.4133 | 0.1469 | 0.4207 | 0.6286 |
| 0.7112 | 56.0 | 52796 | 0.1671 | 0.1527 | 1.4815 | 0.3971 | 0.1303 | 0.4062 | 0.6093 |
| 0.7021 | 57.0 | 53739 | 0.1835 | 0.1676 | 1.6838 | 0.4207 | 0.1489 | 0.4298 | 0.6371 |
| 0.6855 | 58.0 | 54682 | 0.1711 | 0.1564 | 1.5147 | 0.3987 | 0.1333 | 0.4063 | 0.6097 |
| 0.6864 | 59.0 | 55624 | 0.1693 | 0.1533 | 1.4934 | 0.3862 | 0.1367 | 0.3962 | 0.5971 |
| 0.6837 | 60.0 | 56567 | 0.1764 | 0.1601 | 1.5599 | 0.4032 | 0.1413 | 0.4158 | 0.6180 |
| 0.6750 | 61.0 | 57510 | 0.1700 | 0.1557 | 1.4487 | 0.3910 | 0.1376 | 0.3998 | 0.5994 |
| 0.6741 | 62.0 | 58453 | 0.1813 | 0.1657 | 1.6348 | 0.4229 | 0.1465 | 0.4311 | 0.6398 |
| 0.6628 | 63.0 | 59395 | 0.1805 | 0.1648 | 1.5641 | 0.4087 | 0.1476 | 0.4184 | 0.6224 |
| 0.6480 | 64.0 | 60337 | 0.1710 | 0.1560 | 1.5486 | 0.3914 | 0.1356 | 0.3998 | 0.6011 |
| 0.6453 | 65.0 | 61279 | 0.1717 | 0.1561 | 1.4959 | 0.3913 | 0.1365 | 0.3977 | 0.6015 |
| 0.6373 | 66.0 | 62222 | 0.1825 | 0.1659 | 1.5868 | 0.4151 | 0.1468 | 0.4254 | 0.6310 |
| 0.6321 | 67.0 | 63165 | 0.1730 | 0.1566 | 1.5750 | 0.3924 | 0.1401 | 0.4023 | 0.6047 |
| 0.6250 | 68.0 | 64108 | 0.1663 | 0.1515 | 1.4604 | 0.3883 | 0.1318 | 0.3953 | 0.5972 |
| 0.6163 | 69.0 | 65051 | 0.1794 | 0.1623 | 1.5947 | 0.4033 | 0.1477 | 0.4131 | 0.6177 |
| 0.6089 | 70.0 | 65994 | 0.1648 | 0.1510 | 1.4913 | 0.3778 | 0.1319 | 0.3834 | 0.5811 |
| 0.6148 | 71.0 | 66936 | 0.1762 | 0.1604 | 1.6356 | 0.4066 | 0.1402 | 0.4132 | 0.6203 |
| 0.6003 | 72.0 | 67879 | 0.1711 | 0.1558 | 1.5597 | 0.3904 | 0.1387 | 0.3996 | 0.6008 |
| 0.5980 | 73.0 | 68821 | 0.1741 | 0.1582 | 1.5923 | 0.4018 | 0.1386 | 0.4098 | 0.6151 |
| 0.5926 | 74.0 | 69764 | 0.1586 | 0.1444 | 1.4478 | 0.3763 | 0.1223 | 0.3856 | 0.5843 |
| 0.5906 | 75.0 | 70707 | 0.1663 | 0.1513 | 1.5202 | 0.3876 | 0.1320 | 0.3952 | 0.5972 |
| 0.5794 | 76.0 | 71649 | 0.1671 | 0.1520 | 1.4704 | 0.3757 | 0.1371 | 0.3843 | 0.5816 |
| 0.5743 | 77.0 | 72592 | 0.1675 | 0.1527 | 1.5436 | 0.3888 | 0.1332 | 0.4000 | 0.5999 |
| 0.5743 | 78.0 | 73535 | 0.1722 | 0.1567 | 1.6024 | 0.3898 | 0.1389 | 0.3978 | 0.5998 |
| 0.5657 | 79.0 | 74478 | 0.1550 | 0.1406 | 1.4245 | 0.3621 | 0.1242 | 0.3685 | 0.5669 |
| 0.5613 | 80.0 | 75421 | 0.1750 | 0.1584 | 1.6149 | 0.3977 | 0.1405 | 0.4049 | 0.6103 |
| 0.5535 | 81.0 | 76364 | 0.1631 | 0.1491 | 1.4970 | 0.3844 | 0.1305 | 0.3921 | 0.5935 |
| 0.5506 | 82.0 | 77307 | 0.1658 | 0.1517 | 1.5143 | 0.3819 | 0.1338 | 0.3907 | 0.5900 |
| 0.5441 | 83.0 | 78250 | 0.1583 | 0.1446 | 1.4350 | 0.3684 | 0.1278 | 0.3775 | 0.5735 |
| 0.5405 | 84.0 | 79192 | 0.1612 | 0.1473 | 1.4970 | 0.3739 | 0.1301 | 0.3831 | 0.5792 |
| 0.5428 | 85.0 | 80136 | 0.1589 | 0.1451 | 1.4426 | 0.3729 | 0.1263 | 0.3808 | 0.5795 |
| 0.5346 | 86.0 | 81079 | 0.1599 | 0.1451 | 1.4221 | 0.3676 | 0.1285 | 0.3738 | 0.5729 |
| 0.5354 | 87.0 | 82023 | 0.1522 | 0.1381 | 1.3761 | 0.3540 | 0.1216 | 0.3597 | 0.5555 |
| 0.5303 | 88.0 | 82966 | 0.1587 | 0.1445 | 1.4144 | 0.3654 | 0.1273 | 0.3729 | 0.5694 |
| 0.5254 | 89.0 | 83908 | 0.1613 | 0.1469 | 1.5136 | 0.3732 | 0.1248 | 0.3805 | 0.5788 |
| 0.5168 | 90.0 | 84850 | 0.1590 | 0.1446 | 1.4586 | 0.3664 | 0.1254 | 0.3753 | 0.5707 |
Framework versions
- Pytorch 2.12.0+cu126
- icefall 6fd674312c1d87bd9fc888d623cb3e347ac019ff