Skip to content

Kokoro: short prompts (~5-8 words) produce run-on garbage after the text #960

Description

@thedecentthing

Summary

Kokoro generations with short prompts (≈5–8 words) produce audio that continues past the text: the sentence is spoken correctly, then repeated, then followed by multilingual noise. Longer prompts (≈10+ words) on the same voice are clean. Reproduces on two independent compute paths (the app's MLX bundle and a from-source backend running the kokoro pip package on pytorch CPU), so it looks like a pipeline/model-behavior issue rather than an acceleration-path one.

Environment

  • macOS, Apple Silicon
  • Voicebox.app 0.5.0 (MLX backend) — also reproduced on a from-source backend (kokoro>=0.9.4, pytorch CPU) — same ~2.9 s file size, same garbage content
  • Model: hexgrad/Kokoro-82M (314 MB, HF_HUB_DISABLE_XET=1 prefetch; also reproduced with in-app download)
  • Voices tested: af_sarah, af_bella presets

Steps to reproduce

curl -X POST http://127.0.0.1:17493/speak \
  -H 'content-type: application/json' \
  -d '{"text": "Read it back to me. Word for word.", "profile": "<kokoro-preset-profile-id>", "engine": "kokoro"}'
# fetch the WAV at /audio/{id} when complete, then transcribe

Actual result

Transcript of the returned audio (sentence repeated, then noise):

Read it back to me, word for word… Read it back to me, word for word.! Out! Out! End- OB 7

RMS energy profile (100 ms windows) — the audio continues with real energy well past the text:

____.##.#####._.##.###._______
^text        ^garbage  ^end

Control with a longer prompt on the same voice ("We never authorized that deployment. The model card is explicit, and your team knew it.") is perfectly clean, 5.97 s, no tail.

Additional observations

  • Both takes of a seeded bake (seed: 0 and seed: 1) show the same behavior.
  • The garbage tail appears regardless of whether the request goes through /speak directly or through a full client pipeline, so the client is not implicated.
  • Other short lines (5–8 words) show the same pattern; the boundary in our tests is roughly ≤8 words.
  • Whisper STT on these files faithfully reports the extra audio, so any transcript-diff tooling downstream flags the take.

Question

Is this a known Kokoro-82M behavior on short prompts (EOS/stop not emitted), and are there generation knobs Voicebox should be setting for short text (max frames/tokens, stop conditions, minimum-length padding)? Happy to test patches against this machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions