Downloads · 30 days
0
aaiiaxom/indicxlit-roman-to-assamese-onnx-int8
indicxlit-roman-to-assamese-onnx-int8 is a machine learning model from aaiiaxom. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for onnx. The card lists the license as mit.
Roman → Assamese transliteration, exported to ONNX and dynamically quantized to INT8 so it runs entirely on-device in a browser through onnxruntime-web. No Python, no server, no network after first load.
Downloads · 30 days
0
Access
Public
Updated Aug 20, 2026
Repo size
14.4 MB
Likes
0
Public
Click a slice to open those files.
.onnx14.4 MB · 100%
From the Hugging Face model README
as) — ONNX INT8Roman → Assamese transliteration, exported to ONNX and dynamically quantized to
INT8 so it runs entirely on-device in a browser through onnxruntime-web.
No Python, no server, no network after first load.
Built for phonetic keyboard and voice-typing input in Assamese
(moi axomiya → মই অসমীয়া).
This is a format conversion of AI4Bharat's IndicXlit. All modelling work is theirs — see Attribution.
| File | Purpose |
|---|---|
encoder.int8.onnx | src_tokens → encoder_out, encoder_padding_mask |
decoder.int8.onnx | prev_output_tokens, encoder_out, encoder_padding_mask → logits |
src_vocab.json | Source (Roman) vocabulary, index-ordered |
tgt_vocab.json | Target (Assamese) vocabulary, index-ordered |
model_config.json | Token indices needed to drive decoding |
The encoder and decoder are separate graphs with dynamic sequence axes, so you drive the autoregressive loop yourself. The decoder returns logits at the last position only.
[src_lang_token_idx] + [char ids] + [src_eos_idx][decoder_start_token_idx].tgt_pad_idx and tgt_unk_idx to -inf,
take the argmax (or run beam search), append, repeat until tgt_eos_idx.tgt_vocab.json and drop <...> and __...__ tokens.All indices come from model_config.json. The model is word-level — split
sentences into words before calling it.
Ready-made worker and client: https://github.com/aaiiaxomi/indicxlit-onnx-web
import { XlitClient } from './xlit-client.js';
const xlit = new XlitClient();
await xlit.init({ baseUrl: './models/indicxlit-as' });
await xlit.transliterateWord('axomiya');
// [{ text: 'অসমীয়া', score: -0.31 }]
await xlit.transliterateText('moi guwahati 2025 t asilo');
// Latin words converted; digits, punctuation and existing Assamese
// pass through byte-identical
import json, numpy as np, onnxruntime as ort
cfg = json.load(open("model_config.json"))
src = json.load(open("src_vocab.json"))
tgt = json.load(open("tgt_vocab.json"))
s2i = {t: i for i, t in enumerate(src)}
enc = ort.InferenceSession("encoder.int8.onnx", providers=["CPUExecutionProvider"])
dec = ort.InferenceSession("decoder.int8.onnx", providers=["CPUExecutionProvider"])
def translit(word, max_len=40):
ids = [cfg["src_lang_token_idx"]] + \
[s2i[c] for c in word.lower() if c in s2i] + [cfg["src_eos_idx"]]
eo, em = enc.run(None, {"src_tokens": np.array([ids], dtype=np.int64)})
prev, out = np.array([[cfg["decoder_start_token_idx"]]], dtype=np.int64), []
for _ in range(max_len):
logits, = dec.run(None, {"prev_output_tokens": prev,
"encoder_out": eo, "encoder_padding_mask": em})
lp = logits[0].copy()
lp[cfg["tgt_pad_idx"]] = lp[cfg["tgt_unk_idx"]] = -np.inf
nxt = int(lp.argmax())
if nxt == cfg["tgt_eos_idx"]:
break
out.append(nxt)
prev = np.concatenate([prev, [[nxt]]], axis=1)
return "".join(t for t in (tgt[i] for i in out)
if not (t.startswith("<") and t.endswith(">"))
and not (t.startswith("__") and t.endswith("__")))
print(translit("axomiya"))
Inherited from upstream IndicXlit: a multilingual transformer of roughly 11M
parameters — 6 encoder and 6 decoder layers, 256-dim embeddings, 4 attention
heads, feedforward dimension 1024 — trained on the
Aksharantar corpus.
This export keeps only the Assamese (as) prefix token path.
On the Aksharantar benchmark, upstream reports top-1 accuracy of 60.27 for Assamese native words and 38.62 for named entities. Those figures are for the original fp32 model; this repo has not been benchmarked separately, so treat them as an upper bound rather than a measured result for these INT8 weights.
Reproduce with https://github.com/aaiiaxomi/indicxlit-onnx-web:
python convert_onnx.py --lang as
The same script converts any of the 21 languages IndicXlit supports.
The model is IndicXlit by AI4Bharat, IIT Madras, trained on the Aksharantar dataset. This repository only changes the serialization format and numeric precision.
MIT, following upstream. IndicXlit's code and models are released under the MIT License; this conversion is redistributed under the same terms.
Converted and maintained by the Assam AI Initiative (AAII).