kokoro-de-martin / README.md
miro-dietiker's picture
Model card: document the espeak-ng 1.52 /ʊɐ fix and the ç phonemizer-patch note
1f53891 verified
|
Raw
History Blame Contribute Delete
4.49 kB
metadata
license: apache-2.0
language:
  - de
pipeline_tag: text-to-speech
library_name: sherpa-onnx
base_model: Godelaune/Kokoro-82M-ONNX-German-Martin
tags:
  - onnx
  - kokoro
  - sherpa-onnx
  - text-to-speech
  - german
  - single-speaker

Kokoro German "Martin" — sherpa-onnx package

The German Kokoro voice Martin, repackaged so it loads and runs in sherpa-onnx for fully offline, on-device German text-to-speech.

This is a repackaging, not a retraining — the weights are untouched. The only changes are the metadata and file layout sherpa-onnx needs in order to load a Kokoro model at all.

Why the repackaging is needed

sherpa-onnx's Kokoro TTS reads its configuration out of the ONNX file's metadata (model type, sample rate, speaker table, style dimensions, …) to know how to run the model, and it expects the speaker style vectors as a single flat voices.bin. The upstream Martin export provides neither — the ONNX carries no sherpa-onnx metadata, and the voice ships as a NumPy .npz — so sherpa-onnx cannot load it directly. This package fixes exactly that:

  • injects the sherpa-onnx Kokoro metadata into the ONNX (model_type=kokoro, sample_rate=24000, style_dim=510,1,256, n_speakers=1, id2speaker=0->martin, …), copied from k2-fsa's own Kokoro release schema, and
  • converts the voice .npz (one (510,1,256) float32 array) into the flat little-endian voices.bin sherpa expects (522 240 bytes).

The result loads and synthesizes in sherpa-onnx with the weights unchanged.

What's in the archive

kokoro-de-martin.tar.bz2:

  • model.onnx — the Martin ONNX with sherpa-onnx Kokoro metadata injected
  • voices.bin — the voice style vector (510×1×256 float32)
  • tokens.txt — from the k2-fsa sherpa-onnx Kokoro release
  • espeak-ng-data/ — from espeak-ng 1.52 (see the pronunciation note below)

Pronunciation notes (German G2P)

sherpa-onnx phonemizes German with espeak-ng / piper-phonemize, and two properties of that pipeline affect raw-text rendering. Both are properties of the sherpa-onnx Kokoro G2P, not of the voice weights.

  • ʊɐ ("ur") vowel — fixed in this package. The espeak-ng-data shipped by k2-fsa's base Kokoro release is stale and emits a literal ? for the vocalized-r ʊɐ, so durch, kurz, wurde, … mispronounce. This package instead bundles current espeak-ng 1.52 data, which resolves ʊɐ correctly (durchdˈʊɐç). A build-time check guards it.
  • ich-laut /ç/ — needs a phonemizer patch, not a lexicon. piper-phonemize NFD-decomposes ç into c + combining cedilla (U+0327), which the precomposed Kokoro token set drops, so ich, nicht, -lich / -ig don't render cleanly. Note the usual "add a lexicon entry" workaround does not apply here: sherpa-onnx consults the Kokoro lexicon only for its dictionary languages (en/zh); for espeak-driven languages (incl. German) it goes straight to espeak and never reads the lexicon. The fix has to be in the phonemizer — recompose the pair back to ç when that codepoint is a known token. The Page Reader app that consumes this package carries exactly that patch in its bundled sherpa-onnx build; if you run this archive on stock sherpa-onnx, ç-words are still affected.

How it was built

Reproducibly, by a small build chain: fetch the upstream Martin ONNX + voice .npz and k2-fsa's base Kokoro release (for the metadata schema, tokens.txt, and espeak-ng-data/), inject the metadata, convert the .npz to voices.bin, and assemble the archive. A verify step then loads the result in sherpa-onnx and synthesizes a German clip to confirm it works before publishing.

Provenance & license

Apache-2.0, inherited from upstream. The weights are unchanged from the source fine-tune:

Usage

Extract kokoro-de-martin.tar.bz2 and point sherpa-onnx's Kokoro config at model.onnx, voices.bin, tokens.txt, and espeak-ng-data/ with lang=de.