YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
ποΈ 10M Modern TTS Engine (2026 Tech: OT-CFM + Vocos)
An ultra-lightweight, edge-device friendly ~10 Million Parameter Text-to-Speech (TTS) engine built with Optimal Transport Conditional Flow Matching (OT-CFM), ConvNeXt-V2 1D Backbone, and Vocos 24kHz Neural Vocoder.
β‘ Why This Architecture Beats Traditional 100M Models
| Problem in Old 100M Models | Hamare 10M Modern Model Me Solution |
|---|---|
| "Robot Beep" / Constant Whistle Tone | No GAN mode collapse! OT-CFM me koi adversarial discriminator nahi hota, loss pure smooth regression hoti hai. |
| Data Starvation (Needs 1,000+ hours) | 10M size is mathematically balanced for 2β5 hours of single-speaker audio data without overfitting! |
| Words Skip / Infinite Looping | Monotonic Alignment Search (MAS): Text-to-audio alignment strictly monotonic chalti hai, 0% repetition/skipping guarantee! |
| High Latency & Expensive GPUs | Runs blazingly fast on regular CPU in only 4 to 8 ODE steps (< 60ms latency)! |
π Exact Parameter Breakdown
==================================================
10M TTS MODEL PARAMETERS SUMMARY
==================================================
Text Encoder (RoPE Transformer): 2,699,776 (~2.70M)
Duration Predictor: 395,009 (~0.40M)
Alignment Projection: 20,736 (~0.02M)
OT-CFM Vector Field: 4,973,904 (~4.97M)
--------------------------------------------------
TOTAL ACOUSTIC PARAMETERS: 8,089,425 (~8.09M)
Vocos Neural Vocoder: ~2,500,000 (~2.50M)
==================================================
COMPLETE END-TO-END SYSTEM: ~10,589,425 (~10.5M)
==================================================
π Project Structure
TTS_10M/
βββ config.py # Hyperparameters, audio config & model parameters
βββ models/
β βββ convnext.py # ConvNeXt-V2 1D blocks with GRN
β βββ text_encoder.py # Modern Transformer with RoPE embeddings
β βββ duration_predictor.py # Monotonic Alignment Search (MAS) & Duration Net
β βββ flow_matching.py # Optimal Transport CFM ODE Solvers (4-10 steps)
β βββ vocoder.py # Vocos 24kHz neural vocoder wrapper
β βββ tts_engine.py # Full unified 10M TTS Engine
βββ data/
β βββ audio_processor.py # 24kHz Mel-Spectrogram extractor & normalizer
β βββ text_cleaner.py # Universal multilingual & Hindi/English tokenizer
β βββ dataset.py # PyTorch Dataset & dynamic batch collator
β βββ hf_dataset_sync.py # 1-Click push dataset to Hugging Face Hub
βββ utils/
β βββ audio_sanity.py # Anti-Beep & NaN Quality Guardian
β βββ checkpoint.py # Safetensors save/load & HF Hub integration
βββ train.py # Training pipeline with AdamW, AMP, & Anti-Beep guards
βββ infer.py # CLI synthesis script (prints latency & RTF metrics)
βββ export_hf.py # 1-Click export & push model to Hugging Face Model Hub
βββ app.py # Interactive Gradio Web UI / Hugging Face Spaces app
βββ requirements.txt # Minimal & modern dependencies
π Step-by-Step Workflow
Step 1: Prepare & Push Dataset to Hugging Face
Audio files ko dataset/wavs/ me rakhein aur transcript file dataset/metadata.csv me:
wavs/audio_001.wav|Namaste, yeh pehla sentence hai.
wavs/audio_002.wav|Aaj mausam bohot accha hai.
Apne dataset ko direct Hugging Face Datasets par push karne ke liye:
python data/hf_dataset_sync.py --data_dir dataset --metadata dataset/metadata.csv --repo_id ViuAI/ViuAI_TTS_Dataset
Step 2: Model Training
Aap local metadata se ya direct Hugging Face Dataset se train kar sakte hain:
Option A: Direct Hugging Face Dataset se train karein:
python train.py --hf_dataset ViuAI/ViuAI_TTS_Dataset --language hi --speaker indic_hi_male_1 --epochs 100 --batch_size 16
Option B: Local metadata.csv se train karein:
python train.py --metadata dataset/metadata.csv --epochs 100 --batch_size 16 --lr 2e-4
- Training ke dauran
AudioSanityGuardianhar step par check karega ki koi robotic beep ya NaN na bane. - Har checkpoint par sample audio automatic
checkpoints/samples/folder me generate hogi.
Step 3: Fast Inference
Inference chalane ke liye:
python infer.py --text "Namaste! Yeh hamara 10M modern TTS model bol raha hai." --checkpoint checkpoints/model.safetensors --steps 8
Output output.wav me 24,000 Hz studio quality me save ho jayega.
Step 4: Push Model to Hugging Face Model Hub
Apne trained model weights aur official Model Card ko 1 click me Hugging Face par publish karein:
python export_hf.py --checkpoint checkpoints/model.safetensors --repo_id ViuAI/TTS-10M-Modern
Step 5: Interactive Web UI (Gradio / HF Spaces)
Browser me interactive demo chalane ke liye:
python app.py
Yeh demo direct Hugging Face Spaces par bina kisi code change ke deploy kiya ja sakta hai!