Panini-00 50M
Hindi ↔ Sanskrit sentence translation in Devanagari. Custom PyTorch checkpoint, not a Transformers model.
Files
| File | Role |
|---|---|
checkpoint.pt |
Model weights |
tokenizer.model |
SentencePiece tokenizer, 32,000 pieces |
Keep this tokenizer with this checkpoint. It does not match Panini-00 10M or Panini-00 18M.
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 | 50,476,544 |
| Layers | 13 |
| Width | 512 |
| Query / key-value heads | 8 / 2 |
| Head dimension | 64 |
| Feed-forward width | 1,280 |
| Context | 1,024 tokens |
| Vocabulary | 32,000 |
| Pretrain tokens | 500,009,664 |
| Supervised tokens | 20,000,534 |
| 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-50m --local-dir weights/panini-00-50m
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-50m \
--task sanskritize_hindi \
--prompt "मैं स्कूल जाता हूँ और पानी पीता हूँ।" \
--max-new-tokens 32
The result is the text after <tgt>. correct_hi and correct_sa use the same command with a different --task. CPU is sufficient.