stop truncating the one language code that is longer than two letters
Probing XTTS-v2's seventeen languages through the running endpoint: sixteen
returned audio and zh-cn failed with KeyError: 'zh'. Our own call site did it.
`language=lang[:2]` truncated every code to two characters, and zh-cn is the
only XTTS code longer than that, so the single language with a regioned code was
the single language that could not be spoken.
Resolution now goes through XTTS's own declared list, which also fixes the other
direction: a client sending a locale ("en-us", "pt-br", "ZH_CN") lands on the
code XTTS actually has instead of a near miss.
tools/xtts_service.py had the identical truncation. It runs in coqui's own venv
and cannot import the server package, so the list is duplicated there — and two
tests keep them honest: one compares the declared lists, the other executes the
worker's own normaliser and asserts it answers exactly as the server's does.
Also updates the bark voice-count test, which pinned the English-only list at
ten. That assumption was the bug.
Co-Authored-By:
Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
Showing
Please
register
or
sign in
to comment