/ Модель

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

Лицензия
Apache 2.0
Базовая модель
granite-3.2-8b-instruct
Библиотека
transformers
Опубликована
26 мар 2025

granite-speech-3.2-8b

Распознавание речи5 профессий

Granite-speech-3.2-8b — компактная speech-language модель IBM, созданная на базе ibm-granite/granite-3.2-8b-instruct и предназначенная для обработки речи.

62 478скачиваний за 30 дней88лайковвеса обновлены16 апр 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Она поддерживает автоматическое распознавание речи (ASR) и автоматический перевод речи (AST), прежде всего для английского языка. Модель выпущена 2 апреля 2025 года и ориентирована на корпоративные приложения, работающие с аудиовходами.

Модель использует двухпроходную архитектуру: сначала преобразует аудиофайл в текст, после чего отдельным явно инициируемым вызовом обрабатывает транскрипцию базовой языковой моделью. В состав входят речевой энкодер на базе 10 Conformer-блоков с обучением CTC, блочный механизм внимания для аудиофрагментов длительностью 4 секунды и speech projector. Указанный размер базовой языковой модели — 8 миллиардов параметров. Для входа используются монофонические аудиоданные с частотой 16 кГц.

Сильными сторонами модели являются компактность, поддержка как распознавания, так и перевода речи, а также возможность перевода с английского на французский, испанский, итальянский, немецкий, португальский, японский и китайский языки. Ограничения включают необходимость выполнять два последовательных вызова, основную ориентацию на английскую речь и отсутствие преимуществ перед специализированными Granite-моделями при работе только с текстом. Модель распространяется по лицензии Apache 2.0.

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

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

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

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

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

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

Открыть на Hugging Face

Granite-speech-3.2-8b

Model Summary: Granite-speech-3.2-8b is a compact and efficient speech-language model, specifically designed for automatic speech recognition (ASR) and automatic speech translation (AST). Granite-speech-3.2-8b uses a two-pass design, unlike integrated models that combine speech and language into a single pass. Initial calls to granite-speech-3.2-8b will transcribe audio files into text. To process the transcribed text using the underlying Granite language model, users must make a second call as each step must be explicitly initiated.

