Skip to content

audio_lm: the codebook family's needs_voice ignores the last request's voice - #3

Merged
hans00 merged 1 commit into
mainfrom
audio-lm-codebook-needs-voice
Nov 15, 2026
Merged

hans00 merged 1 commit into
mainfrom
audio-lm-codebook-needs-voice

Conversation

@jhen0409

@jhen0409 jhen0409 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Problem

For a Qwen3-TTS Base talker, caps.needs_voice changes once a generation has run:

  1. On a fresh context, needs_voice is true.
  2. After tts_build with a cloned voice, needs_voice becomes false.
  3. tts_format still 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() checks audio_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 compute needs_voice this way. CustomVoice talkers are unaffected: their builtin default voice has spk_id, so needs_voice stays false.

The host smoke now asserts that alm.caps is 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_voice from assets/refs/jfk_en.wav, then tts_format + tts_build with that voice, then read the caps.

fresh after the cloned build build without a voice
before needs_voice=1 needs_voice=0 refused
after needs_voice=1 needs_voice=1 refused

tests/e2e/audio_lm_host_smoke.py, qwen3_tts_icl case

  • Before the fix: [FAIL] qwen3_tts_icl: caps changed after a generation: ... needs_voice=True ... -> ... needs_voice=False ...
  • After the fix: [PASS] qwen3_tts_icl: frames=73 stop=eos_code_c0 dur=5.92s rms=0.091
  • Whisper wasn't installed, so the CER check was skipped.
  • llama-cpp-python 0.3.36 still declares the old 5-argument llama_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.

…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.
@hans00
hans00 merged commit d5e3852 into main Nov 15, 2026
5 checks passed
@hans00
hans00 deleted the audio-lm-codebook-needs-voice branch November 15, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants