Downloads · 30 days
27
10% of all-time downloads
kshitijthakkar/shlokartha
shlokartha is a text generation model from kshitijthakkar. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
27
10% of all-time downloads
All-time downloads
273
Public
Parameters
390M
794 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors780 MB · 98%
From the Hugging Face model README

Shlokartha is a compact causal language model fine-tuned for layered Sanskrit verse interpretation. It is designed to separate Pada Artha (word-by-word meaning), Anvaya (semantic translation), and Bhavartha (expanded context) while preserving Devanagari and transliteration where useful.
kshitijthakkar/loggenix-moe-0.4B-0.2A-sft-s4kshitijthakkar/shlokartha-sftsarvamai/vagarthakshitijthakkar/shlokartha-playgroundThe final run used three epochs and 3,372 optimizer steps:
| Setting | Value |
|---|---|
| Learning rate | 2e-4 |
| Scheduler | cosine |
| Warmup | 10% of training steps |
| Per-device batch size | 4 |
| Gradient accumulation | 8 |
| Effective batch size | 32 sequences/update |
| Maximum sequence length | 8,192 tokens |
| Packing | enabled |
| Precision | bfloat16 |
| Optimizer | adamw_torch_fused |
| Gradient checkpointing | enabled |
| Hardware | 1 × 96 GB RTX 6000-class GPU |
The held-out validation split contained 4,404 examples. The final logged
validation loss was 1.469 and mean token accuracy was 0.6935. These are
training diagnostics, not a claim of expert-level Sanskrit correctness or a
substitute for human evaluation.
Use this checkpoint for experimentation with Sanskrit verse explanation, Indic-language interfaces, educational prototypes, and research on structured literary interpretation. The companion playground exposes decoding controls and displays the three intended commentary layers separately.
The model can produce fluent but incorrect translations, grammatical analyses, source attributions, or philosophical context. It should not be treated as an authoritative Sanskrit scholar, a substitute for a critical edition, or a sole source for religious, historical, or educational claims. Review outputs against the original text and qualified references. The training corpus contains source explanations from the upstream Vāgartha dataset; retain its CC-BY-4.0 attribution when redistributing derived material.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "kshitijthakkar/shlokartha"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True, dtype="auto"
)
messages = [{
"role": "user",
"content": (
"Explain this Sanskrit verse with exactly these headings: "
"**Pada Artha**, **Anvaya**, and **Bhavartha**.\n\n"
"कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।"
),
}]
inputs = tokenizer.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
The dataset used for fine-tuning is derived from sarvamai/vagartha and is
distributed under CC-BY-4.0 with upstream attribution requirements. Consult
the base checkpoint's terms for model redistribution and derivative-use
conditions.