--- license: apache-2.0 language: [sa, bo, zh, pi, en, de] tags: [buddhist-studies, sanskrit, tibetan, classical-chinese, pali, translation] library_name: transformers pipeline_tag: text-generation --- # mitra-qwen35-2b-base-stage2 The compact (2B) member of the [Dharmamitra](https://dharmamitra.org) Qwen3.5 family: Qwen3.5-2B after ~45B tokens of continued pretraining on classical Buddhist corpora (2 epochs, 8k context) and a stage-2 SFT that **adds translation-specific capabilities** — bidirectional parallel translation and production translation turnarounds (1.4 epochs). Use it where the 9B [`mitra-qwen35-base-stage2`](https://huggingface.co/buddhist-nlp/mitra-qwen35-base-stage2) is too heavy; same conventions (Tibetan in Wylie, Sanskrit/Pāli in IAST), same chat template. ## Usage ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("buddhist-nlp/mitra-qwen35-2b-base-stage2") model = AutoModelForCausalLM.from_pretrained( "buddhist-nlp/mitra-qwen35-2b-base-stage2", dtype=torch.bfloat16, device_map="cuda" ) messages = [{"role": "user", "content": "Translate into English: evaṃ mayā śrutam ekasmin samaye"}] inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_dict=True, return_tensors="pt").to(model.device) out = model.generate(**inputs, max_new_tokens=128) print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)) ``` ## Citation If you use this model, please cite the Dharmamitra project (https://dharmamitra.org). A technical report is in preparation.