--- license: mit datasets: - Devavrat28/All-about-Peshwes language: - mr base_model: - unsloth/gemma-3-12b-it-unsloth-bnb-4bit tags: - history - AI - culture - Fine-tuning - Gemma3 --- ```markdown ЁЯУЬ Peshwai Historian AI (Marathi Language Model) An LLM fine-tuned to answer deep, culturally rich questions about the Peshwa era of Pune тАФ in fluent Marathi. тЬи Overview `peshwai-historian-ai` is a fine-tuned language model focused on the **Maratha Peshwa dynasty, trained on **curated historical text in Marathi. The model can answer questions about lesser-known events, policies, and figures from the 18th-century Pune region with contextual, factual, and culturally accurate responses тАФ especially useful for educators, students, historians, and heritage lovers. ЁЯФН What Makes It Special? ЁЯУЦ Marathi-native output: Generates grammatically rich and natural Marathi text ЁЯХ░я╕П Historical awareness: Avoids commonly known facts (like Bajirao, Shaniwarwada) and focuses on underrepresented topics ЁЯза Fine-tuned on real historical documents: Including rare facts about Nana Phadnavis, Mahadji Shinde, diplomacy, cultural shifts, etc. ЁЯЧгя╕П Few-shot prompting optimized: Learns from examples to improve answer quality ЁЯза Example Prompt ```marathi рд╡рд┐рд╖рдп: рдирд╛рдирд╛ рдлрдбрдгрд╡реАрд╕рд╛рдВрдЪреЗ рдЧреБрдкреНрдд рд░рд╛рдЬрдХрд╛рд░рдг рд╕рд╡рд┐рд╕реНрддрд░ рдорд╛рд╣рд┐рддреА: ``` ### ЁЯТм Sample Response ```marathi рдирд╛рдирд╛ рдлрдбрдгрд╡реАрд╕ рд╣реЗ рдкреЗрд╢рд╡рд╛рдИрддреАрд▓ рдЕрддреНрдпрдВрдд рдореБрддреНрд╕рджреНрджреА рдЖрдгрд┐ рдзреЛрд░рдгрд╢рдХреНрддреА рдЕрд╕рд▓реЗрд▓реЗ рд╡реНрдпрдХреНрддрд┐рдорддреНрд╡ рд╣реЛрддреЗ. рдорд╛рдзрд╡рд░рд╛рд╡ рдкреЗрд╢рд╡реНрдпрд╛рдВрдЪреНрдпрд╛ рдореГрддреНрдпреВрдирдВрддрд░, рд╕рддреНрддреЗрдЪреА рд░рд┐рдХрд╛рдореА рдЬрд╛рдЧрд╛ рднрд░реВрди рдХрд╛рдврдгреНрдпрд╛рд╕рд╛рдареА рддреНрдпрд╛рдВрдиреА 'рдмрд╛рд░рднрд╛рдИ рдордВрдбрд│' рддрдпрд╛рд░ рдХреЗрд▓реЗ... ``` --- ## ЁЯзк How to Use ### In Python: ```python from unsloth import FastLanguageModel import torch model, tokenizer = FastLanguageModel.from_pretrained( model_name = "Devavrat28/peshwai-historian-ai", # replace with your HF username max_seq_length = 4096, dtype = torch.float16, load_in_4bit = True ) FastLanguageModel.for_inference(model) prompt = "рд╡рд┐рд╖рдп: рдорд╛рдзрд╡рд░рд╛рд╡ рдкреЗрд╢рд╡реНрдпрд╛рдВрдЪрд╛ рдЖрд░реЛрдЧреНрдпрд╛рд╡рд░ рдЭрд╛рд▓реЗрд▓рд╛ рдкрд░рд┐рдгрд╛рдо\nрд╕рд╡рд┐рд╕реНрддрд░ рдорд╛рд╣рд┐рддреА:" inputs = tokenizer([prompt], return_tensors="pt").to("cuda") outputs = model.generate(**inputs, max_new_tokens=512) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` --- ## ЁЯТб Fine-Tuning Details | Setting | Value | |----------------------|--------------------------------| | Base Model | Gemma / LLaMA / Open LLM | | Fine-tuning Method | Supervised Fine-Tuning (SFT) | | Framework | [Unsloth](https://github.com/unslothai/unsloth) + ЁЯдЧ TRL | | Dataset | Marathi historical text (~50K tokens) | | Technique | Continued pretraining + SFT | | Language | рдорд░рд╛рдареА (Marathi) | --- ## ЁЯЫая╕П Intended Use - ЁЯУЪ **Educational apps** in schools or colleges - ЁЯПЫя╕П Museums or digital history archives - ЁЯЧгя╕П Voice-based Marathi chatbots for local history - ЁЯУЦ Research tools for historians and scholars --- ## ЁЯУЬ Citation If you use this model in research or production, please consider citing: ``` @misc{peshwaiHistorian2024, title={Peshwai Historian AI: A Marathi LLM for Regional Heritage}, author={Devavrat Samak}, year={2024}, howpublished={\url{https://huggingface.co/devavrat/peshwai-historian-ai}}, } ``` --- ## тЭдя╕П Credits Developed by [Devavrat Samak](https://huggingface.co/devavrat) Inspired by the rich cultural heritage of Pune and the legacy of the Peshwas. --- ## ЁЯУм Feedback / Contributions I welcome pull requests, prompts, dataset contributions, and collaborations. Reach out via Hugging Face or GitHub.