Downloads · 30 days
18
2% of all-time downloads
panagoa/nllb-200-distilled-600M-kbd-v0.1
nllb-200-distilled-600M-kbd-v0.1 is a translation model from panagoa. Use it when you need text moved from one language to another. The card lists the license as cc-by-nc-4.0.
- Model Name: nllb-200-distilled-600M-kbd-v0.1 - Base Model: NLLB-200 Distilled 600M - Model Type: Translation - Language(s): Kabardian and others from NLLB-200 (200 languages) - Parameters: 600 million (distilled fro…
Downloads · 30 days
18
2% of all-time downloads
All-time downloads
749
Public
Parameters
630M
2.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 98%
From the Hugging Face model README
This model is a fine-tuned version of the NLLB-200 Distilled 600M model, specifically optimized for Kabardian language translation. Unlike the larger 1.3B parameter models in this collection, this distilled variant offers a more efficient alternative with approximately half the parameters. Knowledge distillation techniques have been used to preserve translation quality while significantly reducing model size, making it more suitable for deployment in resource-constrained environments or applications requiring faster inference.
This model has been fine-tuned on specialized Kabardian language datasets, building upon the original NLLB-200 Distilled 600M model. The distillation process in the base model likely used the larger NLLB models as teachers, transferring knowledge while reducing parameter count. The fine-tuning process for Kabardian language has been optimized to maintain translation quality despite the reduced model size.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "panagoa/nllb-200-distilled-600M-kbd-v0.1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
def translate(text, src_lang='eng_Latn', tgt_lang='kbd_Cyrl', a=16, b=1.5, max_input_length=64, **kwargs):
tokenizer.src_lang = src_lang
tokenizer.tgt_lang = tgt_lang
inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True, max_length=max_input_length)
result = model.generate(
**inputs.to(model.device),
forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),
max_new_tokens=int(a + b * inputs.input_ids.shape[1]),
**{
'num_beams': 4,
'temperature': 0.2,
'top_p': 0.9,
'length_penalty': 1.1,
'repetition_penalty': 1.2,
'do_sample': True,
'early_stopping': True
},
**kwargs
)
return tokenizer.batch_decode(result, skip_special_tokens=True)
translate('A big car needs a lot of fuel.')
['Машинэшхуэм бензин куэд хуейщ.']
As noted for the base NLLB-200 model and applicable to this distilled version:
This model is part of panagoa's collection of NLLB models fine-tuned for Kabardian language translation. It represents an efficiency-focused alternative to the larger 1.3B parameter models, offering a different balance point in the tradeoff between model size and translation quality.