tiny-voca-ru
English | Русский
A 4.5M-parameter Russian text-to-speech adaptation of tiny-voca (24 kHz mono, two synthetic voices F and M) with a pure-Python Russian text frontend, safetensors/ONNX Runtime inference, custom-voice fine-tuning, and a client-side browser demo.
- Model:
egnch/tiny-voca-ru - Dataset:
egnch/tiny-voca-ru-dataset - Browser Demo:
egnch/tiny-voca-ru-demo - PyPI:
tiny-voca-ru
Installation
Requires Python 3.10+. Works with pip or uv.
# Minimal Russian text frontend only (no PyTorch)
pip install tiny-voca-ru
# Lightweight ONNX Runtime inference (no PyTorch)
pip install "tiny-voca-ru[onnx]"
# PyTorch inference + safetensors + ONNX export
pip install "tiny-voca-ru[torch]"
# Full training & custom-voice fine-tuning stack
pip install "tiny-voca-ru[train]"
# Optional full ruaccent homograph disambiguation
pip install "tiny-voca-ru[ruaccent]"
Quick Start: Inference
Synthesizer loads models from Hugging Face Hub (egnch/tiny-voca-ru by default) or a local directory, automatically selecting PyTorch (model.safetensors + config.json) or ONNX Runtime (model.onnx + model.json).
Python API
from tiny_voca_ru import Synthesizer
# Load from Hugging Face Hub (defaults to "egnch/tiny-voca-ru")
synth = Synthesizer.from_pretrained("egnch/tiny-voca-ru")
# Explicit ONNX Runtime backend (downloads only onnx/model.onnx + onnx/model.json)
# synth = Synthesizer.from_pretrained("egnch/tiny-voca-ru", backend="onnx")
# Local safetensors or ONNX directory
# synth = Synthesizer("checkpoints/tiny-voca-ru")
result = synth.save_wav(
"Здравствуйте! Встречу перенесли на 15:30, 14 марта.",
"hello.wav",
voice="M", # "F" or "M"
speed=1.0, # 0.25 .. 4.0
pitch_shift=0.0, # log-F0 offset (0.058 ≈ +1 semitone)
pitch_range=1.0, # 0.0 .. 3.0
stress="lite", # "lite" | "ruaccent" | "none"
pause_seconds=0.0, # optional silence gap between sentences
)
CLI
# Uses Hugging Face Hub ("egnch/tiny-voca-ru") by default
tiny-voca-ru-speak \
--voice F \
--text "Привет! Билет стоит 1250 рублей." \
--output out.wav
# Explicit ONNX Runtime backend
tiny-voca-ru-speak \
--model egnch/tiny-voca-ru \
--backend onnx \
--voice M \
--text "Привет! Билет стоит 1250 рублей." \
--output out_onnx.wav
# Local checkpoint or ONNX directory
tiny-voca-ru-speak \
--model checkpoints/tiny-voca-ru \
--voice F \
--text "Привет! Билет стоит 1250 рублей." \
--output out_local.wav
Russian Text Frontend
tiny_voca_ru.frontend has no PyTorch or eSpeak dependency. It normalizes Russian text (numbers, dates, times, currencies, units, Roman numerals, abbreviations, acronyms, Latin words), places lexical stress, and outputs a 61-symbol IPA phoneme sequence.
from tiny_voca_ru import accentuate, normalize, phonemize, transcribe
normalize("В 1999 году билет стоил 12,50 руб.")
accentuate("Я открыл зам+ок ключом.") # explicit '+' marks are preserved
transcribe("Здравствуйте!") # readable IPA with ˈ
seq = phonemize("Привет, мир!", stress="lite")
| Stress Provider | Dependencies | Notes |
|---|---|---|
lite (default) |
Bundled stress.txt.gz + accent.onnx (onnxruntime) |
Fast, offline, runs in browser via JS accent.onnx |
ruaccent |
tiny-voca-ru[ruaccent] |
Full ruaccent (turbo3.1) neural homograph resolver |
none |
None | Preserves existing + stress marks only |
Custom-Voice Fine-Tuning
1. Prepare a dataset
Create a metadata.csv (or metadata.jsonl) with columns audio, text, and optional speaker, split, id:
audio,text,speaker
wavs/001.wav,Добрый день! Как ваши дела?,alice
wavs/002.wav,Сегодня отличная погода.,alice
Extract 24 kHz features and wav2vec2 CTC alignments:
tiny-voca-ru-prepare \
--metadata data/metadata.csv \
--audio-root data \
--output work/alice-prepared \
--val-ratio 0.05
2. Fine-tune from a pretrained checkpoint
When fine-tuning onto new speakers, tiny-voca-ru-train copies compatible weights and initializes new speaker embeddings from --init-voice (or the mean of pretrained voices):
tiny-voca-ru-train \
--data-dir work/alice-prepared \
--init-from checkpoints/tiny-voca-ru \
--init-voice F \
--output work/alice-run \
--steps 5000 \
--learning-rate 1e-4 \
--save-every 500
Add --freeze-encoder for small datasets (< 30 min). Resume with --resume work/alice-run/last.pt. Safetensors checkpoints are saved to work/alice-run/inference/ and work/alice-run/best/.
ONNX Export & Legacy Checkpoint Conversion
# Export safetensors checkpoint -> model.onnx + model.json
tiny-voca-ru-export \
--checkpoint checkpoints/tiny-voca-ru \
--output checkpoints/tiny-voca-ru-onnx
# Convert legacy .pt checkpoint -> model.safetensors + config.json
tiny-voca-ru-convert \
--source path/to/tiny-voca-ru.pt \
--output checkpoints/tiny-voca-ru
Browser Demo
The static demo in web/public/ runs tiny_voca_ru.frontend in Pyodide and model.onnx + accent.onnx via ONNX Runtime Web entirely offline:
bash web/build_assets.sh checkpoints/tiny-voca-ru-onnx
python3 -m http.server --directory web/public 8000
Development
uv sync --python 3.12 --extra torch --extra onnx --extra train --group dev
uv run pytest -q
uv run ruff check .
uv run ruff format --check .
uv run basedpyright
Citation
Machine-readable citation metadata is available in CITATION.cff.
@misc{chetvertkov2026tinyvocaru,
author = {Chetvertkov, Evgeniy},
title = {tiny-voca-ru: A 4.5M-Parameter Russian Text-to-Speech Model},
year = {2026},
url = {https://huggingface.co/egnch/tiny-voca-ru},
note = {ORCID: https://orcid.org/0009-0006-6158-2624}
}
Please also consider citing the original tiny-voca by Muhammed Nazeem (2026).
License & Attribution
Code and weights are licensed under the Apache License 2.0 (LICENSE).
See NOTICE for attribution to tiny-voca (Muhammed Nazeem, Apache-2.0) and ruaccent (MIT License, bundled stress.txt.gz and accent.onnx in src/tiny_voca_ru/frontend/data/).
Metadata
Release files for tiny-voca-ru 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tiny_voca_ru-0.1.0.tar.gz | 2.0 MB | Without provenance | Details for tiny_voca_ru-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tiny_voca_ru-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tiny_voca_ru-0.1.0-py3-none-any.whl |
Total release size: 4.0 MB
Release files / tiny_voca_ru-0.1.0.tar.gz
| Download URL | tiny_voca_ru-0.1.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d402ae152d597a9577bcf5ed34d11a9a3a9516f18be9b7f3a82083b2a76203b
|
|
BLAKE2b-256 checksum How to use checksums |
f1dd9ed687a9aebd7d93e214181d59d954ac5c1a580a8576c0129834de692bd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tiny_voca_ru-0.1.0-py3-none-any.whl
| Download URL | tiny_voca_ru-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69c7f6bd059f6b275445f207feb6bcf570f0c94fc38590b3699f371db6cb8bbf
|
|
BLAKE2b-256 checksum How to use checksums |
ce29af6fa9a47b1447bd4f4b43a2346e488bb41d5a97f5b9857c811c75f2e014
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for tiny-voca-ru 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.