The model was trained on a collection of public corpora comprising diverse datasets for ASR and AST as well as synthetic datasets tailored to support the speech translation task. Granite-speech-3.2 was trained by modality aligning granite-3.2-8b-instruct (https://huggingface.co/ibm-granite/granite-3.2-8b-instruct) to speech on publicly available open source corpora containing audio inputs and text targets.

Evaluations:

We evaluated granite-speech-3.2-8b alongside other speech-language models (SLMs) in the less than 8b parameter range as well as dedicated ASR and AST systems on standard benchmarks. The evaluation spanned multiple public benchmarks, with particular emphasis on English ASR tasks while also including AST for En-X translation.

image/png

image/png

image/png

Release Date: April 2nd, 2025

License: Apache 2.0

Supported Languages: English

Intended Use: The model is intended to be used in enterprise applications that involve processing of speech inputs. In particular, the model is well-suited for English speech-to-text and speech translations from English to some major European languages such as French, Spanish, Italian, German, Portuguese as well as Japanese and Mandarin. For tasks that exclusively involve text-based input, we suggest using our Granite large language models, which are optimized for text-only processing and offer superior performance compared to this model.

Generation:

Granite Speech model is in the process of being supported natively in transformers from the main branch. In the interim, below is a simple example of how to use the granite-speech-3.2-8b model.

Usage with transformers

First, make sure to build the latest version of transformers:

pip install transformers>=4.49 peft torchaudio

Install a torchaudio backend, such as:

pip install soundfile

Then run the code:

import torch
import torchaudio
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
from huggingface_hub import hf_hub_download

device = "cuda" if torch.cuda.is_available() else "cpu"

model_name = "ibm-granite/granite-speech-3.2-8b"
speech_granite_processor = AutoProcessor.from_pretrained(
    model_name, trust_remote_code=True)
tokenizer = speech_granite_processor.tokenizer
speech_granite = AutoModelForSpeechSeq2Seq.from_pretrained(
    model_name, trust_remote_code=True).to(device)

# prepare speech and text prompt, using the appropriate prompt template

audio_path = hf_hub_download(repo_id=model_name, filename='10226_10111_000000.wav')
wav, sr = torchaudio.load(audio_path, normalize=True)
assert wav.shape[0] == 1 and sr == 16000 # mono, 16khz

# create text prompt
chat = [
    {
        "role": "system",
        "content": "Knowledge Cutoff Date: April 2024.\nToday's Date: December 19, 2024.\nYou are Granite, developed by IBM. You are a helpful AI assistant",
    },
    {
        "role": "user",
        "content": "<|audio|>can you transcribe the speech into a written format?",
    }
]

text = tokenizer.apply_chat_template(
    chat, tokenize=False, add_generation_prompt=True
)

# compute audio embeddings
model_inputs = speech_granite_processor(
    text,
    wav,
    device=device, # Computation device; returned tensors are put on CPU
    return_tensors="pt",
).to(device)
 
model_outputs = speech_granite.generate(
    **model_inputs,
    max_new_tokens=200,
    num_beams=4,
    do_sample=False,
    min_length=1,
    top_p=1.0,
    repetition_penalty=1.0,
    length_penalty=1.0,
    temperature=1.0,
    bos_token_id=tokenizer.bos_token_id,
    eos_token_id=tokenizer.eos_token_id,
    pad_token_id=tokenizer.pad_token_id,
)

# Transformers includes the input IDs in the response.
num_input_tokens = model_inputs["input_ids"].shape[-1]
new_tokens = torch.unsqueeze(model_outputs[0, num_input_tokens:], dim=0)

output_text = tokenizer.batch_decode(
    new_tokens, add_special_tokens=False, skip_special_tokens=True
)
print(f"STT output = {output_text[0].upper()}")

Model Architecture:

The architecture of granite-speech-3.2-8b consists of the following components:

(1) Speech encoder: 10 conformer blocks trained with Connectionist Temporal Classification (CTC) on character-level targets on the subset containing only ASR corpora (see configuration below). In addition, our CTC encoder uses block-attention with 4-seconds audio blocks and self-conditioned CTC from the middle layer.

Configuration parameterValue
Input dimension160 (80 logmels x 2)
Nb. of layers10
Hidden dimension1024
Nb. of attention heads8
Attention head size128
Convolution kernel size15
Output dimension42

(2) Speech projector and temporal downsampler (speech-text modality adapter): we use a 2-layer window query transformer (q-former) operating on blocks of 15 1024-dimensional acoustic embeddings coming out of the last conformer block of the speech encoder that get downsampled by a factor of 5 using 3 trainable queries per block and per layer. The total temporal downsampling factor is 10 (2x from the encoder and 5x from the projector) resulting in a 10Hz acoustic embeddings rate for the LLM. The encoder, projector and LoRA adapters were fine-tuned/trained jointly on all the corpora mentioned under Training Data.

(3) Large language model: granite-3.2-8b-instruct with 128k context length (https://huggingface.co/ibm-granite/granite-3.2-8b-instruct).

(4) LoRA adapters: rank=64 applied to the query, value projection matrices

Training Data:

Overall, our training data is largely comprised of two key sources: (1) publicly available datasets (2) Synthetic data created from publicly available datasets specifically targeting the speech translation task. A detailed description of the training datasets can be found in the table below:

NameTaskNb. hoursSource
CommonVoice-17 EnglishASR2600https://huggingface.co/datasets/mozilla-foundation/common_voice_17_0
MLS EnglishASR44000https://huggingface.co/datasets/facebook/multilingual_librispeech
LibrispeechASR1000https://huggingface.co/datasets/openslr/librispeech_asr
VoxPopuli EnglishASR500https://huggingface.co/datasets/facebook/voxpopuli
AMIASR100https://huggingface.co/datasets/edinburghcstr/ami
YODAS EnglishASR10000https://huggingface.co/datasets/espnet/yodas
CommonVoice-17 En->JaAST2600translated with granite-3.2-8b and phi-4
CommonVoice-17 En->DeAST2600translated with granite-3.2-8b and phi-4
MLS Englishother44000transcripts description provided by granite-3.1-8b
CREMA-DSER3https://github.com/CheyneyComputerScience/CREMA-D
MELDSER7https://github.com/declare-lab/MELD

Infrastructure: We train Granite Speech using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs. The training of this particular model was completed in 10 days on 32 H100 GPUs.

Ethical Considerations and Limitations: The use of Large Speech and Language Models may involve risks and ethical considerations that people should be aware of. These risks may include bias and fairness, misinformation, and autonomous decision-making. We urge the community to use granite-speech-3.2-8b in a manner consistent with IBM's Responsible Use Guide or similar responsible use structures. IBM recommends using this model for automatic speech recognition tasks. The model's modular design improves safety by limiting how audio inputs can influence the system. If an unfamiliar or malformed prompt is received, the model simply echoes it with its transcription. This minimizes the risk of adversarial inputs, unlike integrated models that directly interpret audio and may be more exposed to such attacks. Note that more general speech tasks may pose higher inherent risks of triggering unwanted outputs.

To enhance safety, we recommend using granite-speech-3.2-8b alongside Granite Guardian. Granite Guardian is a fine-tuned instruct model designed to detect and flag risks in prompts and responses across key dimensions outlined in the IBM AI Risk Atlas. Its training, which includes both human-annotated and synthetic data informed by internal red-teaming, enables it to outperform similar open-source models on standard benchmarks, providing an additional layer of safety.

Resources

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
d583502

0 моделей