slone/nllb-200-10M-sample
Viewer • Updated • 9.98M • 43 • 13
How to use slone/nllb-pruned-6L-512d-finetuned with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("translation", model="slone/nllb-pruned-6L-512d-finetuned") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("slone/nllb-pruned-6L-512d-finetuned")
model = AutoModelForMultimodalLM.from_pretrained("slone/nllb-pruned-6L-512d-finetuned")It is a truncated version of NLLB-200-600M model (6 layers instead of 12, 512 hidden dimensions instead of 1024) with 175M parameters (131M of which are token embeddings).
This model was fine-tuned on the slone/nllb-200-10M-sample subset of the NLLB dataset with 175 languages, using only the samples with BLASER score above 3.5.
Because of its small size, it is really bad at translation, but can serve as a base model for further fine-tuning for a small number of languages. It is recommended to prune the vocabulary of this model before fine-tuning, to preserve only the tokens used with the intended languages.