Instructions to use adivaanihf/MahaVani with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use adivaanihf/MahaVani with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
MahaVani
MahaVani is a professionally organized collection of 36 PEFT/LoRA translation adapters for 9 Indian tribal languages across Hindi and English directions.
The companion complete-model repository is MahaVani_Purna.
π Deployment & Serving
Ready-to-use deployment guide and code are in deployment/:
- deployment/DEPLOYMENT.md β full hosting guide (prompt format, full-vs-adapter hosting, FastAPI, Modal serverless, vLLM/TGI, OpenAI-compatible integration, quantization).
- deployment/translator.py β reusable
Translator(loads full models or base + hot-swappable LoRA adapters; greedy decoding; batching). - deployment/api_service.py β FastAPI REST service exposing all 36 directions.
- deployment/modal_service.py β serverless GPU HTTPS endpoint (scales to zero).
Prompt: system = "Translate the text below to {TARGET_LANGUAGE}." + user = <source text>. For β tribal directions, {TARGET_LANGUAGE} is the tribal language name (e.g. "Bhili", "Santhali", "Betta Kurumba"). Decode greedily (do_sample=False) for deterministic translation.
Structure
MahaVani/
βββ metrics.csv
βββ metrics.json
βββ model_index.json
βββ <tribal-language>/<source>_to_<target>/
β βββ README.md
β βββ adapter/
β βββ metrics/
β βββ logs/
β βββ training_state/
βββ source/
Architecture and Method
- Adaptation method: LoRA / PEFT adapters
- Precision: bf16
- Training: 2 epochs per direction
- Objective: target-only translation loss
- Evaluation: held-out test split; no test leakage
Metrics
| # | Direction | Language | chrF++ | BLEU | Test rows |
|---|---|---|---|---|---|
| 0 | bettakuruba_to_hindi | bettakuruba | 59.35 | 42.13 | 423 |
| 1 | hindi_to_bettakuruba | bettakuruba | 57.24 | 23.83 | 423 |
| 2 | bettakuruba_to_english | bettakuruba | 69.80 | 50.20 | 419 |
| 3 | english_to_bettakuruba | bettakuruba | 69.44 | 37.72 | 419 |
| 4 | bhili_to_hindi | bhili | 75.14 | 60.81 | 2000 |
| 5 | hindi_to_bhili | bhili | 51.77 | 25.52 | 2000 |
| 6 | bhili_to_english | bhili | 48.36 | 21.23 | 2000 |
| 7 | english_to_bhili | bhili | 36.36 | 13.50 | 2000 |
| 8 | garo_to_hindi | garo | 55.90 | 36.51 | 2000 |
| 9 | hindi_to_garo | garo | 46.96 | 17.04 | 2000 |
| 10 | garo_to_english | garo | 68.08 | 54.84 | 2000 |
| 11 | english_to_garo | garo | 50.73 | 21.25 | 2000 |
| 12 | gondi_to_hindi | gondi | 68.20 | 53.01 | 2000 |
| 13 | hindi_to_gondi | gondi | 47.80 | 22.97 | 2000 |
| 14 | gondi_to_english | gondi | 50.01 | 24.99 | 2000 |
| 15 | english_to_gondi | gondi | 37.10 | 14.33 | 2000 |
| 16 | kokborok_to_hindi | kokborok | 53.51 | 34.12 | 829 |
| 17 | hindi_to_kokborok | kokborok | 51.46 | 21.09 | 829 |
| 18 | kokborok_to_english | kokborok | 67.53 | 56.37 | 797 |
| 19 | english_to_kokborok | kokborok | 57.59 | 26.48 | 797 |
| 20 | koya_to_hindi | koya | 43.53 | 23.24 | 271 |
| 21 | hindi_to_koya | koya | 31.93 | 4.82 | 271 |
| 22 | koya_to_english | koya | 54.87 | 38.81 | 272 |
| 23 | english_to_koya | koya | 33.50 | 6.00 | 272 |
| 24 | kui_to_hindi | kui | 36.23 | 14.25 | 1843 |
| 25 | hindi_to_kui | kui | 31.35 | 4.67 | 1843 |
| 26 | kui_to_english | kui | 40.23 | 15.68 | 1843 |
| 27 | english_to_kui | kui | 30.01 | 4.22 | 1843 |
| 28 | mundari_to_hindi | mundari | 72.82 | 59.85 | 2000 |
| 29 | hindi_to_mundari | mundari | 49.95 | 24.13 | 2000 |
| 30 | mundari_to_english | mundari | 36.44 | 16.63 | 2000 |
| 31 | english_to_mundari | mundari | 24.98 | 7.04 | 2000 |
| 32 | santhali_to_hindi | santhali | 71.94 | 57.34 | 2000 |
| 33 | hindi_to_santhali | santhali | 73.04 | 56.51 | 2000 |
| 34 | santhali_to_english | santhali | 53.21 | 27.26 | 2000 |
| 35 | english_to_santhali | santhali | 59.07 | 42.63 | 2000 |
Load an adapter
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "sarvamai/sarvam-translate"
repo_id = "adivaanihf/MahaVani"
subfolder = "bhili/bhili_to_hindi/adapter"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, repo_id, subfolder=subfolder)
model.eval()
Continue fine-tuning
Use the selected direction adapter/ folder as the starting PEFT checkpoint. Keep the same base model, tokenizer, prompt format, and target-only loss masking. See each direction's training_state/ and metrics/ folders.
Limitations
Metrics are automatic MT metrics; human evaluation is recommended before production use. Raw training data is not included.
- Downloads last month
- -