Upload NyayaLM tokenizer folder
Browse files- README.md +35 -0
- chat_template.jinja +8 -0
- nyayalm_sp.model +3 -0
- nyayalm_sp.vocab +0 -0
- tokenizer.json +0 -0
- tokenizer_build_metadata.json +44 -0
- tokenizer_config.json +63 -0
README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ne
|
| 4 |
+
- en
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
tags:
|
| 7 |
+
- tokenizer
|
| 8 |
+
- sentencepiece
|
| 9 |
+
- bpe
|
| 10 |
+
- nepali
|
| 11 |
+
- legal
|
| 12 |
+
- nyayalm
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# NyayaLM Tokenizer
|
| 16 |
+
|
| 17 |
+
SentencePiece-BPE tokenizer (64,000 vocab) for **NyayaLM-200M**,
|
| 18 |
+
a bilingual (Nepali/English) legal-domain model with a Qwen3-style architecture and
|
| 19 |
+
ChatML-style special tokens.
|
| 20 |
+
|
| 21 |
+
- Model type: BPE, byte-fallback enabled (never emits `<unk>`)
|
| 22 |
+
- Character coverage: 0.9995
|
| 23 |
+
- Curated special tokens: 17
|
| 24 |
+
- Reserved tokens for future use: 32
|
| 25 |
+
|
| 26 |
+
## Usage
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from transformers import AutoTokenizer
|
| 30 |
+
tok = AutoTokenizer.from_pretrained("REPO_ID")
|
| 31 |
+
tok.apply_chat_template(
|
| 32 |
+
[{'role': "user", "content": "नमस्ते"}],
|
| 33 |
+
tokenize=False, add_generation_prompt=True,
|
| 34 |
+
)
|
| 35 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'system' %}<|im_start|>system
|
| 2 |
+
{{ message['content'] }}<|im_end|>
|
| 3 |
+
{% elif message['role'] == 'user' %}<|im_start|>user
|
| 4 |
+
{{ message['content'] }}<|im_end|>
|
| 5 |
+
{% elif message['role'] == 'assistant' %}<|im_start|>assistant
|
| 6 |
+
{{ message['content'] }}<|im_end|>
|
| 7 |
+
{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
|
| 8 |
+
{% endif %}
|
nyayalm_sp.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de34c567d7cd811837bd6f7d5c332cdc2862c8df3437f9cbabce3672ce77507e
|
| 3 |
+
size 1761018
|
nyayalm_sp.vocab
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_build_metadata.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "bpe",
|
| 3 |
+
"vocab_size": 64000,
|
| 4 |
+
"sp_trained_vocab_size": 63951,
|
| 5 |
+
"curated_special_tokens": [
|
| 6 |
+
"<|endoftext|>",
|
| 7 |
+
"<|im_start|>",
|
| 8 |
+
"<|im_end|>",
|
| 9 |
+
"<|user|>",
|
| 10 |
+
"<|assistant|>",
|
| 11 |
+
"<|system|>",
|
| 12 |
+
"<|thinking|>",
|
| 13 |
+
"<|/thinking|>",
|
| 14 |
+
"<|legal_doc|>",
|
| 15 |
+
"<|/legal_doc|>",
|
| 16 |
+
"<|nepali|>",
|
| 17 |
+
"<|english|>",
|
| 18 |
+
"<|court_order|>",
|
| 19 |
+
"<|judgement|>",
|
| 20 |
+
"<|statute|>",
|
| 21 |
+
"<|contract|>",
|
| 22 |
+
"<|tool_call|>"
|
| 23 |
+
],
|
| 24 |
+
"num_reserved_tokens": 32,
|
| 25 |
+
"character_coverage": 0.9995,
|
| 26 |
+
"byte_fallback": true,
|
| 27 |
+
"training_lines": 90251,
|
| 28 |
+
"architecture_target": {
|
| 29 |
+
"params": "213M",
|
| 30 |
+
"layers": 20,
|
| 31 |
+
"hidden_size": 768,
|
| 32 |
+
"ffn_size": 3072,
|
| 33 |
+
"attn_heads_q": 12,
|
| 34 |
+
"attn_heads_kv": 4,
|
| 35 |
+
"head_dim": 64,
|
| 36 |
+
"context_train": 4096,
|
| 37 |
+
"context_infer": 8192,
|
| 38 |
+
"rope_base": 1000000,
|
| 39 |
+
"qk_norm": true,
|
| 40 |
+
"weight_tying": true,
|
| 41 |
+
"activation": "SwiGLU",
|
| 42 |
+
"norm": "RMSNorm(eps=1e-6)"
|
| 43 |
+
}
|
| 44 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|endoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|endoftext|>",
|
| 8 |
+
"<|im_start|>",
|
| 9 |
+
"<|im_end|>",
|
| 10 |
+
"<|user|>",
|
| 11 |
+
"<|assistant|>",
|
| 12 |
+
"<|system|>",
|
| 13 |
+
"<|thinking|>",
|
| 14 |
+
"<|/thinking|>",
|
| 15 |
+
"<|legal_doc|>",
|
| 16 |
+
"<|/legal_doc|>",
|
| 17 |
+
"<|nepali|>",
|
| 18 |
+
"<|english|>",
|
| 19 |
+
"<|court_order|>",
|
| 20 |
+
"<|judgement|>",
|
| 21 |
+
"<|statute|>",
|
| 22 |
+
"<|contract|>",
|
| 23 |
+
"<|tool_call|>",
|
| 24 |
+
"<|reserved_special_token_0|>",
|
| 25 |
+
"<|reserved_special_token_1|>",
|
| 26 |
+
"<|reserved_special_token_2|>",
|
| 27 |
+
"<|reserved_special_token_3|>",
|
| 28 |
+
"<|reserved_special_token_4|>",
|
| 29 |
+
"<|reserved_special_token_5|>",
|
| 30 |
+
"<|reserved_special_token_6|>",
|
| 31 |
+
"<|reserved_special_token_7|>",
|
| 32 |
+
"<|reserved_special_token_8|>",
|
| 33 |
+
"<|reserved_special_token_9|>",
|
| 34 |
+
"<|reserved_special_token_10|>",
|
| 35 |
+
"<|reserved_special_token_11|>",
|
| 36 |
+
"<|reserved_special_token_12|>",
|
| 37 |
+
"<|reserved_special_token_13|>",
|
| 38 |
+
"<|reserved_special_token_14|>",
|
| 39 |
+
"<|reserved_special_token_15|>",
|
| 40 |
+
"<|reserved_special_token_16|>",
|
| 41 |
+
"<|reserved_special_token_17|>",
|
| 42 |
+
"<|reserved_special_token_18|>",
|
| 43 |
+
"<|reserved_special_token_19|>",
|
| 44 |
+
"<|reserved_special_token_20|>",
|
| 45 |
+
"<|reserved_special_token_21|>",
|
| 46 |
+
"<|reserved_special_token_22|>",
|
| 47 |
+
"<|reserved_special_token_23|>",
|
| 48 |
+
"<|reserved_special_token_24|>",
|
| 49 |
+
"<|reserved_special_token_25|>",
|
| 50 |
+
"<|reserved_special_token_26|>",
|
| 51 |
+
"<|reserved_special_token_27|>",
|
| 52 |
+
"<|reserved_special_token_28|>",
|
| 53 |
+
"<|reserved_special_token_29|>",
|
| 54 |
+
"<|reserved_special_token_30|>",
|
| 55 |
+
"<|reserved_special_token_31|>"
|
| 56 |
+
],
|
| 57 |
+
"model_max_length": 4096,
|
| 58 |
+
"pad_token": "<|endoftext|>",
|
| 59 |
+
"padding_side": "right",
|
| 60 |
+
"tokenizer_class": "TokenizersBackend",
|
| 61 |
+
"truncation_side": "right",
|
| 62 |
+
"unk_token": "<unk>"
|
| 63 |
+
}
|