Views
No views yet
nrl-ai/vn-spell-correction-small.
75 % smaller on disk (530 MB safetensors → 307 MB ONNX int8) and
no PyTorch dependency at inference time — runs on plain
onnxruntime for CPU / browser / mobile
deployment.nrl-ai/vn-spell-correction-eval-real):| Slice | This (int8) | Source (fp32) | Δ |
|---|---|---|---|
forum_25 | 64.36 % | 64.64 % | -0.28 pp |
mobile_25 | 94.18 % | 95.29 % | -1.11 pp |
telex_real_25 | 15.91 % | 16.45 % | -0.54 pp |
ocr_25 | 94.21 % | 94.19 % | +0.02 pp |
legal_real_25 | 93.54 % | 93.54 % | +0.00 pp |
news_real_25 | 91.34 % | 91.34 % | +0.00 pp |
| Aggregate | 77.30 % | 77.55 % | -0.25 pp |
| Format | Size |
|---|---|
| Source safetensors (PyTorch fp32) | 530 MB |
| ONNX fp32 (export, before quant) | 1220 MB |
| ONNX int8 (this artifact) | 307 MB |
1from optimum.onnxruntime import ORTModelForSeq2SeqLM
2from transformers import AutoTokenizer
3
4tok = AutoTokenizer.from_pretrained("nrl-ai/vn-spell-correction-small-onnx-int8")
5model = ORTModelForSeq2SeqLM.from_pretrained("nrl-ai/vn-spell-correction-small-onnx-int8")
6
7inp = tok("Toi yeu Viet Nam, dat nuoc tuyet voi", return_tensors="pt")
8out = model.generate(**inp, max_length=128, num_beams=1)
9print(tok.decode(out[0], skip_special_tokens=True))
10# "Tôi yêu Việt Nam, đất nước tuyệt vời"pip install optimum[onnxruntime]optimum pulls
onnxruntime (and transformers for the tokenizer / config).onnxruntime-web), or mobile (onnxruntime-mobile).
The 307 MB / no-PyTorch footprint matters there.nrl-ai/vn-spell-correction-small when running
on GPU and PyTorch is already in the deployment. CUDA-accelerated
fp16 will out-throughput int8 ONNX on a modern GPU.1git clone https://github.com/nrl-ai/nom-vn.git
2cd nom-vn
3pip install -e ".[diacritic-hf]"
4pip install optimum[onnxruntime]
5
6# Re-export
7python training/onnx_export/export_int8.py \
8 --source nrl-ai/vn-spell-correction-small \
9 --output training/onnx_export/vn-spell-correction-small-onnx-int8
10
11# Re-bench against the OOD eval
12python training/onnx_export/bench_int8.py \
13 --model training/onnx_export/vn-spell-correction-small-onnx-int8 \
14 --json benchmarks/results/baseline_real_spell_correction_small_onnx_int8.json1@misc{nom_vn_spell_correction_onnx_int8_2026,
2 title={Vietnamese Spell Correction — ONNX int8 quantization for edge deployment},
3 author={Nguyen, Viet-Anh and {Neural Research Lab}},
4 year={2026},
5 howpublished={\url{https://huggingface.co/nrl-ai/vn-spell-correction-small-onnx-int8}}
6}nrl-ai/vn-spell-correction-smallnrl-ai/vn-spell-correction-eval-real