/ Модель

Характеристики

Контекст
1 024 токена
Параметры
464 млн
Лицензия
CC BY-NC 4.0
Архитектура
m2m_100 · dense
Базовая модель
nllb-200-distilled-600M
Библиотека
transformers
Опубликована
28 ноя 2025

AfriNLLB-12enc-12dec-full-ft-kd

ПереводТекст → текст3 профессии

Дообученная многоязычная модель для перевода между английским, французским и африканскими языками.

234скачиваний за 30 дней1лайквеса обновлены6 мар 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

AfriNLLB-12enc-12dec-full-ft-kd — модель машинного перевода из серии AfriNLLB, разработанной для африканских языков. Это дообученная на данных AfriNLLB-train и AfriNLLB-train-distilled версия facebook/nllb-200-distilled-600M; при обучении также применялась дистилляция на синтетических переводах, созданных более крупной моделью NLLB-200 3.3B. Модель не подвергалась прореживанию и содержит около 463,7 млн параметров.

Архитектура M2M100ForConditionalGeneration включает 12 слоёв кодировщика и 12 слоёв декодировщика. Модель поддерживает 15 языковых пар и 30 направлений перевода, включая переводы между английским и африканскими языками, а также между французским и лингала или волоф. Среди языков — суахили, хауса, йоруба, амхарский, сомали, зулу, лингала, африкаанс, волоф, египетский арабский, арабский, французский, португальский и испанский. Контекст составляет до 1024 токенов.

Модель предназначена для перевода предложений и показала улучшение метрик качества относительно базовой NLLB-200 600M на приведённых в карточке тестах. Доступны веса в safetensors; для инференса карточка рекомендует CTranslate2, а Transformers подходит также для дообучения. Лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но запрещает коммерческое применение.

Сценарии применения

  • перевод с английского на суахили и обратно
  • перевод текстов с английского на хауса, йоруба или амхарский
  • перевод между французским и лингала
  • перевод между французским и волоф
  • перевод предложений на зулу, сомали, африкаанс или египетский арабский

Ограничения

Модель обучалась и оценивалась на ограниченном наборе языковых пар, поэтому качество для других языков и направлений не подтверждено. Лицензия CC BY-NC 4.0 запрещает коммерческое использование.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

AfriNLLB

AfriNLLB is a series of efficient multilingual open-source models for African languages.

Model Description

AfriNLLB-12enc-12dec-full-ft-kd is a fully fine-tuned version of NLLB-200 600M on both the AfriNLLB-train and AfriNLLB-train-distilled datasets, without any pruning.

Knowledge distillation: To improve the quality of our models, we employ sequence-level knowledge distillation, where the student model is fine-tuned on a combination of authentic data and synthetic data generated by the teacher model for the same training dataset. In this case, the teacher model is the NLLB-200 3.3B baseline, while the students are the NLLB-200 600M baseline and the the pruned models derived from our fine-tuned version. After generating the data, we filter it by removing duplicates (exact matches in the target side of the authentic data), and we follow a filtering pipeline similar to what we use for processing the original training data.

Supported Languages

AfriNLLB supports 15 language pairs (30 translation directions), including Swahili, Hausa, Yoruba, Amharic, Somali, Zulu, Lingala, Afrikaans, Wolof, and Egyptian Arabic, as well as other African Union official languages such as Arabic (MSA), French, Portuguese, and Spanish. Our training data covers bidirectional translation between English and 13 languages, and between French and two languages (Lingala and Wolof).

Model Details

  • Model type: Translation
  • Base model: facebook/nllb-200-distilled-600M
  • Training data: AfriNLLB-train + AfriNLLB-train-distilled
  • Test data: facebook/flores
  • Architecture: 12 encoder layers, 12 decoder layers
  • Pruning: No

Evaluation Results

We benchmark AfriNLLB models, with diverse iterative layer pruning configurations, against the NLLB baseline across 13 language pairs to/from English and 2 pairs to/from French. Results illustrate the trade-off between translation quality (BLEU, chrF++, COMET) and inference efficiency (output throughput tokens/second and time) at various encoder-decoder layer depths, with and without float16 (FP16) quantization. The current model is marked with 🟣 for the non-quantized version and 🟢 for the float16-quantized version.

