Panini-00 10M
Hindi ↔ Sanskrit sentence translation in Devanagari. Custom PyTorch checkpoint, not a Transformers model.
Files
| File | Role |
|---|---|
checkpoint.pt |
Model weights |
tokenizer.model |
SentencePiece tokenizer, 12,000 pieces |
Keep this tokenizer with this checkpoint.
Tasks
| Task | Direction |
|---|---|
translate_hi_sa |
Hindi → Sanskrit |
translate_sa_hi |
Sanskrit → Hindi |
sanskritize_hindi |
Hindi with Sanskrit words |
correct_hi |
Hindi grammar and word choice |
correct_sa |
Sanskrit grammar |
Pass one Devanagari sentence. The loader adds the task tags.
Examples
| Task | Prompt | Example |
|---|---|---|
sanskritize_hindi |
मैं स्कूल जाता हूँ और पानी पीता हूँ। | मैं विद्यालय जाता हूँ और जल पीता हूँ। |
sanskritize_hindi |
यह किताब बहुत अच्छी है। | यह पुस्तक अति उत्तम है। |
correct_hi |
यह पुस्तक अच्छा है। | यह पुस्तक अच्छी है। |
correct_hi |
वह किताब पढ़ता हैं। | वह किताब पढ़ता है। |
correct_sa |
अहं गृहं गच्छति। | अहं गृहं गच्छामि। |
correct_sa |
बालकः पुस्तकं पठन्ति। | बालकः पुस्तकं पठति। |
translate_hi_sa |
मैं किताब पढ़ता हूँ। | अहं पुस्तकं पठामि। |
Size
| Parameters | 10,942,720 |
| Layers | 12 |
| Width | 256 |
| Query / key-value heads | 8 / 2 |
| Head dimension | 32 |
| Feed-forward width | 640 |
| Context | 1,024 tokens |
| Vocabulary | 12,000 |
| Pretrain tokens | 200,008,776 |
| Supervised tokens | 20,000,016 |
| Supervised examples | 312,176 |
Install
Reference code: midroid/ai-models, branch experiment/010-hindi-sanskrit. Python 3.10+, PyTorch, SentencePiece, and PyYAML.
git clone --branch experiment/010-hindi-sanskrit --depth 1 https://github.com/midroid/ai-models.git
cd ai-models/experiments/language/010-hindi-sanskrit-slm
uv sync
huggingface-cli download akashchauhan/panini-00-10m --local-dir weights/panini-00-10m
Inference
Greedy decoding (temperature 0). Generation stops at end-of-sequence and cannot pass the 1,024-token context, including the prompt.
uv run python -m src.sample \
--checkpoint weights/panini-00-10m \
--task translate_hi_sa \
--prompt "मैं किताब पढ़ता हूँ।" \
--max-new-tokens 32
The translation is the text after <tgt>.
from src.sample import continue_prompt
text, _ = continue_prompt(
"weights/panini-00-10m",
"translate_hi_sa",
"मैं किताब पढ़ता हूँ।",
max_new_tokens=32,
temperature=0.0,
)
print(text.split("<tgt>", 1)[-1].strip())
Sanskrit → Hindi uses task translate_sa_hi. CPU is sufficient.