3 Commits
Author SHA1 Message Date
Stef cc92083394 Keep the STFT convs of Kokoro in float32 when quantizing to int8 (#4087)
The Kokoro decoder's generator computes the phase of its forward STFT
with atan2(imag, real), which the exported graph implements as an
unguarded imag / real followed by Atan. imag and real are produced by
two Conv nodes. quantize_dynamic also quantized these two convs; at DC
and Nyquist the quantized imag is exactly 0, and with int8 arithmetic
real can become exactly 0 there as well, giving 0 / 0 = NaN.

On macOS arm64 the NaN spreads over the whole output, so short pieces of
text come back as all-NaN audio. On x64 the following
DynamicQuantizeLinear happens to drop the NaN, which hides the problem
but does not remove it.

Pass the two convs as nodes_to_exclude, for v1.0 and v1.1-zh. v0.19
computes the STFT without Conv nodes and is not affected.

The released int8 models kokoro-int8-multi-lang-v1_0 and
kokoro-int8-multi-lang-v1_1 need to be regenerated with this change.

Fixes #4086
2026-10-26 17:14:46 +08:00
Stef 51aaac5a46 jni: Fix strings returned to Java for characters outside the BMP (#4064) 2026-10-20 19:08:03 +08:00
Stef 5fec9c9b09 jni: Fix TTS for characters outside the BMP (#4062) 2026-10-20 18:28:53 +08:00