Repository navigation
feat(irodori_tts): support Irodori-TTS v4 Large (T5Gemma 2 text encoder) - #1163
Merged
Merged
Conversation
v4 Large keeps the v4 architecture at 3.29B parameters but replaces the ModernBERT text encoder with the encoder half of T5Gemma 2, shared by the text and caption paths. - assets: read the embedded T5Gemma 2 config (encoder.text_config), check its tensor shapes, and require max_text_len / max_caption_len to fit the sliding window so every layer can use the full bidirectional mask. - condition encoder: build the backbone with the shared T5GemmaEncoderModule (as BreezeTTS 2 does); no sliding-window mask input for this encoder. - tokenizer: the checkpoint's Gemma BPE tokenizer.json through LlamaBpeTokenizer, BOS first and PAD on the right like Python. - config: MLP ratios are read as double. Python sizes MLPs as int(dim * ratio); in float, 1280 * 2.6 truncates to 3327 instead of 3328 (v4 Large's speaker encoder). Existing checkpoints get the same widths. - converter: q4_k / q5_k / q6_k; 2-D weights whose input width is not a multiple of 256 are stored as Q8_0 instead of F32. - docs: v4 Large section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
@KKTTSPJ Thanks! PR merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Irodori-TTS-v4-Large to
irodori_tts.v4 Large is the v4 architecture at 3.29B parameters (24-layer, 2048-wide DiT) with one structural change: the ModernBERT text encoder is replaced by the encoder half of T5Gemma 2 (26 Gemma 3 layers, 1152 wide, vocabulary 262144), shared by the text and caption paths. Every other part (duration predictor, caption conditioning,
residual_mlpprojectors, speaker patching) uses the same configuration values as v4 Small, so the change stays inside the text encoder and tokenizer.The checkpoint already carries everything needed: the T5Gemma 2 weights (
pretrained_text_backbone.backbone.*), its config (text_encoder_config_jsonmetadata) and the Gemma tokenizer (tokenizer/).tools/models/convert_irodori_gguf.pypackages it as before, and the gated T5Gemma 2 repository is not needed. The existing spec already declarestext_encoder_config.jsonandtokenizer/tokenizer.json, somodel_specs/irodori_tts.jsonis unchanged.No package is added to the catalog: the weights are under the Gemma Terms of Use. The docs describe local conversion.
Changes
assets.cpp/assets.htext_encoder_config.jsonhasmodel_type: "t5gemma2", readencoder.text_config(heads, KV heads, head dim, RMS eps,query_pre_attn_scalar, per-layer-type RoPE theta and linear factor) and check the T5Gemma 2 tensor shapes.sliding_window(512); loading fails ifmax_text_lenormax_caption_lenis longer.double. Python sizes MLPs asint(dim * ratio)with a double product; in float,1280 * 2.6truncates to 3327 instead of 3328, which is v4 Large's speaker-encoder width. Existing checkpoints get the same widths as before.condition_encoder.cpp: the backbone is built with the sharedT5GemmaEncoderModule, configured the way BreezeTTS 2 does. No sliding-window mask input is created for this encoder. Hugging Face'seoi_embedding(the end-of-image token) is not applied; TTS text has no image tokens.tokenizer_text.cpp: the Gemma BPEtokenizer.jsonthroughLlamaBpeTokenizer(Gemma4pre-tokenizer, U+2581 spaces), BOS first and PAD on the right like Python'sPretrainedTextTokenizer.convert_irodori_gguf.py:--type q4_k / q5_k / q6_k. A k-quant needs input widths that are multiples of 256, so T5Gemma 2's 1152-wide projections would otherwise stay F32. The script stores those weights as Q8_0 with--keep-type. Embeddings keep the converter's F16 rule.docs/models/irodori_tts.md: variant row and a v4 Large section.Validation
RTX 5060 Ti (CUDA 12.8) and CPU (AVX2), Windows. Python reference: Aratako/Irodori-TTS
89f9d8f(v4-Large support), fp32, CUDA.Existing checkpoints are unchanged. Upstream
main(dcec826b) and this branch give byte-identical WAVs on CUDA for v4 Small, v4.1 Small, 500M v3 and 600M v3 VoiceDesign (no reference, reference audio, and caption where supported; 11 cases, seed 42, 16 steps).Tokens and condition encoders (Q8_0, CUDA) against Python (12 sentences: plain text, emoji, numbers, mixed English, rare kanji, surrogate-pair kanji, spaces, 3 captions):
text_norm)The two token differences come from text normalization, not the tokenizer: Python's
normalize_textapplies NFKC and maps〜toー, and audio.cpp's Irodorinormalize_textdoes neither (half-width katakana, full-width Latin,〜). This gap exists for all Irodori checkpoints; it shows here because the Gemma tokenizer has no normalizer of its own. I would send it as a separate PR.Audio against Python fp32 (seed 42, 40 steps; log-mel frame cosine):
Reference-audio cosines against Python vary between 0.92 and 0.97 for v4 Small as well, so that column is not evidence of a v4 Large difference. Q5_K and Q4_K change the delivery of the caption line (same length, different prosody).
Listening: Q5_K and Q4_K give a different performance of the caption line, with no audible loss of audio quality; Q6_K and Q8_0 sound the same. With reference audio, Q4_K to Q8_0 could not be told apart from Python.
Size, memory and time (CUDA, 40 steps, about 6 s of speech, CLI run including model load):
Python fp32 on the same GPU took 46–54 s per line.
🤖 Generated with Claude Code