pythainlp/MakHamTTS-dataset
Viewer • Updated • 94.5k • 193 • 1
MakHam (มะขาม) is an ultra-lightweight, high-performance open Thai Text-to-Speech (TTS) model family developed by PyThaiNLP.
MakHam combines Kokoro-82M multi-voice architecture with the Paradee 1.1 single-voice distillation framework, supporting accurate 5-tone Thai phonology and standalone ONNX deployment across servers, CPUs, edge devices, and web browsers.
→ mid, ↓ low, ↘ falling, ↑ high, ↗ rising) powered by FastThaiG2P with a 115-token Kokoro vocabulary..npy voicepack tensor or dynamic tensor slicing is needed at runtime.| Property | MakHam Paradee (INT8) | MakHam Paradee (FP32) | Kokoro-82M Thai Base |
|---|---|---|---|
| Parameters | 7,877,918 (~7.88M) | 7,877,918 (~7.88M) | |
| Model Size | 8.07 MB | 33.17 MB | 325.5 MB |
| Architecture | TextStudent (s+mlp) + VDecoder (v2) |
TextStudent (s+mlp) + VDecoder (v2) |
StyleTTS2 + iSTFTNet |
| Sample Rate | 24,000 Hz | 24,000 Hz | 24,000 Hz |
| Vocab Size | 115 tokens (5-tone) | 115 tokens (5-tone) | 115 tokens (5-tone) |
| Voicepack Required | No (Embedded) | No (Embedded) | Yes (ref_s [510, 1, 256]) |
| Speed (CPU) | ~45x Real-Time | ~28x Real-Time | ~4.5x Real-Time |
pip install onnxruntime soundfile huggingface_hub
pip install https://github.com/awslabs/FastThaiG2P/archive/refs/heads/main.zip
import json
import numpy as np
import onnxruntime as ort
import soundfile as sf
from huggingface_hub import hf_hub_download
from fastthaig2p import G2P, ipa_to_kokoro
# 1. Download model and config from Hugging Face
model_path = hf_hub_download(
repo_id="pythainlp/MakHamTTS",
filename="paradee_thai/paradee_thai_int8.onnx"
)
config_path = hf_hub_download(
repo_id="pythainlp/MakHamTTS",
filename="paradee_thai/config.json"
)
# 2. Initialize G2P and ONNX session
g2p = G2P()
with open(config_path, "r", encoding="utf-8") as f:
cfg = json.load(f)
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
# 3. Convert Thai text to Kokoro phoneme IDs
text = "สวัสดีค่ะ ยินดีต้อนรับสู่ระบบเสียงสังเคราะห์ภาษาไทย มะขาม"
phonemes = ipa_to_kokoro(g2p.convert(text))
token_ids = [0] + [cfg["vocab"][c] for c in phonemes if c in cfg["vocab"]] + [0]
# 4. Synthesize speech
audio = session.run(None, {
"input_ids": np.array([token_ids], dtype=np.int64),
"speed": np.array([1.0], dtype=np.float32),
})[0][0]
# 5. Save output audio (24 kHz)
sf.write("output.wav", audio, 24000)
print("Saved audio to output.wav")
MakHam was trained using the verified pythainlp/MakHamTTS-dataset:
TextStudent + VDecoder architecture.If you use MakHam in your research or application, please cite:
@misc{makham2026,
author = {Wannaphong Phatthiyaphaibun},
title = {MakHamTTS},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/pythainlp/MakHamTTS}}
}