--- 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](https://github.com/k2-fsa/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` and `espeak-ng-data/` — from the k2-fsa sherpa-onnx Kokoro release ## Known limitation sherpa-onnx phonemizes German with espeak-ng / piper-phonemize, whose G2P emits the German **ich-laut /ç/ decomposed** (`c` + combining cedilla, U+0327); the precomposed Kokoro token set drops it, so `ich`, `nicht` and `-lich` / `-ig` words don't render cleanly from raw text. This is a property of the sherpa-onnx Kokoro G2P pipeline, not of the voice, and affects any Kokoro voice run this way. The usual sherpa workaround applies: supply the affected words through a lexicon so their phonemes bypass the runtime G2P. ## 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: - ONNX source: [Godelaune/Kokoro-82M-ONNX-German-Martin](https://huggingface.co/Godelaune/Kokoro-82M-ONNX-German-Martin) - Fine-tune: [kikiri-tts/kikiri-german-martin](https://huggingface.co/kikiri-tts/kikiri-german-martin) (Martin Harbecke voice, StyleTTS2) - Architecture: [hexgrad/Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) - `tokens.txt` + `espeak-ng-data/`: k2-fsa sherpa-onnx Kokoro release ## 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`.