LangModelEncDecParamsV.QuantBLEU ↑chrF++ ↑COMET ↑Throughput ↑Time ↓
xx-enNLLB1212600Mn/a33.8156.2271.111469.9621.02
FP1633.8056.2271.132834.6910.92
AfriNLLB1212600M🟣n/a35.1557.6171.871530.9420.39
🟢FP1635.1057.6171.872808.9011.15
AfriNLLB128548Mn/a34.0156.9871.201807.6117.38
FP1634.0556.9971.193513.328.96
AfriNLLB126514Mn/a33.3556.4870.792028.1815.41
FP1633.3256.4570.794000.257.82
AfriNLLB124481Mn/a32.0355.6269.712257.0313.77
FP1632.0155.6069.714589.426.79
AfriNLLB88498Mn/a30.8954.3268.081852.1317.05
FP1630.8654.3068.083550.508.91
en-xxNLLB1212600Mn/a22.7047.8969.361530.1028.09
FP1622.6847.8869.382898.3815.33
AfriNLLB1212600M🟣n/a24.2849.9770.911610.2326.98
🟢FP1624.1449.8470.902811.3418.82
AfriNLLB128548Mn/a24.1750.0570.371946.6122.51
FP1624.1550.0670.413732.7211.98
AfriNLLB126514Mn/a23.4849.3468.982265.8718.50
FP1623.4949.3569.004428.689.65
AfriNLLB124481Mn/a21.7747.8065.682489.3517.31
FP1621.7747.8165.684954.629.09
AfriNLLB88498Mn/a23.5949.6469.902015.5321.34
FP1623.5849.6369.883851.1311.34
xx-frNLLB1212600Mn/a16.4138.8317.341475.4826.46
FP1616.3338.8317.232850.6613.71
AfriNLLB1212600M🟣n/a17.9140.4518.471524.3226.12
🟢FP1617.8340.4218.372749.4514.68
AfriNLLB128548Mn/a17.4340.2114.521845.0921.61
FP1617.3840.1814.533569.2311.17
AfriNLLB126514Mn/a16.5239.4411.782044.2719.21
FP1616.5439.4211.683953.519.92
AfriNLLB124481Mn/a14.9638.215.672340.9916.77
FP1614.9038.175.714766.128.24
AfriNLLB88498Mn/a14.4237.053.141866.2621.84
FP1614.3436.973.143448.5111.83
fr-xxNLLB1212600Mn/a9.4433.4219.251047.1849.92
FP169.5233.4019.381920.4129.05
AfriNLLB1212600M🟣n/a10.9835.6821.331081.8451.56
🟢FP1610.4835.0521.491700.2551.31
AfriNLLB128548Mn/a10.2035.2120.041261.6649.91
FP1610.1135.1320.032313.8531.15
AfriNLLB126514Mn/a10.0735.1419.831416.3330.89
FP169.9935.0819.782465.6018.68
AfriNLLB124481Mn/a7.5732.4214.161207.0638.75
FP167.5732.3814.292069.5223.25
AfriNLLB88498Mn/a9.7535.2320.051222.8345.33
FP169.8435.3120.112186.7325.97

Translation performance (chrF++) from English/French to African languages

Translation performance (chrF++) from African languages to English/French

How to Use

This model can be used for inference with either CTranslate2 or Transformers. The CTranslate2 models are faster and recommended for production. It has two versions, one with float16 quantization ("ct2-fp16") and one without quantization ("ct2"). You can also try the Transformers version, but it is better suited for fine-tuning For detailed code, please refer to the AfriNLLB repositories on GitHub.

pip3 install ctranslate2 sentencepiece transformers huggingface_hub

CTranslate2 version

import os
import ctranslate2
import sentencepiece as spm
from huggingface_hub import snapshot_download, hf_hub_download

src_lang = "eng_Latn"
tgt_lang = "amh_Ethi"

source_sentences = [
    "How are you doing today?",
    "Africa has a diverse history and beautiful nature.",
]

# Download the CTranslate2 model
model_name = "AfriNLP/AfriNLLB-12enc-12dec-full-ft-kd"

