Instructions to use kangkyu/icefall-asr-ko-streaming-zipformer-72m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- K2
How to use kangkyu/icefall-asr-ko-streaming-zipformer-72m with K2:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
language:
- ko
license: apache-2.0
tags:
- automatic-speech-recognition
- zipformer
- transducer
- causal
- icefall
- k2
- korean
datasets:
- ksponspeech
metrics:
- cer
pipeline_tag: automatic-speech-recognition
icefall-asr-ko-streaming-zipformer-72m (ํ๊ตญ์ด)
๐ English README
icefall ๋ ์ํผ๋ก ํ์ตํ 71.4M ํ๋ผ๋ฏธํฐ ํ๊ตญ์ด causal ASR.
- ํ์ต ๋ฐ์ดํฐ: KsponSpeech, ์ฝ 1,000์๊ฐ
- KsponSpeech eval CER (๊ตฌ๋์ ๋ฌด์, CPU ์ถ๋ก )
- 7.68% โ offline best (chunk=โ1 PyTorch + KenLM, RTF 0.057)
- 8.25% โ streaming best (sherpa-onnx int8 chunk-64, RTF 0.038)
- ๋ฐฐํฌ ๊ตฌ์ฑ: PyTorch
.pt+ sherpa-onnx int8 ONNX (chunk 16/32/64, ๋ณ๋ export ์์ด ์ฆ์ ์ฌ์ฉ ๊ฐ๋ฅ)
๋ชจ๋ธ ์ ๋ณด
icefall Zipformer transducer ๊ธฐ๋ฐ.
- causal ๊ตฌ์กฐ (chunk-16 / 32 / 64 / -1 multichunk ํ์ต)
- ํ๊ตญ์ด ์์ vocabulary (2,460 ํ ํฐ)
- FP16 ํ์ต
- ๋ฐฐํฌ ํ์ผ: PyTorch
epoch-99.pt(3-way state-dict avg, 273 MB) + sherpa-onnx int8 ONNX 9๊ฐ (chunk 16/32/64 ร encoder/decoder/joiner). ๋ณ๋ export ์์ด ์ฆ์ ์ฌ์ฉ ๊ฐ๋ฅ
์ฑ๋ฅ (KsponSpeech eval, CER %, ๊ตฌ๋์ ๋ฌด์)
eval_clean 3,000 + eval_other 3,000 = 6,000 cuts. ๋์ผ ์ , beam=8, 3-way state-dict avg.
๋์ฝ๋ฉ ๋ชจ๋ โ latency ์์ฐ์ ๋ฐ๋ผ ์ ํ
| ๋ชจ๋ | chunk | clean | other | OVR | RTF | latency |
|---|---|---|---|---|---|---|
| chunk=โ1 PyTorch + KenLM ฮป=0.10 (offline best) | โ1 | 7.63 | 7.72 | 7.68 | 0.057 (CPU 2t) | ๋ฐํ ๋ ๋๊ธฐ |
| sherpa-onnx int8 chunk-64 | 64 | 8.28 | 8.22 | 8.25 | 0.038 (CPU 1t) | 1.28์ด |
| sherpa-onnx int8 chunk-32 | 32 | 8.45 | 8.33 | 8.39 | 0.039 (CPU 1t) | 640ms |
| sherpa-onnx int8 chunk-16 | 16 | 8.63 | 8.64 | 8.635 | 0.052 (CPU 1t) | 320ms |
streaming ์ธก์ ์ trailing padding 1x (CHUNK * 0.04 ์ด) ๊ธฐ์ค. RTF๋ clean/other ํ๊ท .
chunk=โ1 (offline best 7.68%)๋ PyTorch ์ ์ฉ: sherpa-onnx๋ streaming chunk(16/32/64)๋ง ์ง์. offline ์ต๊ณ ์ ํ๋๊ฐ ํ์ํ๋ฉด
epoch-99.pt๋ฅผ icefall recipe๋ก ์ง์ ๋์ฝ๋ฉ โ ์๋ "Option 1 โ PyTorch (epoch-99.pt) + icefall recipe" ์น์ ์ฐธ๊ณ .
์์ํ ์์ ์ฑ โ fp32 vs int8 โญ
๊ฐ์ KsponSpeech 6,000 cut eval, ๋์ผ 1x padding, CPU 1-thread ์ง์ sweep:
| chunk | fp32 OVR | int8 OVR | ฮ CER | fp32 RTF | int8 RTF | speedup |
|---|---|---|---|---|---|---|
| 16 | 8.645 | 8.635 | โ0.010 | 0.078 | 0.052 | 1.50ร |
| 32 | 8.340 | 8.390 | +0.050 | 0.060 | 0.039 | 1.54ร |
| 64 | 8.115 | 8.250 | +0.135 | 0.057 | 0.038 | 1.50ร |
int8 ์์ํ ํ์๋ ์ ํ๋๊ฐ ์ฌ์ค์ ๋ณด์กด๋จ (ํ๊ท ฮ +0.06%p, ์ต๋ +0.135). CPU ์ถ๋ก ์๋๋ ~1.5๋ฐฐ ๋นจ๋ผ์ง โ ๊ทธ๋์ ๋ฐฐํฌ๋ .int8.onnx๋ง ํฌํจ. fp32๊ฐ ํ์ํ๋ฉด epoch-99.pt์์ icefall recipe๋ก ์ฌexport.
๊ฐ์ ํ๊ฒฝ์์ ์ง์ ์ธก์ ํ ๋น๊ต (KsponSpeech eval 6,000 cuts)
| ๋ชจ๋ธ | params | clean | other | OVR |
|---|---|---|---|---|
| ๋๋ฐ 174M ๋ชจ๋ธ | 155.7M | 7.18 | 7.14 | 7.16 |
| ๋ณธ ๋ชจ๋ธ (72M) | 71.4M | 7.63 | 7.72 | 7.68 |
| Qwen3-ASR-1.7B (Alibaba) | 1,700M | 9.76 | 10.22 | 9.99 |
| OpenAI Whisper-large-v2 | 1,550M | 13.70 | 12.64 | 13.17 |
๋ชจ๋ ๋ชจ๋ธ์ ๊ฐ์ KsponSpeech eval ์ ์์ ์ง์ ์ธก์ . Whisper / Qwen ์ GPU FP16 transformers ๊ธฐ๋ณธ ์ต์ , ๋ณธ ๋ชจ๋ธ์ chunk=โ1 PyTorch + KenLM rescore.
๋์ฝ๋ฉ stack ๋จ๊ณ๋ณ ํจ๊ณผ
| Stack | clean | other | OVR |
|---|---|---|---|
| epoch-40 ๋จ์ผ, LM ์์ | 8.11 | 8.06 | 8.08 |
| 3-way state-dict avg, LM ์์ | 7.81 | 7.84 | 7.83 |
| 3-way avg + KenLM ฮป=0.10 (์ ํ์ ์ธก์ stack) | 7.63 | 7.72 | 7.68 |
3-way avg = best-valid + best-train + epoch-40 ์ state_dict ํ๊ท .
์ํคํ ์ฒ
| Encoder | Zipformer2 causal, 6 stacks |
| Encoder dim | 192,256,384,512,384,256 |
| Encoder layers | 2,2,3,4,3,2 |
| Feedforward dim | 512,768,1024,1536,1024,768 |
| Heads | 4,4,4,8,4,4 |
| Decoder | Stateless transducer decoder, dim 512 |
| Joiner | dim 512 |
| Vocabulary | ํ๊ตญ์ด ์์ , 2,460 ํ ํฐ |
| ์ด ํ๋ผ๋ฏธํฐ | 71.4 M |
| Causal | Yes |
| ํ์ต chunk-size | 16, 32, 64, โ1 multichunk |
ํ์ต
| ๋ฐ์ดํฐ | KsponSpeech 1,000์๊ฐ (AIHub dataset 123) |
| ์ ๋ฐ๋ | FP16 |
| Loss | Pruned-RNNT + CTC aux (scale 0.2) |
| Augmentation | SpecAugment (musan/RIR optional) |
| Optimizer | ScaledAdam |
| ์ด epoch | 40 |
| ๋ฐฐํฌ checkpoint | best-valid + best-train + epoch-40 ์ 3-way state_dict ํ๊ท |
์ฌ์ฉ
Option 1 โ PyTorch (epoch-99.pt) + icefall recipe
icefall recipe (egs/librispeech/ASR/zipformer)๋ก ๊ฐ์ค์น๋ฅผ ๋ก๋ํ์ฌ ์ถ๋ก . chunk size, beam, KenLM, ONNX export, ์์ํ ๋ฑ์ ์์ ๋กญ๊ฒ ์กฐ์ .
chunk=โ1 (offline best 7.68%) ์คํ ์์:
# epoch-99.pt๋ฅผ icefall exp dir์ epoch-99.pt๋ก ๋๊ณ ์คํ
python zipformer/decode.py \
--epoch 99 --avg 1 --use-averaged-model 0 \
--causal 1 --chunk-size -1 --left-context-frames -1 \
--decoding-method modified_beam_search --beam-size 8
KenLM rescore (ฮป=0.10) ์ถ๊ฐํ๋ฉด 7.68% ์ฌํ ๊ฐ๋ฅ. ์์ธํ ์ต์ ยทKenLM ์ฌ์ฉ๋ฒ์ icefall ๊ณต์ ๋ฌธ์ ์ฐธ๊ณ .
Option 2 โ sherpa-onnx ์คํธ๋ฆฌ๋ฐ (CPU ๋ฐฐํฌ ๊ถ์ฅ)
# ์ค์น: pip install sherpa-onnx soundfile
import sherpa_onnx
import soundfile as sf
# chunk ์ ํ: 16 (320ms ์ง์ฐ) / 32 / 64
# variant ์ ํ: ".int8" (๋ฐฐํฌ ํฌํจ โ ํฌ๊ธฐ ~1/2, CER ์์ค ๊ฑฐ์ ์์)
# "" (fp32, ๋ฐฐํฌ ๋ฏธํฌํจ โ ํ์์ epoch-99.pt์์ ์ฌexport)
CHUNK = 16
VARIANT = ".int8"
recognizer = sherpa_onnx.OnlineRecognizer.from_transducer(
encoder=f"encoder-epoch-99-avg-1-chunk-{CHUNK}-left-128{VARIANT}.onnx",
decoder=f"decoder-epoch-99-avg-1-chunk-{CHUNK}-left-128{VARIANT}.onnx",
joiner=f"joiner-epoch-99-avg-1-chunk-{CHUNK}-left-128{VARIANT}.onnx",
tokens="tokens.txt",
num_threads=2,
sample_rate=16000,
feature_dim=80,
decoding_method="modified_beam_search",
max_active_paths=8,
)
audio, sr = sf.read("speech.wav")
stream = recognizer.create_stream()
stream.accept_waveform(sr, audio)
# ๋ง์ง๋ง chunk๊ฐ ์์ ํ ๋์ฝ๋๋๋๋ก ๋์ silence padding
import numpy as np
stream.accept_waveform(16000, np.zeros(int(CHUNK * 0.04 * 16000), dtype=np.float32))
stream.input_finished()
while recognizer.is_ready(stream):
recognizer.decode_stream(stream)
print(recognizer.get_result(stream))
Chunk size ์ ํ ๊ฐ์ด๋
| chunk | latency | OVR | ์ฉ๋ |
|---|---|---|---|
| 16 | 320 ms | 8.635 | ์ค์๊ฐ UX, ์ต์ interactive ์ง์ฐ |
| 32 | 640 ms | 8.39 | ๊ท ํ |
| 64 | 1.28 s | 8.25 | ์คํธ๋ฆฌ๋ฐ best CER (offline 7.68 ๋๋น +0.57) |
ํ์ผ ๊ตฌ์ฑ
epoch-99.pt # PyTorch 3-way state_dict avg (273 MB)
tokens.txt # ์์ vocab 2,460
README.md / README_ko.md
encoder-epoch-99-avg-1-chunk-{16,32,64}-left-128.int8.onnx # int8 encoder
decoder-epoch-99-avg-1-chunk-{16,32,64}-left-128.int8.onnx
joiner-epoch-99-avg-1-chunk-{16,32,64}-left-128.int8.onnx
๋๋ฐ ๋ชจ๋ธ
โ icefall-asr-ko-streaming-zipformer-174m โ 155.7M params, KSP + AIHub 6,500์๊ฐ ํ์ต.
๋ผ์ด์ ์ค
Apache 2.0.
Citation
@misc{ko-zipformer-72m,
title = {icefall-asr-ko-streaming-zipformer-72m: Korean ASR (KsponSpeech)},
author = {Ken (kangkyu)},
year = {2026},
howpublished = {\url{https://huggingface.co/kangkyu/icefall-asr-ko-streaming-zipformer-72m}}
}
๊ธฐ๋ฐ: