/ Модель

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

Лицензия
Gemma
Базовая модель
gemma-4-E2B-it
Библиотека
transformers
Опубликована
28 окт 2026

gemma4-e2b-vaani-t2t

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

Дообученная Gemma 4 E2B IT для перевода между английским и 22 языками Индии.

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

Бенчмарки

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

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

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

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

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

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

gemma4-e2b-vaani-t2t — полное дообучение Gemma 4 E2B IT, подготовленное авторами репозитория ARTPARK-IISc для перевода между английским и 22 языками Индии в 44 направлениях. Модель основана на google/gemma-4-E2B-it и загружается через Transformers; в репозитории хранятся веса Safetensors. При оценке на IN22-Gen авторы сообщают средний chrF++ 50,86 по 44 направлениям против 24,96 у исходной модели.

Модель предназначена для перевода на уровне предложений: пары обучения всегда включали английский, поэтому перевод между индийскими языками без английского не поддерживается. Обучение использовало предложения длиной до 512 токенов; для длинных текстов рекомендуется разделение на фрагменты. Для кашмири поддерживается арабское письмо, для манипури — письмо мейтей, для синдхи — деванагари. Мультимодальные компоненты Gemma 4 сохранены, но зрительные и аудиобашни заморожены и для перевода не обучались. При переводе на английский модель может перефразировать исходное предложение, что снижает оценку chrF++. Лицензия — Gemma.

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

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

Ограничения

Обучена только для переводов с английским на одной стороне; индийские языки между собой не поддерживаются. Модель обучалась на предложениях до 512 токенов, а перевод на английский иногда перефразирует оригинал; также поддерживаются только указанные в карточке письменности для кашмири, манипури и синдхи.

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

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

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

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

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

Открыть на Hugging Face

gemma4-e2b-vaani-t2t

A full fine-tune of google/gemma-4-E2B-it for translation between English and the 22 scheduled languages of India — 44 directions in a single model.

Scores 50.86 chrF++ averaged over the 44 directions of IN22-Gen, compared to Gemma4-E2B-IT's score of 24.96.

Layout

infer.py             inference (source language, target language, text -- that's it)
prompt_contract.py   the exact prompt and trained language set, no dependencies
README.md
config.json, model.safetensors, tokenizer.json, ...   weights, config and tokenizer

Quick start

Same transformers usage as the base model (google/gemma-4-E2B-it) — just this repo's id, plus the one fixed prompt below.

from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "ARTPARK-IISc/gemma4-e2b-vaani-t2t"

processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID,
    dtype="auto",
    device_map="auto",
    attn_implementation="eager",  # matches training -- see below
)

T2T — translate text between English and any of the 22 languages:

messages = [{"role": "user", "content": [
    {"type": "text", "text": "Translate the following text from Hindi to English.\n\nनमस्ते, आप कैसे हैं?"},
]}]

