Views
No views yet
| File | Description |
|---|---|
config.json | Kokoro-82M architecture config (unchanged from the base model) |
model.pth | Default checkpoint (epoch 5). Fine-tuned weights (bert, bert_encoder, predictor, text_encoder, decoder), converted from the Stage 2 StyleTTS2 checkpoint |
voices/thorsten.pt | Voicepack matching the default (epoch 5) checkpoint |
model_ep{1,2,3,4,6,7,8,9,10}.pth | All other Stage 2 checkpoints (epochs 1–4, 6–10), same converted, ready-to-use format as model.pth |
voices/thorsten_ep{1,2,3,4,6,7,8,9,10}.pt | Matching voicepacks for each of the above |
misaki and kokoro (the official PyPI misaki package does not include the de submodule needed for German G2P), plus the espeak-ng system package that misaki relies on for phonemization:1# System dependency (required by misaki for German G2P)
2# macOS:
3brew install espeak-ng
4# Debian/Ubuntu:
5sudo apt-get install espeak-ng
6
7# Python dependencies
8pip install huggingface_hub soundfile numpy torch
9pip install "git+https://github.com/semidark/misaki.git@6d252a2e02f3b030f22f56686f1a73786c16ffc8"
10pip install "git+https://github.com/semidark/kokoro.git"1import numpy as np
2import soundfile as sf
3import torch
4from huggingface_hub import hf_hub_download
5from kokoro import KModel, KPipeline
6
7REPO_ID = "Thorsten-Voice/Kokoro"
8
9device = "cuda" if torch.cuda.is_available() else "cpu"
10
11config_path = hf_hub_download(repo_id=REPO_ID, filename="config.json")
12model_path = hf_hub_download(repo_id=REPO_ID, filename="model.pth")
13voice_path = hf_hub_download(repo_id=REPO_ID, filename="voices/thorsten.pt")
14
15kmodel = KModel(repo_id="hexgrad/Kokoro-82M", config=config_path, model=model_path)
16kmodel = kmodel.to(device).eval()
17
18pipeline = KPipeline(lang_code="d", repo_id="hexgrad/Kokoro-82M", model=kmodel)
19
20# Workaround: misaki's German G2P can emit 'ʏ' (short ü), which is not in
21# Kokoro's vocabulary (only 'y' is). See "Known limitations" below.
22_original_g2p = pipeline.g2p
23pipeline.g2p = lambda text: (lambda ps, tok: (ps.replace("ʏ", "y"), tok))(*_original_g2p(text))
24
25voice = torch.load(voice_path, map_location="cpu", weights_only=True)
26
27text = "Hallo, hier spricht Thorsten."
28audio_chunks = [audio for _, _, audio in pipeline(text, voice=voice, speed=1.0)]
29combined = np.concatenate(audio_chunks)
30
31sf.write("output.wav", combined, 24000)inference.py:1# Default checkpoint (epoch 5)
2python inference.py "Hallo, hier spricht Thorsten." output.wav
3
4# Any other epoch (1-10) - e.g. epoch 10, faster/tighter delivery
5python inference.py "Hallo, hier spricht Thorsten." output.wav ep10
6python inference.py "Hallo, hier spricht Thorsten." output.wav ep3test_audio_epoch5/.inference.py (see Usage above) — no separate conversion step needed.| Epoch | Validation loss | Duration loss | F0 loss | inference.py variant |
|---|---|---|---|---|
| 1 | 0.288 | 0.455 | 2.281 | ep1 |
| 2 | 0.285 | 0.432 | 2.131 | ep2 |
| 3 | 0.283 | 0.427 | 2.085 | ep3 |
| 4 | 0.272 | 0.439 | 2.015 | ep4 |
| 5 | 0.269 | 0.420 | 1.957 | ep5 / default |
| 6 | 0.274 | 0.427 | 1.953 | ep6 |
| 7 | 0.271 | 0.422 | 1.883 | ep7 |
| 8 | 0.271 | 0.420 | 1.869 | ep8 |
| 9 | 0.271 | 0.425 | 1.846 | ep9 |
| 10 | 0.269 | 0.416 | 1.800 | ep10 |
misaki.de.DEG2P) can emit the short-ü symbol ʏ (e.g. in "Brücke"), which is not part of Kokoro's 178-symbol vocabulary — only the long-ü symbol y is. Left unhandled, this silently breaks short-ü words during inference. inference.py includes a small workaround that patches the G2P output to replace ʏ with y (the same substitution used when preparing the training data). If you're writing your own inference code instead of using the provided script, make sure to apply this substitution yourself.misaki/espeak-ng) shared with other TTS systems (including Piper), not specific to this fine-tune.