/ Модель

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

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

AfriNLLB-12enc-12dec-full-ft

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

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

254скачиваний за 30 дней3лайкавеса обновлены27 фев 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

AfriNLP/AfriNLLB-12enc-12dec-full-ft — дообученная командой AfriNLP модель машинного перевода на базе facebook/nllb-200-distilled-600M. Она обучена на наборе AfriNLP/AfriNLLB-train и поддерживает 15 языковых пар, то есть 30 направлений перевода. Среди перечисленных языков — суахили, хауса, йоруба, амхарский, сомали, зулу, лингала, африкаанс, волоф, египетский арабский, а также арабский, английский, французский, португальский и испанский.

Модель использует архитектуру M2M100 с 12 слоями энкодера и 12 слоями декодера, содержит 463,7 млн параметров и имеет контекст до 1024 токенов. Для инференса доступны Transformers и CTranslate2; авторы рекомендуют CTranslate2 для более быстрого применения. Лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но не коммерческое применение.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

AfriNLLB

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

Model Description

AfriNLP/AfriNLLB-12enc-12dec-full-ft is a fully fine-tuned version of NLLB-200 600M on the AfriNLP/AfriNLLB-train dataset, without any pruning.

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: AfriNLP/AfriNLLB-train
  • Test data: facebook/flores
  • Architecture: 12 encoder layers, 12 decoder layers
  • Pruning: No

Evaluation Results

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"

# 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"
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 = jul,
    year = "2026",
    address = "Rabat, Morocco",
    publisher = "Association for Computational Linguistics",
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей