Views
No views yet
Preview Release: This is an early preview (v0.1) for validation purposes. Not intended for production use. Evaluation and model quality may improve in future versions.
Note: This is a base model trained via Continued Pre-Training. It is designed as a foundation for downstream task-specific fine-tuning (e.g., translation, summarization, question answering). For best results, we recommend fine-tuning on your target task using Supervised Fine-Tuning (SFT) before deployment.
| Base Model | google/gemma-3-1b-pt |
| Training Method | Continued Pre-Training (CPT), full parameter update |
| Languages | Khmer (km), English (en) |
| Parameters | ~1B |
| Context Length | 4096 tokens |
| Precision | bfloat16 |
| License | Gemma Terms of Use |
google/gemma-3-1b-pt
└── mengsay/Gemma-3-Tonsai-1B-v0.1 (CPT on Khmer data)| Dataset | Type | Weight | Role |
|---|---|---|---|
| CulturaX (km) | Monolingual | 55% | Khmer web text |
| Wikipedia (km) | Monolingual | 5% | High-quality Khmer |
| CulturaX (en) | Monolingual | 10% | English retention |
| OPUS-100 (en-km) | Parallel | 15% | Cross-lingual alignment |
| OpenHermes 2.5 | Instruction | 10% | Instruction following |
| Khmer Dictionary 44K | Dictionary | 5% | Vocabulary knowledge |
| Parameter | Value |
|---|---|
| Effective batch size | 64 (32 per device x 2 grad accum) |
| Max sequence length | 4096 |
| Learning rate | 5e-5 (embedding: 1e-5) |
| LR scheduler | Cosine with warmup |
| Warmup steps | 200 |
| Weight decay | 0.01 |
| Optimizer | AdamW 8-bit |
| Gradient checkpointing | Unsloth |
| Hardware | NVIDIA RTX PRO 6000 Blackwell (95GB VRAM) |
| Dataset | Gemma-3-1B-PT (base) | Tonsai-1B v0.1 |
|---|---|---|
| Wikipedia (km) | 9.06 | 2.14 |
| CulturaX (km) | 7.09 | 7.90 |
| Task | Setting | Metric | Gemma-3-1B-PT (base) | Tonsai-1B v0.1 |
|---|---|---|---|---|
| en→km | zero-shot | BLEU | 1.62 | 18.04 |
| en→km | 5-shot | BLEU | 3.71 | 19.34 |
| en→km | zero-shot | chrF | 4.45 | 36.25 |
| en→km | 5-shot | chrF | 16.60 | 37.14 |
| km→en | zero-shot | BLEU | 9.38 | 19.66 |
| km→en | 5-shot | BLEU | 13.12 | 19.00 |
| km→en | zero-shot | chrF | 31.21 | 44.57 |
| km→en | 5-shot | chrF | 35.70 | 42.09 |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_name = "mengsay/Gemma-3-Tonsai-1B-v0.1"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype=torch.bfloat16,
9 device_map="auto",
10)
11
12prompt = "ជីវិតរស់នៅក្នុងទីក្រុងសព្វថ្ងៃពិតជា"
13inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
14output = model.generate(**inputs, max_new_tokens=200)
15print(tokenizer.decode(output[0], skip_special_tokens=True))1prompt = "English: Cambodia is a country in Southeast Asia.\nKhmer:"
2inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
3output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
4print(tokenizer.decode(output[0], skip_special_tokens=True))1# Start vLLM server
2python -m vllm.entrypoints.openai.api_server \
3 --model mengsay/Gemma-3-Tonsai-1B-v0.1 --port 80001from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
4response = client.completions.create(
5 model="mengsay/Gemma-3-Tonsai-1B-v0.1",
6 prompt="Cambodia is",
7 max_tokens=200,
8)
9print(response.choices[0].text)1@misc{tonsai-lm-2026,
2 title = {Tonsai LM: Continued Pre-Training for Khmer Language Models},
3 author = {Mengsay Loem},
4 year = {2026},
5 url = {https://huggingface.co/mengsay/Gemma-3-Tonsai-1B-v0.1}
6}