/ Модель

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

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

Sunflower-Gemma4-E2B

Изображение и текст → текст5 профессий

Мультимодальная модель Sunbird AI для перевода, транскрибации речи и диалогов на африканских языках с текстовым выводом.

169скачиваний за 30 дней7лайковвеса обновлены27 июл 2026

Бенчмарки

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

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

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

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

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

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

Sunflower-Gemma4-E2B — мультимодальная модель Sunbird AI, дообученная на базе Google Gemma 4 E2B IT для работы с текстом и речью на африканских языках. Она принимает текст, изображения и аудио длительностью до 30 секунд с частотой 16 кГц и выдаёт текст. Основные сценарии — перевод между английским и поддерживаемыми языками, транскрибация речи, выполнение инструкций и многоходовый диалог.

Модель обучалась на многоязычных текстах и параллельных корпусах, примерах транскрибации, а затем проходила дообучение с инструкциями и постобучение GRPO. Карточка оценивает перевод для 69 языков и распознавание речи для 51 языка; качество заметно различается между языками и зависит от объёма обучающих данных. Для транскрибации нужно явно указывать язык речи, а аудио подавать как монофонический сигнал длительностью не более 30 секунд.

Это предварительная версия: веса и качество результатов могут измениться до стабильного релиза, поэтому карточка не рекомендует закреплять её в производственных системах. Переводы и транскрипции могут содержать уверенно сформулированные ошибки; результаты для языков с малым объёмом данных следует проверять. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Sunflower-Gemma4-E2B

[!WARNING] This is a preview release. The model weights will change between now and the stable release. Benchmark numbers, prompt behaviour, and output quality may all shift. Please don't pin production systems to this checkpoint — treat it as a preview for evaluation and feedback.

Sunflower-Gemma4-E2B is a multimodal adaptation of Google's Gemma 4 E2B IT optimised to understand text and speech across 69 African languages. The model is tuned for text translation, speech transcription, instruction-following, and multi-turn chat. It supports text, image, and audio inputs (up to 30s of 16kHz audio), generating text output.

Try it

▶ Open the Colab Demo Notebook

Supported Languages

Coverage varies considerably by language, roughly tracking the amount of training data available.

Translation & Speech Evaluation Covers: Acholi, Afrikaans, Akan, Alur, Amharic, Bambara, Bari, Bemba, Berber, Chichewa, Dagaare, Dagbani, Dinka, Ewe, French, Fulani, Hausa, Igbo, Ik, Ikposo, Jopadhola, Kabyle, Kakwa, Kalenjin, Kanuri, Karamojong, Kikuyu, Kinyarwanda, Kirundi, Kumam, Kupsabiny, Kwamba, Lango, Lendu, Lingala, Lubwisi, Luganda, Lugbara, Lugungu, Lugwere, Luhya, Lumasaba, Lunyole, Luo, Lusoga, Ma'di, Malagasy, Ndebele, Nigerian Pidgin, Oromo, Pokot, Rukiga, Rukonjo, Runyankole, Runyoro, Ruruuli, Rutooro, Samia, Shona, Somali, Sotho, Swahili, Tswana, Wolof, Xhosa, Yoruba, and Zulu.

Note: A language's presence in this list means it was evaluated; it does not imply equal quality across all languages. See evaluation metrics below for details on performance.

Inference

Sunflower-Gemma4-E2B follows standard Transformers patterns, but expects specific prompt formats for translation and speech transcription. Like Qwen, the base model supports a reasoning phase, but we recommend setting enable_thinking=False for standard translation tasks.

Text Translation

Translation expects a fixed instruction template: Translate from English to {language name}: {text}

messages = [
    {"role": "system", "content": "You are Sunflower, a helpful assistant made by Sunbird AI who knows many African languages."},
    {"role": "user", "content": "Translate from English to Luganda: Where is the nearest hospital?"}
]

Tip: Use do_sample=False (greedy decoding) and temperature=0 for translation tasks.

Audio Transcription

The model was trained with prompts that explicitly name the spoken language. Convert audio to a 16 kHz mono waveform and keep it to 30 seconds or less.

messages = [
    {"role": "system", "content": "You are Sunflower, a helpful assistant made by Sunbird AI who knows many African languages."},
    {
        "role": "user",
        "content": [
            {"type": "audio", "audio": audio_array}, # 16kHz mono numpy array
            {"type": "text", "text": "Please transcribe this Luganda audio."},
        ],
    },
]

vLLM (Text-Only Inference)

vLLM is highly recommended for fast deployments. Because this is a multimodal model, text-only vLLM setup requires disabling vision/audio inputs to save memory.

import os
os.environ["VLLM_ENABLE_V1_MULTIPROCESSING"] = "0"

from vllm import LLM, SamplingParams
from transformers import AutoProcessor

MODEL_ID = "Sunbird/Sunflower-Gemma4-E2B"

llm = LLM(
    MODEL_ID,
    dtype="bfloat16",
    max_model_len=1024,
    limit_mm_per_prompt={"image": 0, "audio": 0}, # Text-only mode
    enforce_eager=True,
)
processor = AutoProcessor.from_pretrained(MODEL_ID)

