Views
No views yet
| Language | Algorithm | Vocab | Fertility (tok/word) | chars/token | UNK rate |
|---|---|---|---|---|---|
| Hindi | BPE | 24,000 | 1.2542 | 4.1039 | 0.0e+00 |
tokenizer_sweep.json in each
language folder holds the full comparison.d_model=384 the embedding table costs vocab × 384 out of a ~25M
budget, and one decoder layer costs ~12 × 384² = 1.77M:| Vocab | Embeddings | Share of budget | Decoder layers affordable |
|---|---|---|---|
| 16,000 | 6.14M | 25% | ~10.7 |
| 24,000 | 9.22M | 37% | ~8.9 |
| 64,000 | 24.58M | 98% | ~0 |
byte_fallback=True: any character the vocabulary cannot cover decomposes into
UTF-8 byte tokens (ids 3–258). Nothing is ever discarded.common/normalize.py,
whose behaviour is language-specific: chandrabindu (ँ) folds to anusvara (ं)
for Hindi but not for Nepali, where the nasalization is phonemic.1import sentencepiece as spm
2from huggingface_hub import hf_hub_download
3
4path = hf_hub_download("Prateek-Tiwari10/lma_phase1-tokenizer", "hindi/hindi_final.model")
5sp = spm.SentencePieceProcessor(model_file=path)
6print(sp.encode("प्रधानमंत्री ने कहा कि सरकार काम कर रही है।", out_type=str))hindi/ hindi_final.model · hindi_final.vocab
tokenizer_final.json · tokenizer_sweep.json · sweep_models/
nepali/ nepali_final.model · nepali_final.vocab
tokenizer_final.json · tokenizer_sweep.json · sweep_models/