tiny-ava

mehdi-hf/tiny-ava

作者
mehdi-hf
任务
语音合成
下载量
524
点赞数
34
趋势分
21
许可证
cc-by-4.0
收录时间
2026/11/24

license: cc-by-4.0 language:

  • fa pipeline_tag: text-to-speech tags:
  • text-to-speech
  • persian
  • farsi
  • onnx
  • tiny-voca
  • cpu

tiny-ava

tiny-ava is a tiny 4.5M-parameter Persian (Farsi) text-to-speech model trained from scratch on top of the tiny-voca architecture. Including the built-in waveform generator, the complete model is ~18 MB (PyTorch) / ~20 MB (ONNX) and runs 38× faster than real time on 1 CPU thread (77× real time on 4 CPU threads).

Parameters4,531,147
Voiceparisa (Persian female)
Output24 kHz mono
InputPersian IPA tokens (46 symbols) + 3-class stress/ezafe channel
CPU speed (acoustic + vocoder)38.5× real time (1 thread) · 77.4× real time (4 threads)
Pretrained weights in the modelNone (trained from scratch)
LicenseCC BY 4.0 (free for all use, including commercial, with attribution)

Files

FileSizeContents
tiny-ava-parisa.pt18.2 MBPyTorch inference weights, float32
onnx/tiny-ava-parisa.onnx20.4 MBONNX export, float32, opset 17
onnx/tiny-ava-parisa.json761 BSymbol table (46 symbols), voice map, and runtime metadata
config.json674 BModel & acoustic DSP configuration
samples/2.5 MB12 sample 24 kHz WAVs
charts/training_curves.png—104k-step training & validation curves

SHA256:

  • tiny-ava-parisa.pt: 698d43ea896eaa95bb6a444218097187fffb34b861710bd81a44a069eb4ab3d7
  • onnx/tiny-ava-parisa.onnx: 4e387b2f28a6d65916ed7c33ecdac4428135e9adfc13e1734b77592e6993a340

Samples (24 kHz, Parisa Voice)

CategoryPersian TextAudio
Greeting & questionسلام، حال شما چطور است؟ امروز هوای تهران آفتابی است.
Ezafe chainنشست سران سیاسی کشورهای عضو به خوبی پیش رفت.
Explicit kasra (ـِ)بارانِ ریزی روی آسفالتِ خیسِ خیابان می‌بارد.
Homograph (تست → tost)من هر روز صبح نان تست داغ با کره و عسل می‌خورم.
Homograph (گل → gol)گل قرمز زیبایی را روی میز گذاشت و لبخند زد.
Homograph + diacritic (گِل)کفش‌هایم بعد از باران پر از گِل و لای شد.
Homograph (مرد → mord)حیوان خانگی من دیروز در اثر گرمای شدید بیهوش شد و مرد.
Question (؟)آیا واقعاً فکر کردی که تولد تو را فراموش می‌کنم؟
Persian uvulars (ق/غ/خ/ع)قصر قدیم در کنار غار خاموش و عمیق کوهستان قرار دارد.
Long sentenceتوسعه مدل‌های کوچک هوش مصنوعی باعث می‌شود که فناوری تبدیل متن به گفتار بدون نیاز به سرور و اینترنت روی دستگاه‌های معمولی اجرا شود.
Colloquial Persianسلام، چطوری؟ دیگه باید برم، نمی‌تونم بیشتر بمونم.

ONNX Interface

The ONNX graph (onnx/tiny-ava-parisa.onnx) takes Persian IPA token IDs and stress/ezafe values and directly outputs a 24 kHz waveform. Text-to-phoneme conversion runs outside the graph using either mehdi-hf/persian-g2p-tiny (16 MB) or mehdi-hf/persian-g2p-0.6b (596M), mapped to the 46-symbol table in onnx/tiny-ava-parisa.json.

Inputs

InputTypeShapeMeaning
tokensint64[1, N]Persian IPA & punctuation IDs (0..45), wrapped with <bos> and <eos>
stressint64[1, N]0 unstressed, 1 word-final primary lexical stress, 2 explicit ezafe (-e/-ye)
voiceint64[1]0 (parisa)
speedfloat32[1]Speaking rate (1.0 default; larger is faster)
pitch_shiftfloat32[1]Added to log F0 (0.058 ≈ +1 semitone)
pitch_rangefloat32[1]Scales pitch movement around utterance mean (1.0–1.1 recommended)

Outputs

OutputTypeShapeMeaning
audiofloat32[1, samples]24 kHz mono waveform (scale peak to ≤ 0.99 before 16-bit WAV export)
durationsint64[1, N]Predicted duration per token in frames (256 samples = 10.67 ms per frame)

Architecture

Built on the exact tiny-voca feed-forward transformer + complex-cepstrum source-filter architecture, adapted for Persian:

  • 46-symbol Persian vocabulary: 5 specials, 12 Persian/standard punctuation pause carriers (،, ., ؟, !, ؛, :, «, », (, ), —, …), 23 consonants, and 6 vowels (a, e, o, i, u, ɑ).
  • Text encoder: 4 Conformer-style RoPE blocks (192 channels, 4 heads, kernel-7 depthwise conv, 640 FFN).
  • Duration & pause predictor: Separate duration regression + binary pause-presence head for commas, periods, and word boundaries.
  • Prosody & acoustic stacks: 2 frame blocks predicting log-F0, voicing, and energy + 5 frame blocks predicting harmonic & noise filter cepstra.
  • Source-filter waveform head (25.9k params): Anti-aliased float64 harmonic pulse train + causal/anticausal complex-cepstrum filtering + 4-subframe noise branch (no neural vocoder required).

Training & Evaluation

  • Training data: 8,033 clean punctuated Parisa clips (19.97 hours, 24 kHz), annotated with mehdi-hf/persian-g2p-0.6b and offline CTC forced alignment (facebook/wav2vec2-lv-60-espeak-cv-ft, 99.73% QC acceptance, 88.6% fricative-to-vowel voicing flip within 2 frames).
  • Training schedule: 104,000 steps on 1× NVIDIA A100-80GB (~5.5 hours). Spectral + prosody losses for the first 8,000 steps, followed by multi-period and multi-resolution GAN discriminators (--gan-ratio 0.7, --teacher-final 0).

Held-Out Test Evaluation (50 clips, faster-whisper large-v3, language="fa")

ModelPersian CER ↓Persian WER ↓CPU Speed (1 thread / 4 threads)
tiny-ava (parisa, 4.53M)6.95% (0.85× teacher)36.96% (0.92× teacher)38.5× / 77.4× real time
Teacher recordings (reference floor)8.20%40.22%—

Training Curves


Limitations

  • Single fixed female voice (parisa); no voice cloning.
  • Pronunciation accuracy on rare homographs, numbers, and out-of-vocabulary loanwords depends on the upstream Persian G2P frontend (typing explicit ـَ, ـِ, ـُ diacritics lets you override pronunciation deterministically).
  • Deterministic prosody: the same input text is always spoken with the same cadence.
  • Utterance-level generation (not frame-streaming), though a 5-second Persian sentence synthesizes in ~65 ms on 4 CPU threads.

License & Credits

  • Model Weights License: CC BY 4.0 (Creative Commons Attribution 4.0 International) — free for personal, research, and commercial use as long as you give credit.
  • Required Attribution: Please include "Powered by tiny-ava (Mehdi Allahyari / OncillaAI)" with a link to mehdi-hf/tiny-ava.
  • Architecture: Based on n4ze3m/tiny-voca (Apache-2.0) by Muhammed Nazeem.
  • Offline Aligner (annotation only): facebook/wav2vec2-lv-60-espeak-cv-ft (Apache-2.0).

内容来源:Hugging Face 模型卡

在 Hugging Face 查看