def make_prompt(text, target_lang):
    messages = [
        {"role": "system", "content": "You are Sunflower, a helpful assistant made by Sunbird AI who knows many African languages."},
        {"role": "user", "content": f"Translate from English to {target_lang}: {text}"}
    ]
    return processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

sampling = SamplingParams(temperature=0.0, max_tokens=256)

examples = [
    ("Good morning, how are you?", "Luganda"),
    ("The children are going to school today.", "Acholi"),
    ("I would like to buy three kilograms of rice.", "Swahili"),
]
outputs = llm.generate([make_prompt(t, l) for t, l in examples], sampling)
for (text, lang), out in zip(examples, outputs):
    print(f"[{lang}] {text}\n     -> {out.outputs[0].text.strip()}\n")

Transformers (Multimodal / Audio)

import torch
import librosa
import numpy as np
from transformers import AutoModelForMultimodalLM, AutoProcessor

MODEL_ID = "Sunbird/Sunflower-Gemma4-E2B"
dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16

processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID, dtype=dtype, device_map="auto", attn_implementation="sdpa"
).eval()

# Load Audio
audio, _ = librosa.load("audio.wav", sr=16_000, mono=True)
audio = np.asarray(audio, dtype=np.float32)
if len(audio) > 480_000:
    raise ValueError("Please provide no more than 30 seconds of audio.")

messages = [
    {"role": "system", "content": "You are Sunflower, a helpful assistant made by Sunbird AI who knows many African languages."},
    {"role": "user", "content": [
        {"type": "audio", "audio": audio},
        {"type": "text", "text": "Please transcribe this Luganda audio."}
    ]}
]
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

inputs = processor(
    text=[prompt], audio=[audio], return_tensors="pt",
    text_kwargs={"padding": False, "truncation": False, "add_special_tokens": False},
    audio_kwargs={"max_length": 480_000}
).to(model.device)
inputs["input_features"] = inputs["input_features"].to(dtype=dtype)

with torch.inference_mode():
    output = model.generate(**inputs, max_new_tokens=256, do_sample=False)

new_tokens = output[0][inputs["input_ids"].shape[-1]:]
raw_response = processor.decode(new_tokens, skip_special_tokens=False)
print(processor.parse_response(raw_response)["content"])

Training

The model was adapted via the following stages:

  1. Continued pretraining on multilingual African-language text (documents, parallel text, transcripts, web, and synthetic text).
  2. Speech SFT on audio-transcription examples.
  3. Mixed text-and-audio SFT on translation, instruction, and speech-transcription tasks.
  4. GRPO post-training to improve translation and general response quality using task-specific reward signals.

Evaluation

Text Translation

Translation quality measured as chrF on the Sunbird/salt69 test split (100 examples per language).

LanguagesDirectionsMacro BLEUMacro chrFMean Length Ratio
6913812.200.34131.06
CodeLanguageEN→X BLEUEN→X chrFX→EN BLEUX→EN chrFMean chrF
afrAfrikaans57.680.774757.860.76490.7698
pcmNigerian Pidgin32.760.643848.270.73060.6872
fraFrench34.080.600840.550.65320.6270
swaSwahili30.770.612638.060.62700.6198
zulZulu19.950.594934.190.58870.5918
nyaChichewa25.380.628831.980.55370.5913
xhoXhosa15.570.559529.890.53570.5476
somSomali15.220.518031.480.56470.5413
mlgMalagasy19.620.545823.640.49070.5182
nblNdebele12.350.510929.580.52390.5174
iboIgbo29.190.527324.540.49130.5093
linLingala23.920.541423.370.46700.5042
kinKinyarwanda17.540.514825.290.49060.5027
sotSotho21.600.507726.180.49500.5013
hauHausa20.520.510224.030.48850.4993
amhAmharic14.520.375232.330.57350.4743
lugLuganda14.990.508922.690.43840.4737
tsnTswana21.320.505120.010.43700.4710
snaShona9.520.464223.020.47620.4702
runKirundi10.800.438823.950.45540.4471
nyoRunyoro12.070.464418.330.42240.4434
nynRunyankole9.330.441515.840.41140.4264
yorYoruba19.980.398520.580.44670.4226
cggRukiga8.300.417216.600.41390.4155
xogLusoga7.480.408615.870.37840.3935
ttjRutooro8.180.390614.710.38680.3887
eweEwe13.830.409610.800.32650.3680
rucRuruuli5.140.364315.930.36280.3636
kikKikuyu6.410.345914.910.37390.3599
luoLuo9.890.388512.860.32550.3570
achAcholi10.980.416710.990.28720.3519
ormOromo6.100.36438.880.29610.3302
akaAkan9.370.324410.230.31860.3215
gwrLugwere3.980.33499.970.30740.3211
bemBemba5.010.330510.240.30840.3195
lajLango6.320.33299.130.27150.3022
kdiKumam6.100.31767.240.27390.2957
rubLugungu3.350.28269.400.30400.2933
nujLunyole4.380.29947.730.26080.2801
kooRukonjo2.720.31397.140.24150.2777
tljLubwisi2.750.27438.860.27800.2762
myxLumasaba3.180.27848.340.26740.2729
lsmSamia3.420.28599.460.25950.2727
alzAlur3.860.26055.240.24230.2514
adhJopadhola4.520.26246.540.23710.2498
lggLugbara4.680.28694.000.21140.2491
kabKabyle5.100.23136.910.24380.2375
teoAteso3.380.24985.130.21870.2343
wolWolof3.990.21485.600.23090.2228
bfaBari2.880.17596.280.24410.2100
rwmKwamba1.870.21035.190.20680.2086
fulFulani3.240.18026.160.23540.2078
dagDagbani3.710.20265.770.21060.2066
bamBambara5.340.19204.870.21700.2045
keoKakwa2.420.18124.370.20860.1949
berBerber3.260.17494.080.19730.1861
mhiMa'di2.290.15754.820.21270.1851
luyLuhya0.980.15005.490.21980.1849
ledLendu1.830.13563.690.22030.1779
kdjKaramojong1.500.15863.690.18420.1714
pokPokot1.190.12313.600.18170.1524
ikxIk0.900.10604.690.19700.1515
kpzKupsabiny0.720.09733.680.19150.1444
dgaDagaare1.020.09523.790.19120.1432
lucAringa1.070.09094.490.19080.1409
kauKanuri0.680.08484.090.19710.1409
klnKalenjin0.780.10944.140.17150.1405
dinDinka1.240.08592.970.18690.1364
kpoIkposo0.140.04011.710.15260.0964

Speech Transcription

Reported ASR results span 110 dataset configurations from Sunbird/speech. Performance varies substantially by language and recording source.

LanguagesScored ExamplesMacro Language WERMacro Language CERMacro Mean Utterance WERMacro Mean Utterance CER
5152010.47200.18900.51100.2016

(Rates shown on a 0–1 scale; lower is better. WER can exceed 1.0 when insertions outnumber reference words.)

CodeLanguageScoredCorpus WERCorpus CER
achAcholi920.40860.1758
afrAfrikaans1700.14130.0646
akaAkan500.41820.1779
amhAmharic2500.32560.1474
bamBambara1490.69190.3454
bemBemba1000.57180.1392
berBerber500.50000.1924
cggRukiga490.42540.1295
dagDagbani1000.46270.1871
dgaDagaare500.39200.1738
engEnglish1000.15150.0819
eweEwe780.58330.2704
fraFrench500.10290.0525
fulFulani1490.53960.2009
hauHausa2870.23670.0844
iboIgbo2470.56640.2802
kabKabyle500.72730.3696
kauKanuri500.67950.2133
kikKikuyu500.37980.1893
kinKinyarwanda1000.46530.1787
klnKalenjin1000.61640.1815
kooRukonjo470.73330.2119
kpoIkposo500.74180.3416
ledLendu500.56560.2646
lggLugbara500.35750.0990
linLingala1930.38860.1800
lthThur410.42990.2430
lugLuganda2660.49990.1669
luoLuo1490.34950.1096
luyLuhya500.43350.1015
mlgMalagasy490.33590.1561
myxLumasaba450.62370.1814
nblNdebele100.50430.2032
nyaChichewa980.59490.2212
nynRunyankole940.49770.1613
ormOromo1190.46020.1488
pcmNigerian Pidgin1000.38560.3043
rucRuruuli380.67010.1932
rwmKwamba491.22510.7426
snaShona1470.30250.0951
somSomali1490.47310.1898
sotSotho940.39460.1780
swaSwahili990.16190.0585
teoAteso500.45670.1516
tsnTswana980.22250.0826
ttjRutooro490.57530.2050
wolWolof1350.52800.2602
xhoXhosa1260.43230.1247
xogLusoga430.49950.1378
yorYoruba2490.53110.2042
zulZulu1430.30900.0863

Limitations

  • Preview weights: Output will change before the stable release.
  • Uneven multilingual quality: Lower-resource languages have substantially lower automatic scores. The low-resource end of the table is genuinely weak, and output there should be verified by a speaker before use.
  • Translation variants: BLEU and chrF compare against a single reference and can penalize acceptable wording, dialect, or orthographic variants.
  • Speech variation: Accent, dialect, code-switching, background noise, and domain vocabulary can materially affect transcription.
  • Language prompting: The model was trained with language-specific transcription prompts and may perform poorly when the spoken language is omitted or named incorrectly.
  • Hallucinations: Like any LLM, it can produce fluent, confident, but incorrect translations or transcripts. This matters more in low-resource languages where errors are harder for non-speakers to spot.

License

Released under the Apache 2.0 license, matching the Gemma 4 base model.

Citation

@misc{sunbird2026sunflowergemma4e2b,
  title        = {Sunflower-Gemma4-E2B},
  author       = {{Sunbird AI}},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/Sunbird/Sunflower-Gemma4-E2B}},
  note         = {Preview release: Multilingual text and speech model for African languages}
}

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

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

GPU в ailist

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

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

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

Ревизия весов
44e5d28

0 моделей