Downloads · 30 days
18
3% of all-time downloads
Larsson31/mizo-english-nllb-lora
mizo-english-nllb-lora is a translation model from Larsson31. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as apache-2.0.
An optimized, parameter-efficient LoRA adapter for bidirectional Mizo (Lushai, lusLatn) ↔ English (engLatn) Machine Translation, fine-tuned on Meta's facebook/nllb-200-distilled-600M foundation model.
Downloads · 30 days
18
3% of all-time downloads
All-time downloads
648
Public
Repo size
22.7 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 97%
From the Hugging Face model README
An optimized, parameter-efficient LoRA adapter for bidirectional Mizo (Lushai, lus_Latn) ↔ English (eng_Latn) Machine Translation, fine-tuned on Meta's facebook/nllb-200-distilled-600M foundation model.
facebook/nllb-200-distilled-600M (615M parameters)q_proj, k_proj, v_proj, out_proj, fc1, fc2embed_tokens, lm_head (Full embedding adaptation)This model incorporates a custom Mizo morphology-aware tokenizer (mizo-tokenizer-32k) featuring:
mizo_morph_bpe.model).mizo_morphology.py).ṭ, â, ê and unaccented standard QWERTY ASCII inputs).import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from peft import PeftModel
BASE_MODEL = "facebook/nllb-200-distilled-600M"
ADAPTER_REPO = "Larsson31/mizo-english-nllb-lora"
# 1. Load Base Model & Tokenizer
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, src_lang="lus_Latn")
base_model = AutoModelForSeq2SeqLM.from_pretrained(BASE_MODEL, torch_dtype=torch.float16)
# 2. Attach Trained LoRA Adapter
model = PeftModel.from_pretrained(base_model, ADAPTER_REPO).to("cuda" if torch.cuda.is_available() else "cpu")
model.eval()
# 3. Translate Mizo -> English
input_text = "Ka lawm e, engtin nge ka puih theih ang che?"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
forced_bos_token_id = tokenizer.convert_tokens_to_ids("eng_Latn")
with torch.no_grad():
generated_tokens = model.generate(
**inputs,
forced_bos_token_id=forced_bos_token_id,
max_length=128,
num_beams=4
)
print("Translation:", tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0])
Trained on the Larsson31/mizo-corpus, comprising 320,000+ parallel pairs filtered with reference-free neural Quality Estimation (Unbabel COMET-QE).
Curated and developed by LarssonCodes (Lushai Technologies & Consulting Pvt. Ltd. / C-DAC).