1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "dipta007/GanitLLM-1.7B_SFT"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype="auto",
9 device_map="auto"
10)
11
12problem = "একটি দোকানে ১২টি আপেল আছে। যদি ৫টি আপেল বিক্রি হয়, তাহলে কতটি আপেল বাকি থাকবে?"
13
14prompt = f"""A conversation takes place between the user and the assistant. The user asks a question, and the assistant solves the problem. Please reason step by step in Bengali, and put your final answer in the <answer> </answer> tags.
15
16Question: {problem}"""
17
18messages = [{"role": "user", "content": prompt}]
19text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
20model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
21
22generated_ids = model.generate(**model_inputs, max_new_tokens=2048, temperature=0.7)
23output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
24response = tokenizer.decode(output_ids, skip_special_tokens=True)
25print(response)
1@inproceedings{dipta2026ganitllm,
2 title={GanitLLM: Difficulty-Aware Bengali Mathematical Reasoning through Curriculum-GRPO},
3 author={Shubhashis Roy Dipta and Khairul Mahbub and Nadia Najjar},
4 booktitle={Findings of the Association for Computational Linguistics: ACL 2026},
5 year={2026},
6 eprint={2601.06767},
7 archivePrefix={arXiv},
8 primaryClass={cs.CL},
9 url={https://arxiv.org/abs/2601.06767},
10}
This model is released under the Apache 2.0 License.