Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,8 @@
title: VibeVoice ASR
- local: model_doc/vits
title: VITS
- local: model_doc/voxtral_tts
title: VoxtralTts
- local: model_doc/wav2vec2
title: Wav2Vec2
- local: model_doc/wav2vec2-bert
Expand Down
117 changes: 117 additions & 0 deletions docs/source/en/model_doc/voxtral_tts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!--Copyright 2026 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

⚠️ Note that this file is in Markdown but contains specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.

-->
*This model was published in HF papers on 2026-03-26 and contributed to Hugging Face Transformers on 2026-11-25.*

# VoxtralTts

[Voxtral TTS](https://huggingface.co/papers/2603.25551) is a multilingual text-to-speech model from
[Mistral AI](https://mistral.ai), released with 20 preset voices in English, French, Spanish, German, Italian,
Portuguese, Dutch, Arabic and Hindi.

The model has three parts:

- a Mistral language model (initialized from Ministral 3B), prompted with the embeddings of a voice preset and the text
to read. Every audio frame (80 ms) it generates is fed back as the sum of the embeddings of its 37 codes.
- a flow-matching acoustic transformer. From the hidden state of the language model, a linear head greedily picks the
semantic code of the next frame, and a small bidirectional transformer integrates a flow (7 Euler steps, with
classifier-free guidance) to predict its 36 acoustic values, quantized to 21 levels.
- a causal codec decoder (convolutions and sliding-window transformers with ALiBi) that turns the codes into a 24 kHz
waveform.

The released checkpoint does not include the codec encoder, so voices can only be selected among the presets (or
passed as precomputed voice embeddings); voice cloning from a reference recording is not supported.

You can find the original checkpoint under the [Mistral AI](https://huggingface.co/mistralai/Voxtral-4B-TTS-2603)
organization. The checkpoint and the voice presets are released under the CC BY-NC 4.0 license.

## Usage

```python
import soundfile as sf
import torch

from transformers import AutoProcessor, VoxtralTtsForTextToSpeech

model_id = "mistralai/Voxtral-4B-TTS-2603"
processor = AutoProcessor.from_pretrained(model_id)
model = VoxtralTtsForTextToSpeech.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")

print(processor.available_voices)
inputs = processor("Paris is a beautiful city!", voice="casual_male").to(model.device)
outputs = model.generate(**inputs)
sf.write("paris.wav", outputs.audio[0].float().cpu().numpy(), processor.sampling_rate)
```

### Batched generation

Prompts are left-padded, and each one can use a different voice.

```python
inputs = processor(
["The quick brown fox jumps over the lazy dog.", "Bonjour, je m'appelle Marie et j'habite à Lyon."],
voice=["neutral_female", "fr_male"],
).to(model.device)
outputs = model.generate(**inputs, generator=torch.Generator(model.device).manual_seed(0))
for i, audio in enumerate(outputs.audio):
sf.write(f"sample_{i}.wav", audio.float().cpu().numpy(), processor.sampling_rate)
```

`generate` returns the waveforms (`outputs.audio`), the generated codes (`outputs.audio_codes`) and the number of audio
frames of each sample (`outputs.audio_lengths`). The classifier-free guidance scale of the flow matching can be set
with `cfg_alpha` (defaults to 1.2), and `generator` makes the generation reproducible.

As in the reference implementation, the codec decodes the audio in independent chunks of 375 frames (30 s), which
bounds the memory of its attention for long generations (`codec_chunk_size`, set it to `None` to decode all frames at
once).

## VoxtralTtsConfig

[[autodoc]] VoxtralTtsConfig

## VoxtralTtsAcousticTransformerConfig

[[autodoc]] VoxtralTtsAcousticTransformerConfig

## VoxtralTtsCodecConfig

[[autodoc]] VoxtralTtsCodecConfig

## VoxtralTtsProcessor

[[autodoc]] VoxtralTtsProcessor
- __call__

## VoxtralTtsModel

[[autodoc]] VoxtralTtsModel
- forward

## VoxtralTtsForTextToSpeech

[[autodoc]] VoxtralTtsForTextToSpeech
- forward
- generate

## VoxtralTtsAcousticTransformer

[[autodoc]] VoxtralTtsAcousticTransformer
- forward
- generate_frame

## VoxtralTtsCodecModel

[[autodoc]] VoxtralTtsCodecModel
- decode
1 change: 1 addition & 0 deletions src/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
from .vjepa2 import *
from .voxtral import *
from .voxtral_realtime import *
from .voxtral_tts import *
from .wav2vec2 import *
from .wav2vec2_bert import *
from .wav2vec2_conformer import *
Expand Down
6 changes: 6 additions & 0 deletions src/transformers/models/auto/auto_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,9 @@
("voxtral_realtime", "VoxtralRealtimeConfig"),
("voxtral_realtime_encoder", "VoxtralRealtimeEncoderConfig"),
("voxtral_realtime_text", "VoxtralRealtimeTextConfig"),
("voxtral_tts", "VoxtralTtsConfig"),
("voxtral_tts_acoustic_transformer", "VoxtralTtsAcousticTransformerConfig"),
("voxtral_tts_codec", "VoxtralTtsCodecConfig"),
("wav2vec2", "Wav2Vec2Config"),
("wav2vec2-bert", "Wav2Vec2BertConfig"),
("wav2vec2-conformer", "Wav2Vec2ConformerConfig"),
Expand Down Expand Up @@ -1145,6 +1148,8 @@
("voxtral_encoder", "voxtral"),
("voxtral_realtime_encoder", "voxtral_realtime"),
("voxtral_realtime_text", "voxtral_realtime"),
("voxtral_tts_acoustic_transformer", "voxtral_tts"),
("voxtral_tts_codec", "voxtral_tts"),
("wav2vec2-bert", "wav2vec2_bert"),
("wav2vec2-conformer", "wav2vec2_conformer"),
("xclip", "x_clip"),
Expand Down Expand Up @@ -1400,6 +1405,7 @@
("vision-text-dual-encoder", "VisionTextDualEncoderProcessor"),
("voxtral", "VoxtralProcessor"),
("voxtral_realtime", "VoxtralRealtimeProcessor"),
("voxtral_tts", "VoxtralTtsProcessor"),
("wav2vec2", "Wav2Vec2Processor"),
("wav2vec2-bert", "Wav2Vec2BertProcessor"),
("whisper", "WhisperProcessor"),
Expand Down
4 changes: 4 additions & 0 deletions src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("voxtral_realtime", "VoxtralRealtimeModel"),
("voxtral_realtime_encoder", "VoxtralRealtimeEncoder"),
("voxtral_realtime_text", "VoxtralRealtimeTextModel"),
("voxtral_tts", "VoxtralTtsModel"),
("voxtral_tts_acoustic_transformer", "VoxtralTtsAcousticTransformer"),
("voxtral_tts_codec", "VoxtralTtsCodecModel"),
("wav2vec2", "Wav2Vec2Model"),
("wav2vec2-bert", "Wav2Vec2BertModel"),
("wav2vec2-conformer", "Wav2Vec2ConformerModel"),
Expand Down Expand Up @@ -2023,6 +2026,7 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("seamless_m4t_v2", "SeamlessM4Tv2ForTextToSpeech"),
("vibevoice", "VibeVoiceForConditionalGeneration"),
("vits", "VitsModel"),
("voxtral_tts", "VoxtralTtsForTextToSpeech"),
]
)

Expand Down
6 changes: 6 additions & 0 deletions src/transformers/models/auto/tokenization_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@
if is_mistral_common_available()
else ("TokenizersBackend" if is_tokenizers_available() else None),
),
(
"voxtral_tts",
"MistralCommonBackend"
if is_mistral_common_available()
else ("TokenizersBackend" if is_tokenizers_available() else None),
),
("wav2vec2", "Wav2Vec2CTCTokenizer"),
("wav2vec2-bert", "Wav2Vec2CTCTokenizer"),
("wav2vec2-conformer", "Wav2Vec2CTCTokenizer"),
Expand Down
34 changes: 34 additions & 0 deletions src/transformers/models/voxtral_tts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from the modules in `src/transformers/models/voxtral_tts`.
# Do NOT edit this file manually as any edits will be overwritten by auto-generation of the file.
# A module is picked up once it exports a name through `__all__`.
# Regenerate the file with: `python utils/check_inits.py --fix_and_overwrite`
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Copyright 2026 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ...utils import _LazyModule
from ...utils.import_utils import define_import_structure


if TYPE_CHECKING:
from .configuration_voxtral_tts import *
from .modeling_voxtral_tts import *
from .processing_voxtral_tts import *
else:
import sys

_file = globals()["__file__"]
sys.modules[__name__] = _LazyModule(__name__, _file, define_import_structure(_file), module_spec=__spec__)
Loading