SobbieTTS
Sobbie is a lightweight, 4.5M-parameter English text-to-speech model built to run fast and completely offline on CPU via ONNX Runtime. It was fine-tuned on an expressive English speech dataset just for fun, starting from the tiny-voca architecture.
Highlights
| Parameters | ~4.5M (waveform generator included) |
| Model Size | ~21 MB (onnx/model.onnx) Β· ~18 MB (sobbie.pt) |
| Voices | F (primary expressive female) Β· M |
| Audio Output | 24 kHz mono WAV |
| Hardware | Runs fast on CPU (no GPU required) |
| License | Apache-2.0 |
Download & Setup
Requires Python 3.10+ and git (for installing the offline dizione phonemizer).
# 1. Download the model repository (recommended; handles large weights automatically)
pip install -U huggingface_hub
hf download PatnaikAshish/SobbieTTS --local-dir SobbieTTS
cd SobbieTTS
# (Alternative using git: requires git-lfs)
# git lfs install
# git clone https://huggingface.co/PatnaikAshish/SobbieTTS
# cd SobbieTTS
# 2. Create a virtual environment
python -m venv .venv
# Windows PowerShell:
.\.venv\Scripts\Activate.ps1
# macOS / Linux:
# source .venv/bin/activate
# 3. Install lightweight CPU dependencies
pip install -r requirements.txt
Usage
Command Line (speak.py)
# Speak with voice F (default)
python speak.py --voice F --text "Hello! This is Sobbie running completely offline on your CPU." --output f.wav
# Speak with voice M
python speak.py --voice M --text "Hello! This is Sobbie running completely offline on your CPU." --output m.wav
# Read a multi-sentence text file
python speak.py --voice F --text-file story.txt --output story.wav
Useful Options
| Flag | Default | Description |
|---|---|---|
--voice |
F |
Choose F or M |
--speed |
1.0 |
Speaking rate (higher = faster) |
--pitch-range |
1.15 |
Pitch expressiveness (1.0 = calmer, 1.25 = livelier) |
--pitch-shift |
0.0 |
Shift pitch up/down (0.058 β 1 semitone) |
--threads |
4 |
CPU threads for ONNX Runtime |
Python (ONNX Runtime)
import os
import numpy as np
import onnxruntime as ort
import soundfile as sf
os.environ["DIZIONE_DATA"] = "./phonemizer"
import dizione
phones = dizione.phonemize("Hello! This is Sobbie speaking offline.")
f32 = lambda x: np.array([x], dtype=np.float32)
sess = ort.InferenceSession("onnx/model.onnx", providers=["CPUExecutionProvider"])
audio, _ = sess.run(None, {
"tokens": np.array([phones.ids], dtype=np.int64),
"stress": np.array([phones.stress], dtype=np.int64),
"voice": np.array([0], dtype=np.int64), # 0 = F, 1 = M
"speed": f32(1.0),
"pitch_shift": f32(0.0),
"pitch_range": f32(1.15),
})
wave = audio[0]
if np.abs(wave).max() > 0.99:
wave = wave * (0.99 / float(np.abs(wave).max()))
sf.write("hello.wav", wave, 24000)
Run Locally in Your Browser (web/)
Requires Python 3.10+ and git (no virtual environment needed):
cd SobbieTTS\web
python fetch_assets.py
cd public
python -m http.server 8000
Then open http://localhost:8000 in your browser.
Repository Files
onnx/model.onnx&onnx/model.jsonβ Exported ONNX graph and metadatasobbie.ptβ PyTorch inference weightsphonemizer/β Offline English pronunciation lexicon fordizioneweb/β Self-contained browser demo (ONNX Runtime Web + Pyodide)speak.pyβ Standalone CPU CLI scriptconfig.json&requirements.txtβ Model configuration and dependencies
Notes & Limitations
- English only; built as a lightweight experimental/fun fine-tune on an expressive dataset.
- Unusual foreign names, rare acronyms, and complex spellings depend on the
dizionephonemizer. - Split very long paragraphs at punctuation marks (handled automatically by
speak.py).
Credits & License
- Downloads last month
- 75
Model tree for PatnaikAshish/SobbieTTS
Base model
n4ze3m/tiny-voca