# Use "ct2" for the non-quantized version 
# or "ct2-fp16" for the float16 quantized version
ct2_dir = "ct2-fp16"

model_dir = snapshot_download(
    repo_id=model_name,
    allow_patterns=[f"{ct2_dir}/*"]
)
ct2_model_path = os.path.join(model_dir, ct2_dir)

# Download the SentencePiece BPE model
spm_name = "sentencepiece.bpe.model"
spm_path = os.path.join(ct2_model_path, "sentencepiece.bpe.model")
if not os.path.exists(spm_path):
    print("SP model cannot be found locally. Downloading from the baseline...")
    hf_hub_download(
        repo_id="facebook/nllb-200-distilled-600M", 
        filename=spm_name, 
        local_dir=ct2_model_path
        )

sp = spm.SentencePieceProcessor()
sp.load(spm_path)
translator = ctranslate2.Translator(ct2_model_path, device="cuda")

print(f"Translating to {tgt_lang}..\n")

# Tokenize the source texts
encoded_source = sp.encode_as_pieces(source_sentences)
encoded_source = [[src_lang] + s + ["</s>"] for s in encoded_source]

# Translate
results = translator.translate_batch(
    encoded_source,
    target_prefix = [[tgt_lang]] * len(encoded_source),
    beam_size=5,
    max_decoding_length=256,
)

# Decode the outputs and remove the language tag
translations = []
for res in results:
    tokens = res.hypotheses[0]
    if tokens and tokens[0] == tgt_lang:
       tokens = tokens[1:]
    text = sp.decode_pieces(tokens)
    translations.append(text)

for orig, trans in zip(source_sentences, translations):
    print(f"Source ({src_lang}): {orig}\nTarget ({tgt_lang}): {trans}\n")

Transformers version

import torch
from transformers import AutoModelForSeq2SeqLM, NllbTokenizerFast

src_lang = "eng_Latn"
tgt_lang = "amh_Ethi"

source_sentences = [
    "How are you doing today?",
    "Africa has a diverse history and beautiful nature.",
]

# Load an AfriNLLB model
model_name = "AfriNLP/AfriNLLB-12enc-12dec-full-ft-kd"
model = AutoModelForSeq2SeqLM.from_pretrained(
    model_name, 
    device_map="auto",
    )

# Load the NLLB tokenizer
base_model_name = "facebook/nllb-200-distilled-600M"
tokenizer = NllbTokenizerFast.from_pretrained(
    base_model_name,
    src_lang=src_lang,
    )

print(f"\nUsing device: {model.device}")
print(f"Translating to {tgt_lang}..\n")

# Tokenize the source sentences
inputs = tokenizer(
    source_sentences, 
    return_tensors="pt", 
    padding=True).to(model.device)

forced_bos_token_id = tokenizer.convert_tokens_to_ids(tgt_lang)

# Translate
with torch.inference_mode():
    translated_tokens = model.generate(
        **inputs,
        forced_bos_token_id=forced_bos_token_id,
        max_length=256,
        num_beams=5,
        use_cache=True,
    )

# Decode the outputs and remove the language tag
translations = tokenizer.batch_decode(
    translated_tokens, 
    skip_special_tokens=True
    )

for orig, trans in zip(source_sentences, translations):
    print(f"Source ({src_lang}): {orig}\nTarget ({tgt_lang}): {trans}\n")

Citation

If you use any of AfriNLLB models, datasets, or approaches, please cite the following paper:

@inproceedings{moslem-etal-2026-afrinllb,
    title = "{A}fri{NLLB}: Efficient Translation Models for African Languages",
    author = "Moslem, Yasmin  and
      Wassie, Aman Kassahun  and
      Gizachew, Amanuel",
    booktitle = "Proceedings of the Seventh Workshop on African Natural Language Processing (AfricaNLP)",
    month = mar,
    year = "2026",
    address = "Rabat, Morocco",
    publisher = "Association for Computational Linguistics",
    url = "https://openreview.net/forum?id=hVJZNUZBur",
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
M2M100ForConditionalGeneration
Ревизия весов
eb74b6e

0 моделей