Repository navigation
audio_lm: the codebook family's needs_voice ignores the last request's voice - #3
Merged
Merged
Conversation
…s voice caps.needs_voice of a Qwen3-TTS Base talker read audio_lm_decode_speaker, which tts_build sets to each request's voice. After one generation with a cloned voice the caps reported needs_voice = false while tts_format still refuses a request without a voice, so a host that checks the caps before each request sent the next one without a voice and got "this is a voice-clone model and needs a voice". It now checks the model's default voice, as the flow and token families do. The host smoke checks that the caps are the same after a generation.
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.
Problem
For a Qwen3-TTS Base talker,
caps.needs_voicechanges once a generation has run:needs_voiceistrue.tts_buildwith a cloned voice,needs_voicebecomesfalse.tts_formatstill refuses a request that has no voice.A host that checks the caps before each request therefore sends its second request without a voice. That request fails with
this is a voice-clone model and needs a voice (reference audio or a speaker file).Found while testing mybigday/llama.rn#418: the example app's second Qwen3-TTS generation fails on both Mac and Android.
Cause
codebook_family::caps()checksaudio_lm_decode_speaker().codec_audio_lm_tts_build()sets that speaker to each request's voice (audio_lm_use_decode_speaker), so the cap reflects the last request's voice instead of the model's.Fix
Check the model's default voice with
audio_lm_resolve_speaker(alm_, nullptr). The flow (Pocket-TTS) and token (OuteTTS) families already computeneeds_voicethis way. CustomVoice talkers are unaffected: their builtin default voice hasspk_id, soneeds_voicestaysfalse.The host smoke now asserts that
alm.capsis the same after a generation.Testing
All runs on macOS arm64 with a CPU build (
GGML_NATIVE=OFF), using the Qwen3-TTS 12Hz 0.6B Base codec (Q8_0) and talker (Q4_K_M) GGUFs.C API check. Steps:
create_voicefromassets/refs/jfk_en.wav, thentts_format+tts_buildwith that voice, then read the caps.needs_voice=1needs_voice=0needs_voice=1needs_voice=1tests/e2e/audio_lm_host_smoke.py, qwen3_tts_icl case[FAIL] qwen3_tts_icl: caps changed after a generation: ... needs_voice=True ... -> ... needs_voice=False ...[PASS] qwen3_tts_icl: frames=73 stop=eos_code_c0 dur=5.92s rms=0.091llama_sampler_init_penalties, while its bundled llama.cpp takes 4. The smoke fails on that before reaching this check, so these runs rebound that one function to 4 arguments outside the repo.