Downloads · 30 days
0
humair025/kikiri-tts-urdu-pipeline
kikiri-tts-urdu-pipeline is a machine learning model from humair025. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
End-to-end TTS finetuning pipeline integrating: - Kokoro-82M (hexgrad) — the pretrained TTS model (178-token phoneme vocab) - semidark/StyleTTS2 (commit b1956da) — Stage 1 + Stage 2 training recipe - urdug2p — Urdu gr…
Downloads · 30 days
0
Access
Public
Updated Sep 9, 2026
Repo size
66.9 MB
Likes
0
Public
Click a slice to open those files.
.txt34 MB · 72%
From the Hugging Face model README
End-to-end TTS finetuning pipeline integrating:
b1956da) — Stage 1 + Stage 2 training recipekikiri-tts-urdu-pipeline/
├── pipeline/ # ← OUR INTEGRATION LAYER
│ ├── __init__.py
│ ├── phonemizer.py # UrduG2P + KokoroTokenizer (all IDs ≤ 177)
│ ├── hf_dataset.py # Loads humair025/koku from HF (24kHz)
│ ├── local_dataset.py # StyleTTS2-format train_list.txt loader
│ ├── prepare_urdu_dataset.py # CLI: generate train/val lists from koku
│ ├── checkpointer.py # KikiriCheckpointer: HF push/pull + best
│ ├── resume.py # Resolve local/HF/auto resume path
│ ├── ema.py # EMA for multiple StyleTTS2 components
│ ├── audio_logger.py # TensorBoard audio logging
│ ├── train_first.py # Stage 1 wrapper (HF integration)
│ ├── train_second.py # Stage 2 wrapper (HF integration)
│ ├── train_first_real.py # Real-data E2E smoke test (HF push)
│ ├── train_real_e2e.py # Real E2E w/ mel + Griffin-Lim audio
│ ├── train_real_styletts2.py # REAL StyleTTS2 + Kokoro weights training
│ ├── test_kokoro_load.py # Verify Kokoro weights load bit-for-bit
│ ├── test_kokoro_load_hf.py # Same + HF push/pull verification
│ ├── self_test.py # End-to-end pipeline self-test (10+ tests)
│ ├── config_urdu_ft.yml # Urdu fine-tuning config
│ ├── requirements.txt
│ ├── README.md
│ └── kokoro_compat/ # Vendored KokoroTokenizer + vocab JSONs
│ ├── urdu_g2p_kokoro_tokenizer.py
│ ├── kokoro_vocab_178.json # Gap-filled vocab (all IDs ≤ 177)
│ ├── kokoro_vocab.json # Original (IDs 178-185)
│ ├── kokoro_vocab_gaps.json
│ ├── kokoro_char_map.json
│ ├── README.md
│ └── verify_kokoro_compat.py
│
├── StyleTTS2/ # ← semidark/StyleTTS2 @ b1956da (VENDORED)
│ ├── models.py # build_model(), load_checkpoint(), 190M params
│ ├── train_first.py # Original Stage 1 (Stage 1 loss recipe)
│ ├── train_second.py # Original Stage 2 (Stage 2 loss recipe)
│ ├── meldataset.py # FilePathDataset + build_dataloader
│ ├── losses.py # MultiResolutionSTFTLoss, WavLMLoss, GAN
│ ├── utils.py # maximum_path, log_norm, recursive_munch
│ ├── kokoro_symbols.py # 178-token Kokoro vocab + TextCleaner
│ ├── monotonic_align/ # Pure-numpy fallback (Cython not required)
│ ├── Modules/istftnet.py # Kokoro Decoder (53M params, patched for CPU)
│ ├── Modules/discriminators.py # MPD, MSD, WavLMDiscriminator
│ ├── Modules/slmadv.py # SLM adversarial loss
│ ├── Modules/diffusion/ # KDiffusion + AudioDiffusionConditional
│ ├── Utils/PLBERT/ # PLBERT config (weights NOT included — download from semidark/StyleTTS2)
│ ├── Utils/ASR/ # ASR config (weights NOT included)
│ └── Utils/JDC/ # JDC pitch extractor config (weights NOT included)
│
├── scripts/ # ← kikiri-tts original helper scripts
│ ├── prepare_dataset.py # MP3 → WAV + IPA + speaker clustering
│ ├── prepare_training.py # Dataset → StyleTTS2 lists + weight conversion
│ ├── extract_voicepack.py # Checkpoint → voicepack .pt
│ └── test_inference.py # Checkpoint → KModel → audio
│
├── configs/
│ └── config_german_ft.yml # Original German config (reference)
├── training/
│ ├── config.json # Kokoro-82M architecture spec
│ ├── kokoro_symbols.py # 178-token vocab (auto-generated)
│ └── OOD_texts.txt
├── checks/ # pytest tests
├── docs/ # Architecture, training guide, troubleshooting
├── pyproject.toml
├── README.md # Original kikiri-tts README
├── AGENTS.md
├── LICENSE
└── NOTICE
pip install -r pipeline/requirements.txt
# Install urdu_g2p (we don't vendor it — install from source):
cd /path/to/urdu_g2p_full
pip install ".[misaki]"
# 2a. Kokoro-82M base weights (327 MB):
python -c "
from huggingface_hub import hf_hub_download
hf_hub_download(repo_id='hexgrad/Kokoro-82M', filename='kokoro-v1_0.pth')
hf_hub_download(repo_id='hexgrad/Kokoro-82M', filename='config.json')
"
# 2b. StyleTTS2 utility weights (168 MB total — NOT included in this repo):
# Download from the original semidark/StyleTTS2 repo:
# StyleTTS2/Utils/ASR/epoch_00080.pth
# StyleTTS2/Utils/JDC/bst.t7
# StyleTTS2/Utils/PLBERT/step_1000000.t7
# These are needed by `build_model()` (ASR text-aligner, JDC pitch extractor,
# PLBERT). Without them, only `train_real_e2e.py` (which uses our stub
# mel-prediction head) will work.
export HF_TOKEN_WRITE=hf_xxx
python -m pipeline.self_test
python -m pipeline.train_real_styletts2 \
--hf_repo yourname/kikiri-urdu-stage1 \
--n_samples 4 --n_steps 10 --batch_size 1 \
--include_decoder # adds the 53M-param decoder to training (slow on CPU)
tensorboard --logdir logs/kokoro-urdu-styletts2/tb
nn.Embedding(178, ...) exactly)humair025/koku dataset loading — 24kHz mono audio + Kokoro
phoneme IDs, with collate_fn for batchingresolve_resume_path() handles
local paths, "auto", bare HF repo ids, or full HF file pathspipeline.phonemizer — UrduG2P + KokoroTokenizer.encode wrapperpipeline.hf_dataset — KokuDataset / KokuIterableDataset for
loading humair025/koku from HF (24kHz resampling, phoneme parsing)pipeline.checkpointer — KikiriCheckpointer for HF push/pullpipeline.resume — resolve_resume_path for local/HF/auto resumepipeline.ema — ModelEMA for multiple modelspipeline.audio_logger — TB audio logging with Kokoro inferencepipeline.train_first — Stage 1 (decoder + alignment + PLBERT)pipeline.train_second — Stage 2 (predictor + SLM adversarial)pipeline.train_real_styletts2 — REAL end-to-end with HF push (uses
the actual models.build_model from semidark/StyleTTS2)pipeline.test_kokoro_load_hf — verify Kokoro weights load + push to HFpipeline.self_test — end-to-end self-test (10+ tests)Trains: decoder, text_encoder, alignment (text_aligner), pitch_extractor,
style_encoder. After TMA_epoch, also adds monotonic alignment loss,
sequence-to-sequence CE loss, GAN losses, and WavLM SLM loss.
Trains: predictor (duration / F0 / energy), predictor_encoder, diffusion
(after diff_epoch), and at joint_epoch activates WavLM SLM adversarial
loss + GAN discriminator + decoder fine-tuning.
humair025/kikiri-urdu-test — first E2E push test (10 small ckpts)humair025/kikiri-urdu-kokoro-test — Kokoro weights load + train + pushhumair025/kikiri-urdu-real — real mel L1 loss + Griffin-Lim audio logshumair025/kikiri-urdu-styletts2-real — REAL StyleTTS2 + Kokoro training
(6 steps, loss 4.59 → 4.50, full TB logs with audio)Same as upstream kikiri-tts (Apache 2.0) + semidark/StyleTTS2.