/ Модель

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

Архитектура
mammoth_modular · dense
Библиотека
transformers
Опубликована
16 окт 2026

big-4p-d-Lenc-Ldec-160k

ПереводТекст → текст

Многоязычная модель Mammoth переводит текст между 37 языками для 313 обученных направлений и дополнительных ненулевых пар.

106скачиваний за 30 дней0лайковвеса обновлены16 окт 2026

Бенчмарки

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

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

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

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

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

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

Это многоязычная модель машинного перевода Mammoth, опубликованная пользователем chao0524. Она построена на архитектуре Transformer с 6 слоями энкодера и 6 слоями декодера размерности 1024 и поддерживает 37 языков на входе и выходе. Модель обучена напрямую для 313 направлений перевода; также можно задавать пары языков, которые не обучались совместно, но качество таких переводов различается.

Модель предназначена для перевода предложений и текстовых файлов. Компоненты для языковых эмбеддингов и блоков хранятся отдельно, поэтому для выбранного направления загружаются только необходимые части. Для работы предусмотрены скрипт inference.py и интеграция с Transformers; код модели находится в репозитории и при загрузке используется trust_remote_code=True. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Для языковых пар, не входивших в 313 обученных направлений, качество может различаться, поэтому перевод следует проверять. Для загрузки используется код модели из репозитория с trust_remote_code=True.

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

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

Открыть на Hugging Face

Mammoth Multilingual Translation Model

A multilingual transformer translation model (6 encoder + 6 decoder layers, dimension 1024) covering 37 source and 37 target languages, trained on 313 translation directions (tasks).

The model is stored as separate components — one per language embedding, per encoder/decoder layer stack, and so on — each stored once even when many directions share it. When you choose a direction, only the components it uses are downloaded and assembled into a model.

Setup

No Mammoth installation is needed. Create an environment and fetch the inference script from this repo:

python -m venv .venv && source .venv/bin/activate
pip install transformers torch huggingface_hub safetensors
hf download chao0524/big-4p-d-Lenc-Ldec-160k inference.py --local-dir .

inference.py downloads the model files it needs on first use: into the Hugging Face cache by default, or into a folder of your choice with --local-dir (see Offline Use).

Translate

# A trained direction
python inference.py --model-dir chao0524/big-4p-d-Lenc-Ldec-160k --task eng-bos --sentences "Helsinki is the capital of Finland."

# A direction that was never trained (zero-shot): combine a source and a target language
python inference.py --model-dir chao0524/big-4p-d-Lenc-Ldec-160k --src bos --tgt bul --input-file input.bos.txt

Options

OptionMeaning
--sentences "..." "..."Sentences to translate (instead of --input-file)
--input-file <path>Text file, one source sentence per line
--output-file <path>Write translations here, one per line (default: print to the terminal)
--device cpu|cuda|mpsWhere to run the model (default: cpu)
--num-beams NBeam size (default: 4)
--max-new-tokens NMaximum output length in tokens (default: 128)
--batch-size NSentences per batch (default: 32)
--local-dir <path>Download the model files into this folder instead of the Hugging Face cache

Choosing a Direction

Trained directions — --task <source>-<target>. These 313 directions were trained directly and are listed in the table below.

Zero-shot directions — --src <source> --tgt <target>. Any source language can be combined with any target language, including pairs that were never trained together (1056 more directions). The source language brings its encoder and the target language its decoder. Quality of untrained pairs varies; check the output before relying on it.

Languages

LanguageAs source: trained targets
bosbos deu eng fra spa
bulbul deu eng fra spa
catcat deu eng fra spa
cesces deu eng fra spa
dandan deu eng fra spa
deuall 37 target languages
elldeu ell eng fra spa
engall 37 target languages
estdeu eng est fra spa
eusdeu eng eus fra spa
findeu eng fin fra spa
fraall 37 target languages
gledeu eng fra gle spa
glgdeu eng fra glg spa
hrvdeu eng fra hrv spa
hundeu eng fra hun spa
isldeu eng fra isl spa
itadeu eng fra ita spa
katdeu eng fra kat spa
lavdeu eng fra lav spa
litdeu eng fra lit spa
mkddeu eng fra mkd spa
mltdeu eng fra mlt spa
nlddeu eng fra nld spa
nnodeu eng fra nno spa
nobdeu eng fra nob spa
poldeu eng fra pol spa
pordeu eng fra por spa
rondeu eng fra ron spa
slkdeu eng fra slk spa
slvdeu eng fra slv spa
spaall 37 target languages
sqideu eng fra spa sqi
srp_Cyrldeu eng fra spa srp_Cyrl
swedeu eng fra spa swe
turdeu eng fra spa tur
ukrdeu eng fra spa ukr

Using the Model from Python

inference.py is also a module (it must be in the current directory or on sys.path):

from inference import load_model, translate

src_tok, tgt_tok, model = load_model("chao0524/big-4p-d-Lenc-Ldec-160k", task="eng-bos")
print(translate(src_tok, tgt_tok, model, ["Helsinki is the capital of Finland."]))

load_model also takes src= / tgt= (and encoder= / decoder=), like the command line. translate() takes num_beams and max_new_tokens. model is a standard transformers model, so model.generate() also works if you need more control.

Offline Use

By default the model files go into the Hugging Face cache, which is hard to browse. Add --local-dir to download them into a folder of your choice instead (only the files needed for that task are downloaded):

python inference.py --model-dir chao0524/big-4p-d-Lenc-Ldec-160k --task eng-bos --local-dir ./eng-bos --input-file in.txt

The folder contains everything needed, including inference.py. On later runs, pass the folder as --model-dir (no internet connection needed):

python ./eng-bos/inference.py --model-dir ./eng-bos --task eng-bos --input-file in.txt

From Python: load_model("chao0524/big-4p-d-Lenc-Ldec-160k", ..., local_dir="./eng-bos"), then load_model("./eng-bos", ...) later.

To download without translating, use the shipped model_downloader.py:

hf download chao0524/big-4p-d-Lenc-Ldec-160k model_downloader.py --local-dir .

# Everything
python model_downloader.py --repo-id chao0524/big-4p-d-Lenc-Ldec-160k --local-dir ./model

# Only the files needed for one task
python model_downloader.py --repo-id chao0524/big-4p-d-Lenc-Ldec-160k --local-dir ./eng-bos --task eng-bos

Notes

  • Mammoth uses a separate vocabulary per language, so each direction has a source tokenizer (for the input) and a target tokenizer (for the output). inference.py and load_model() pick the right pair for you.
  • The model code is shipped in this repo (modeling_mammoth.py, native_transformer.py, ...), which is why loading uses trust_remote_code=True.
  • Trained with MAMMOTH.

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

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

GPU в ailist

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

Нельзя запустить

Архитектура mammoth_modular неизвестна transformers в образе рантайма.

Ревизия весов
5e928b1

0 моделей