Repository navigation
irodori_tts: load checkpoints without a duration predictor - #832
Merged
Merged
Conversation
Checkpoints from before the duration predictor (the original 500M v2, and models fine-tuned from it) have no duration_predictor.* weights and no use_duration_predictor key. The Python runtime defaults the flag to False and, without an explicit duration, generates 30 s and lets trim_tail cut the trailing silence. audio.cpp defaulted it to true, so such a checkpoint failed to load with "missing tensor: duration_predictor.token_input_proj.weight". - use_duration_predictor defaults to false, as in Python. Every published irodori_tts package sets it to true explicitly. - Without a predictor the condition encoder loads no duration weights and builds no duration graph. Its speaker/caption flag inputs feed only that graph, so they are not created either (unread graph inputs get no storage from gallocr). - Weight validation asks for the caption-side duration tensors only when there is a predictor. - resolve_sample_shape: no duration_sec and no predictor -> 30 s, as in Python. 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.
Irodori-TTS checkpoints before the duration predictor existed — the original 500M v2 release, and models fine-tuned from it — carry no
duration_predictor.*weights, and their config has nouse_duration_predictorkey. The Python runtime handles them:ModelConfig.use_duration_predictordefaults toFalse, and without an explicit durationInferenceRuntime.synthesizegenerates 30 seconds and letstrim_tailcut the trailing silence.audio.cpp defaults the flag to
true, so such a checkpoint fails to load:This makes
irodori_ttsfollow the Python runtime. Model-local; no framework, server or CLI change.Changes
IrodoriModelConfig::use_duration_predictordefaults tofalse, as in Python. Every publishedirodori_ttspackage sets it totrueexplicitly (checked: the v3 500M, v3 600M VoiceDesign, v4 Small, v4.1 Small and v4.1 Anime GGUFs, q8_0 and f16), so they are unaffected.false, the condition encoder neither loads theduration_predictor.*weights nor builds the duration graph. Its speaker and caption flag inputs feed only that graph, so they are not created either: left in the graph unread, gallocr would give them no storage and writing them would fail.duration_predictor.null_caption,caption_modulation) only when there is a duration predictor.resolve_sample_shape: with noduration_secand no predictor, 30 s (ceil(30 * sample_rate / hop)latent steps, as in Python).trim_tailthen trims as usual.duration_secworks as before;duration_scalehas nothing to scale.docs/models/irodori_tts.md.Validation
Windows 10, MSVC 14.51, CUDA 12.8, RTX 5060 Ti (sm_120). Built with
-DAUDIOCPP_MODEL_SET=custom -DAUDIOCPP_MODELS=irodori_tts, CPU (AVX2) and CUDA. (The local CUDA build also needed a workaround for MSVC 14.51 being newer than CUDA 12.8 supports; it is not part of this PR.) Each configuration ran in one long-livedaudiocpp_server; seed 42.Checkpoint without a duration predictor:
Aratako/Irodori-TTS-500M-v2(model.safetensors,model_config.jsontaken from itsconfig_jsonmetadata, with the usualllm-jp-3-150mandSemantic-DACVAE-Japanese-32dimsiblings), 40 steps, compared with the Python runtime (infer.py, fp32, CUDA, same text/seed/steps; log-mel over the common length):duration_sec=5Before this PR the same model fails to load (message above), on CUDA and CPU. Repeating a request in the same server gives identical output, and the CPU backend gives the same lengths as CUDA (mel cosine 1.0000 against the CUDA output). The 30-second fallback is the slow path: 3.0 s against 0.7 s for
duration_sec=5on CUDA here, which the docs note.No change for checkpoints with a duration predictor — byte-identical WAV output before and after this PR:
🤖 Generated with Claude Code