inputs = processor.apply_chat_template(
    [messages], tokenize=True, return_dict=True, return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

outputs = model.generate(**inputs, max_new_tokens=384, num_beams=5)
response = processor.tokenizer.decode(outputs[0][input_len:], skip_special_tokens=True)
print(response)

A ready-made infer.py/prompt_contract.py pair is also included, wrapping the above into an Infer class (load once, call .t2t() repeatedly) plus a CLI:

from infer import Infer
m = Infer()
m.t2t("The weather is nice today.", "English", "Hindi")
python infer.py --src-lang English --tgt-lang Hindi --text "The weather is nice today."

Languages may be given as hi, hin_Deva or Hindi. English must be on one side — Indic-to-Indic was never trained. Needs ~11 GB of VRAM in bf16.

The prompt is part of the model

The instruction this checkpoint was trained on, verbatim:

Translate the following text from {source language} to {target language}.

{text}

Language names are the English spellings in prompt_contract.py (Hindi, Santali, Konkani, …) — two newlines between instruction and text, and the period after the target language is part of the string.

No system turn, no few-shot examples, no task prefix.

prompt_contract.py holds all of this in importable form — T2T_PROMPT, LANG_NAMES, build_prompt_t2t(), and the fully rendered strings as RENDERED_INFERENCE / RENDERED_TRAINING:

from prompt_contract import build_prompt_t2t

build_prompt_t2t("en", "hi", "The weather is nice today.")
# 'Translate the following text from English to Hindi.\n\nThe weather is nice today.'

Run python prompt_contract.py to print the contract with no model loaded.

Supported languages

Assamese as, Bengali bn, Bodo brx, Dogri doi, Gujarati gu, Hindi hi, Kannada kn, Kashmiri kas (Arabic script), Konkani gom, Maithili mai, Malayalam ml, Manipuri mni (Meitei script), Marathi mr, Nepali ne, Odia or, Punjabi pa, Sanskrit sa, Santali sat (Ol Chiki), Sindhi sd (Devanagari), Tamil ta, Telugu te, Urdu ur — each paired with English en.

Both FLORES codes (hin_Deva) and short codes (hi) are accepted.

Results

chrF++ on IN22-Gen (1024 sentences per direction), scored with the IndicEvaluator harness — IndicNLP normalisation plus trivial_tokenize on both hypotheses and references, then sacrebleu CHRF with word_order=2. Beam 5.

en→X (22)X→en (22)all 44
google/gemma-4-E2B-it (untuned)18.3531.5624.96
gemma4-e2b-vaani-t2t47.5454.1850.86
gain+29.19+22.62+25.90

Four of the 22 target languages — Dogri, Bodo, Manipuri, Santali — score close to zero before fine-tuning, meaning the base model cannot write them. Those are the languages this model exists for.

One caveat, in the model's own terms. X→en gains less than en→X (+22.62 against +29.19) despite starting from a much stronger base (31.56 against 18.35). The failure mode is paraphrase rather than translation: the English output is fluent and accurate but restructures the sentence, which chrF++ penalises heavily. It is not a formatting or prompt problem — Dogri, on identical data, gains far more on en→doi than on doi→en, and no prompt variant improved it.

Per language, both directions

languagecodeen→X baseen→XX→en baseX→en
Assameseasm_Beng21.7145.538.1156.5
Bengaliben_Beng24.8144.034.4858.4
Bodobrx_Deva1.2551.119.2950.3
Dogridoi_Deva3.0957.829.2554.2
Gujaratiguj_Gujr27.4449.137.8460.6
Hindihin_Deva30.3354.135.0861.1
Kannadakan_Knda26.5648.038.1657.9
Kashmirikas_Arab6.5541.425.3648.8
Konkanigom_Deva12.9645.726.0845.4
Maithilimai_Deva15.1249.332.8554.1
Malayalammal_Mlym26.6747.435.0355.4
Manipurimni_Mtei0.8848.013.5545.1
Marathimar_Deva26.5046.834.9858.3
Nepalinpi_Deva25.2548.435.4159.8
Odiaory_Orya24.4345.742.0257.0
Punjabipan_Guru25.5545.936.4457.9
Sanskritsan_Deva14.7540.725.1445.2
Santalisat_Olck0.5738.722.2942.3
Sindhisnd_Deva1.1138.425.8248.9
Tamiltam_Taml28.9747.533.4854.2
Telugutel_Telu27.8648.836.2258.3
Urduurd_Arab31.3963.637.4062.2
mean (22)18.3547.5431.5654.18

Limitations

  • English-pivot only. Every training pair had English on one side. Indic↔Indic is untrained; translate.py rejects it rather than producing something plausible and wrong.
  • Sentence-level. Trained on sentence pairs at 512 tokens. Longer passages should be split; document-level coherence was never trained.
  • Script-specific. Kashmiri in Arabic script, Manipuri in Meitei, Sindhi in Devanagari. The alternative scripts (kas_Deva, mni_Beng, snd_Arab) were excluded from training and are not supported.
  • X→en paraphrases, as described above.
  • Unused modalities. The checkpoint keeps Gemma-4's vision and audio towers (0.48B of 5.10B parameters), frozen throughout training and untouched by fine-tuning. They are dead weight for translation but are retained so the checkpoint loads with the stock Gemma4ForConditionalGeneration class.

License

Derived from google/gemma-4-E2B-it and therefore governed by the Gemma Terms of Use; the prohibited-use policy applies to this model as it does to the base. Training data is BPCC from AI4Bharat — check its own licence terms for your use case.

Acknowledgements

Trained with compute awarded by the Gemma Academic Program, supported by google.org. We thank Google for the award.

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

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

GPU в ailist

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

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

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
2138b0f

0 моделей