|
Download README.md from abdullah/tiny-voca-ar-v2: direct link, hf CLI and curl.
- Browser
- Download file 18 kB
-
https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/README.md
- Command line
-
hf download hf://abdullah/tiny-voca-ar-v2/README.md
-
curl -L -o README.md https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/README.md
18 kB
| license: apache-2.0 | |
| language: | |
| - ar | |
| pipeline_tag: text-to-speech | |
| tags: | |
| - text-to-speech | |
| - arabic | |
| - onnx | |
| - tashkeel | |
| datasets: | |
| - abdullah/tiny-voca-ar-v2-r3 | |
| # tiny-voca-ar v0.2.1 | |
| tiny-voca-ar is a small Modern Standard Arabic text-to-speech model with 4,537,867 parameters and two voices, | |
| `7003`, `7001`. It is an Arabic port of [tiny-voca](https://github.com/n4ze3m/tiny-voca) by Muhammed Nazeem | |
| (Apache-2.0). It uses the same model and the same training recipe. The language-specific parts are new: a rule-based | |
| front end that turns fully diacritized text into phonemes, an Arabic teacher, and Arabic screening. | |
| The model was trained from scratch, with no pre-trained weights, for 35,000 steps. The teacher, | |
| [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2), made 11,066 clips (about 20.06 hours of | |
| synthetic speech) that passed every screening check. The model trained on 10,828 of them; the rest failed | |
| phoneme alignment or were held out for validation. | |
| > [!WARNING] | |
| > Not cleared for client use. The voice-rights question is open, and no native speaker has listened through | |
| > gate H4 (see [Limitations](#limitations)). | |
| | | | | |
| |---|---| | |
| | Parameters | 4,537,867 | | |
| | Voices | `7001` and `7003`, two synthetic voice designs (see [Voices](#voices)) | | |
| | Output | 24 kHz mono | | |
| | Input | Fully diacritized Modern Standard Arabic. Digits, phone numbers, dates, order ids and IBANs are spelled out by the front end | | |
| | Pretrained weights in the model | None | | |
| | Licence | Apache-2.0 (see NOTICE.md) | | |
| | Dataset | [abdullah/tiny-voca-ar-v2-r3](https://huggingface.co/datasets/abdullah/tiny-voca-ar-v2-r3) | | |
| ## Files | |
| | File | Contents | | |
| |---|---| | |
| | `tiny-voca-ar.pt` | PyTorch inference checkpoint, float32 | | |
| | `onnx/model.onnx` | ONNX export, checked against the PyTorch model | | |
| | `onnx/model-optimized.onnx` | Faster ONNX export with the same audio (see [ONNX](#onnx)). Added after v0.2.0, so it is on `main` and not in the `v0.2.0` tag | | |
| | `onnx/vocos.onnx` | Optional waveform post-filter (Vocos), 16.7 MB. See [Post-filter](#post-filter) | | |
| | `config.json` | Model settings, phoneme inventory, voices | | |
| | `code/tiny_voca_ar-0.2.1-py3-none-any.whl` | The package with `tiny_voca.vocos_filter`, which builds the post-filter kernels | | |
| | `code/tiny_voca_ar-0.2.0-py3-none-any.whl` | The `tiny_voca` Python package (front end, model, inference) at the commit that trained this model | | |
| | `samples/` | The audio on this page | | |
| | `evaluation.json` | Every number in this card, per voice, with the per-kind breakdown | | |
| | `NOTICE.md` | Upstream and teacher notices | | |
| SHA256: | |
| - `tiny-voca-ar.pt`: `ff6740b2b52f04105277eef21e9e28823cbe80fc00ac65aacbddf09657a06a7c` | |
| - `onnx/model.onnx`: `3f065f5ed0d2f7b932dea86dba3de111ad5b1d24b29b3ab34b138fa9c72d6d89` | |
| - `onnx/model-optimized.onnx`: `d4fef7050cdfc63969cae340a7d139652d51b1bcf2bc4973cc66f7076f82fe44` | |
| - `onnx/vocos.onnx`: `417f2413163d666b23a89dd73b1829a34ac316fb524a02cc6a4120660a40e6eb` | |
| ## Samples | |
| | Voice | Text | Audio | | |
| |---|---|---| | |
| | 7001 | ู ูุฑูุญูุจูุงุ ุฃูููุง ุฌูุงููุฒู ู ูุชูู ุดูุฆูุชู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7001-short.wav"></audio> | | |
| | 7001 | ููุจูุฏูู ุงูุทููููุณู ููู ุนูู ููุงูู ุตูุงููููุง ุงููููููู ูุ ูููููู ููููุชู ู ูููุงุณูุจู ููููุฒูููุฉู ุทููููููุฉู ููู ุงููุญูุฏููููุฉู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7001-medium.wav"></audio> | | |
| | 7001 | ุงูุชููุตููู ุจูู ุนูููู ููุงุชูููู 0501234567 ููู ุฃูููู ููููุชู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7001-phone.wav"></audio> | | |
| | 7003 | ู ูุฑูุญูุจูุงุ ุฃูููุง ุฌูุงููุฒู ู ูุชูู ุดูุฆูุชู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7003-short.wav"></audio> | | |
| | 7003 | ููุจูุฏูู ุงูุทููููุณู ููู ุนูู ููุงูู ุตูุงููููุง ุงููููููู ูุ ูููููู ููููุชู ู ูููุงุณูุจู ููููุฒูููุฉู ุทููููููุฉู ููู ุงููุญูุฏููููุฉู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7003-medium.wav"></audio> | | |
| | 7003 | ุงูุชููุตููู ุจูู ุนูููู ููุงุชูููู 0501234567 ููู ุฃูููู ููููุชู. | <audio controls src="https://huggingface.co/abdullah/tiny-voca-ar-v2/resolve/main/samples/7003-phone.wav"></audio> | | |
| The samples were generated at release time from the released checkpoint, at the default speed of 1.0. | |
| ## Usage | |
| ```bash | |
| python -m venv tva && . tva/bin/activate | |
| pip install "huggingface-hub>=0.34" torch soundfile numpy | |
| hf download abdullah/tiny-voca-ar-v2 --revision v0.2.0 --local-dir tiny-voca-ar | |
| pip install tiny-voca-ar/code/tiny_voca_ar-0.2.0-py3-none-any.whl | |
| tiny-voca-speak --checkpoint tiny-voca-ar/tiny-voca-ar.pt --voice 7003 \ | |
| --text "ู ูุฑูุญูุจูุงุ ุฃูููุง ุฌูุงููุฒู ู ูุชูู ุดูุฆูุชู." --output hello.wav | |
| ``` | |
| From Python: | |
| ```python | |
| import soundfile as sf | |
| from tiny_voca.infer import load_model, speak_text | |
| model = load_model("tiny-voca-ar/tiny-voca-ar.pt") | |
| wave, _ = speak_text(model, "ุงูุชููุตููู ุจูู ุนูููู ููุงุชูููู 0501234567 ููู ุฃูููู ููููุชู.", voice="7003") | |
| sf.write("phone.wav", wave.numpy(), 24000) | |
| ``` | |
| Name the voice with `--voice 7001` or `--voice 7003`. Without it, the model uses `7001`. A voice the checkpoint does | |
| not carry is rejected. The default speed of 1.0 follows each teacher voice's own pace: `7001` is a slow narrator | |
| (about 13 phones per second), `7003` a fast one (about 17). | |
| The model reads the diacritics as written. Text without tashkeel is refused (`needs_tashkeel`). This version has | |
| no diacritizer. Diacritize the text and review it before the model reads it. | |
| ## ONNX | |
| > [!TIP] | |
| > Use `onnx/model-optimized.onnx` for speed. It replaces `onnx/model.onnx` with no code change. The inputs, the | |
| > outputs, and the audio are the same, up to float rounding. | |
| | Time saved on a clip of | Browser (WASM, 1 thread) | CPU, 1 thread | CPU, 4 threads | | |
| |---|---:|---:|---:| | |
| | 5 s | 7% | 16% | 30% | | |
| | 10 s | 10% | 25% | 40% | | |
| | 21 s | 14% | 34% | 51% | | |
| Measured against `onnx/model.onnx` on an i7-11800H laptop, with ONNX Runtime 1.32.0 and, in Chrome, ONNX Runtime Web | |
| 1.20.1. With the same noise signal, 510 renderings have the same durations and differ by at most 1 step in 16-bit | |
| audio. The method is in | |
| [docs/eval.md](https://github.com/abodacs/tiny-voca-ar/blob/main/docs/eval.md#optimized-onnx-graph). | |
| To run it, install the package as in [Usage](#usage), then: | |
| ```bash | |
| pip install onnxruntime | |
| hf download abdullah/tiny-voca-ar-v2 onnx/model-optimized.onnx --local-dir tiny-voca-ar | |
| ``` | |
| ```python | |
| import numpy as np | |
| import onnxruntime as ort | |
| import soundfile as sf | |
| from tiny_voca.text import phonemize | |
| session = ort.InferenceSession("tiny-voca-ar/onnx/model-optimized.onnx", providers=["CPUExecutionProvider"]) | |
| phones = phonemize("ู ูุฑูุญูุจูุงุ ุฃูููุง ุฌูุงููุฒู ู ูุชูู ุดูุฆูุชู.") | |
| number = lambda value: np.array([value], dtype=np.float32) | |
| audio, durations = session.run(None, { | |
| "tokens": np.array([phones.ids], dtype=np.int64), | |
| "stress": np.array([phones.stress], dtype=np.int64), | |
| "voice": np.array([1], dtype=np.int64), # 0 = 7001, 1 = 7003 | |
| "speed": number(1.0), "pitch_shift": number(0.0), "pitch_range": number(1.0), | |
| }) | |
| sf.write("hello.wav", audio[0], 24000) | |
| ``` | |
| The graph reads one sentence at a time, at most 512 phonemes. | |
| ## Post-filter | |
| The TTS model's own waveform head buzzes on voiced sounds. `onnx/vocos.onnx` is | |
| an optional second stage that replaces the waveform with a Vocos reconstruction | |
| of it. The TTS weights, `onnx/model.onnx`, and the text pipeline do not change. | |
| | Voice | High-band HNR, TTS only | with the filter | UTMOS, TTS only | with the filter | | |
| |---|---:|---:|---:|---:| | |
| | 7001 | 3.19 dB | 1.20 dB | 2.12 | 3.15 | | |
| | 7003 | 8.21 dB | 5.99 dB | 2.81 | 3.43 | | |
| Both voices move toward the recordings. The filter costs 25 to 50% more synthesis | |
| time: 10.5x real time in Chrome against 22.6x without it, on four threads. | |
| It takes the waveform and three fixed STFT kernels, so the kernels stay out of | |
| the int8 weights: | |
| ```python | |
| import onnxruntime as ort | |
| from tiny_voca.vocos_filter import filter_wave | |
| vocos = ort.InferenceSession("tiny-voca-ar/onnx/vocos.onnx", providers=["CPUExecutionProvider"]) | |
| filtered = filter_wave(vocos, audio[0]) # same length as the input | |
| sf.write("hello-filtered.wav", filtered, 24000) | |
| ``` | |
| `filter_wave` builds the three constant kernels the graph expects and keeps the | |
| input length. To filter a file or a folder instead, run `scripts/filter_audio.py` | |
| from the repository. | |
| The filter is apptor's German fine-tune of `charactr/vocos-mel-24khz` (MIT). It | |
| is not Arabic-trained. An Arabic fine-tune was trained on this model's 10,828 | |
| teacher-forced pairs and rejected by ear; it is published as | |
| `onnx/vocos-phase1-experimental.onnx` (54.4 MB) for reference only. The reason | |
| each candidate failed is in | |
| [docs/vocos-failed-experiments.md](https://github.com/abodacs/tiny-voca-ar/blob/main/docs/vocos-failed-experiments.md). | |
| ## Evaluation | |
| The student and its teacher read the same 43 sentences of the fixed eval set (`tiny_voca.evalset`: short, | |
| medium, long, numbers, phone numbers, dates, order ids, and other kinds), in each voice. No eval sentence is in the | |
| training corpus. The teacher is VoxCPM2 in the same voice, with the same engine and settings as the training data. | |
| | Check | `7003` student | `7003` teacher | `7001` student | `7001` teacher | | |
| |---|---|---|---|---| | |
| | Whisper large-v3-turbo word error rate, diacritics stripped | 0.0293 | 0.0353 | 0.0259 | 0.0298 | | |
| | Judge 1: written vowels the phoneme recogniser hears as written | 99.64% (1403/1408) | 99.22% (1397/1408) | 99.93% (1407/1408) | 99.36% (1399/1408) | | |
| | Judge 2: vowels that agree with a diacritizing Arabic ASR | 98.44% (696/707) | 98.02% (645/658) | 98.66% (735/745) | 98.75% (713/722) | | |
| | Digits heard back right (phone numbers and order ids) | 67/67 | 67/67 | 67/67 | 67/67 | | |
| | Harakat minimal pairs (set H3 for the student, set H2 for the teacher) | 98.91% (91/92, 0 undecidable) | 91.30% (84/92, 0 undecidable) | 97.83% (90/92, 0 undecidable) | 97.83% (90/92, 0 undecidable) | | |
| `scripts/release.py` checks every release gate (`scripts/release_gates.json` v1, frozen) for every voice: | |
| | Voice | Gate | Result | Measured | | |
| |---|---|---|---| | |
| | `7003` | digits 100% on phone and order-id cases | pass | 67/67 | | |
| | `7003` | H3 minimal pairs >= 98% | pass | 91/92 | | |
| | `7003` | WER within 0.02 of the teacher | pass | student 0.0293 vs teacher 0.0353 | | |
| | `7003` | pace 13.0-20.5 phones/s (voice 7003) | pass | student 17.28, teacher 17.23 | | |
| | `7003` | pitch movement >= 80% of the teacher's | pass | student 2.58 vs teacher 2.49 semitones | | |
| | `7003` | speech level within 3.0 dB of the teacher | pass | student -15.1 vs teacher -17.0 dBFS | | |
| | `7003` | lead silence >= 0.05 s | pass | median 0.11 s | | |
| | `7003` | no Latin term skipped | pass | only the deliberate unknown | | |
| | `7001` | digits 100% on phone and order-id cases | pass | 67/67 | | |
| | `7001` | H3 minimal pairs >= 98% | **fail, accepted on record** | 90/92 | | |
| | `7001` | WER within 0.02 of the teacher | pass | student 0.0259 vs teacher 0.0298 | | |
| | `7001` | pace 11.0-15.0 phones/s (voice 7001) | pass | student 12.91, teacher 12.51 | | |
| | `7001` | pitch movement >= 80% of the teacher's | pass | student 1.56 vs teacher 1.59 semitones | | |
| | `7001` | speech level within 3.0 dB of the teacher | pass | student -13.2 vs teacher -13.9 dBFS | | |
| | `7001` | lead silence >= 0.05 s | pass | median 0.11 s | | |
| | `7001` | no Latin term skipped | pass | only the deliberate unknown | | |
| **Accepted on record:** `7001` H3 minimal pairs >= 98%. Accepted by Abdullah on 2026-12-02: voice 7001 reads 90 of 92 harakat pairs, the same score as its teacher VoxCPM2 in that voice (90/92). The two words it misses (ุดูุนูุฑู, ุนูููุฏู) are in word sets the teacher also misreads, so the fault comes from the training data. | |
| How to read these numbers: | |
| - Judge 1 is `facebook/wav2vec2-lv-60-espeak-cv-ft` (CTC). A vowel counts as doubtful when another vowel scores | |
| better than the written one by more than 1 log unit. It has known false alarms: 3 in 89 clean clips when it was | |
| calibrated. | |
| - Judge 2 is `NightPrince/stt-arabic-whisper-finetuned-diactires`, a Whisper-small that writes tashkeel. Some of | |
| its disagreements are spelling conventions, not wrong vowels. | |
| - Whisper writes no tashkeel, so a low word error rate shows the words are clear. It does not show the diacritics are right. | |
| - The harakat set has 92 words in a carrier sentence. Each word must sound closer to its own marks than to the | |
| other words with the same letters (ููุชูุจู, ููุชูุจู, ููุชูุจู). The teacher itself does not reach the 98% line in either | |
| voice. The words it misreads (for example ุดูุนูุฑู read as ุดูุนูุฑู) are in its training data, so the student learns them. | |
| Between nearby checkpoints the student's count moves by 1 to 3 words. | |
| - Neither judge can hear shadda or tell ุธ from ุฐ. Both checks are left to the listening gate H4. | |
| ## Training data | |
| - Text: 7,672 rows, each read by both voices. Project-written Modern Standard Arabic sentences on many | |
| subjects, with long passages; templated phone numbers, order ids, one-time codes, IBANs, dates, times, amounts and | |
| names; and 343 rows of Arabic-medium exam papers and school book pages. The exam papers and book pages carry no | |
| clear redistribution licence. The dataset card lists each row's origin. | |
| - Diacritics: three diacritizers vote on unvocalized text. A voter may add marks, never change the source's letters. | |
| The rule-based front end reads every row and makes the phoneme labels the student learns. | |
| - Audio: [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) (`openbmb/VoxCPM2`, Apache-2.0) read every row with | |
| continuation cloning, 10 inference timesteps and CFG 2.0. Clips are 24 kHz mono, level-matched; nothing inside | |
| the speech is edited. | |
| - Screening, per clip (score sheet v3.2, frozen): phoneme label fit, written vowels, Whisper read-back, every digit | |
| heard back right, pace, pitch, edge silence, clipping, and buzz. Accepted: 11,066 of | |
| 15,343 clips (`7001`: 5,550, `7003`: 5,516). Rejected clips are | |
| not in the dataset. | |
| ## Voices | |
| Both voices are synthetic voice designs made with VoxCPM2 from a text description and a seed (7001 and 7003). No real | |
| person was cloned. Each design's sample clip and exact transcript are the teacher's prompt for every clip of that | |
| voice. The samples are the unedited originals; their hashes are pinned in the training code. | |
| No real person's voice is in this model. The question of what rights attach to a designed voice, and to the teacher | |
| that designed it, has not been settled for this project. Do not use the model for client work before it is settled. | |
| ## Limitations | |
| - Modern Standard Arabic only, and only fully diacritized input. No dialects. No diacritizer. | |
| - The harakat checks are automatic and imperfect (see [Evaluation](#evaluation)). The listening gate H4 has not run. | |
| A native speaker must listen to 100 sentences across the domains before any client use. | |
| - `7003` reads fast and pauses at fewer commas than `7001`. This is the teacher voice's own pace. | |
| - Predicted naturalness (UTMOS) is about 2 on a 1 to 5 scale for both voices; the teacher scores about 2.6 on the | |
| same sentences. A 4.5M-parameter model is not a studio voice. It targets offline and in-browser use. | |
| - The number rules cover the forms listed in Input. The front end reads other forms plainly or digit by digit. | |
| These include currencies beyond plain amounts, ordinals in running text, and mixed scripts. | |
| ## Built with | |
| | Project | Role | Licence | | |
| |---|---|---| | |
| | [tiny-voca](https://github.com/n4ze3m/tiny-voca) by Muhammed Nazeem | Model architecture, training recipe, and inference code | Apache-2.0 | | |
| | [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) ([OpenBMB/VoxCPM](https://github.com/OpenBMB/VoxCPM)) | Teacher: both voice designs and all training audio | Apache-2.0 | | |
| | [nanovllm-voxcpm](https://github.com/a710128/nanovllm-voxcpm) | Batched teacher inference | MIT | | |
| | [PyTorch](https://pytorch.org) and [ONNX Runtime](https://onnxruntime.ai) | Training, inference, and the ONNX export | BSD-3-Clause, MIT | | |
| | [wav2vec2-lv-60-espeak-cv-ft](https://huggingface.co/facebook/wav2vec2-lv-60-espeak-cv-ft) | Forced alignment for training, and judge 1 | Apache-2.0 | | |
| | [faster-whisper](https://github.com/SYSTRAN/faster-whisper) with Whisper large-v3-turbo | Word error rate and digit checks | MIT | | |
| | [stt-arabic-whisper-finetuned-diactires](https://huggingface.co/NightPrince/stt-arabic-whisper-finetuned-diactires) | Judge 2: vowels heard by a diacritizing ASR | See the model card | | |
| | [SpeechMOS](https://github.com/tarepan/SpeechMOS) (UTMOS22 strong) | Predicted naturalness | MIT | | |
| | [librosa](https://librosa.org) | Pitch (pYIN) for training targets and the sound gates | ISC | | |
| | [Modal](https://modal.com) and [trackio](https://github.com/gradio-app/trackio) | GPU training and run tracking | Service, MIT | | |
| The training data is [abdullah/tiny-voca-ar-v2-r3](https://huggingface.co/datasets/abdullah/tiny-voca-ar-v2-r3); its card cites the text and | |
| diacritization tools. The code is at [abodacs/tiny-voca-ar](https://github.com/abodacs/tiny-voca-ar). | |
| ## Cite | |
| ```bibtex | |
| @misc{tinyvocaar_v0_2_0, | |
| title = {tiny-voca-ar v0.2.0: a small two-voice Modern Standard Arabic text-to-speech model}, | |
| author = {Abdullah}, | |
| year = {2026}, | |
| url = {https://huggingface.co/abdullah/tiny-voca-ar-v2} | |
| } | |
| @software{nazeem_tinyvoca_2026, | |
| title = {tiny-voca: a 4.5M-parameter two-voice English text-to-speech model}, | |
| author = {Nazeem, Muhammed}, | |
| year = {2026}, | |
| url = {https://huggingface.co/n4ze3m/tiny-voca} | |
| } | |
| ``` | |