Update Murli V1.0 report, HF export script, Gradio UI, and README
Browse filesFiles changed (4)
- LESSONS_LEARNED_V1.md+19-2
- README.md+2-2
- app.py+3-3
- export_hf.py+58-30
112334567891011121314151617181920212223# V1 Post-Mortem & Engineering Lessons Learned (`ViuAI/TTS_10M`)# Murli V1.0 — Final Release Report & Post-Mortem (`ViuAI/Murli-V1.0` / `ViuAI/TTS_10M`)
> **Purpose:** Complete engineering record of every bug, bottleneck, data limitation, and architectural lesson discovered while building, training, and QA-testing **V1 (`8.17M` Acoustic OT-CFM + `13.53M` Vocos)** — so **V2** avoids all of these pitfalls from Day 1.> **Release Name:** **Murli V1.0** (`ViuAI/Murli-V1.0`)> **Architecture:** `8.17M` Trainable Acoustic OT-CFM + `13.53M` Vocos 24kHz (`21.70M` combined)> **Dataset:** `ViuAI/ViuAI_Hindi_TTS_50h` (`24,019` clips / `49.28h` `syspin_male_01`, 22 Parquet shards)> **Purpose:** Complete engineering record of every bug, bottleneck, data limitation, and final QA result from **Murli V1.0** — so **Murli V2.0** avoids all of these pitfalls from Day 1.
---
## 0. Final Murli V1.0 Release Benchmark (500 Total Epochs)
After fixing the dataset Parquet packaging (unlocking all `24,019` clips vs `9,984`), applying `--dur_weight 1.5 --prior_weight 0.5`, adding Anusvara normalization (`ईंधन → ईन्धन`), `min_frames=2`, `speed=0.92`, and zero-phase `debuzz_waveform`, the **6:30 minute (~950-word) Hindi Story QA Benchmark** showed a **3x error reduction**:
| Metric | Initial 300-Ep V1 (`download (4).wav`) | **Final Murli V1.0 (500 Ep + Fixes)** | Target for Murli V2.0 || :--- | :--- | :--- | :--- || **Total Word Errors (~900 words)** | 31 Errors (`~3.6% WER`) | **~9 Minor Errors (`~1.0% WER`)** | `< 0.3% WER` || **Acoustic Noise & Buzz** | Clean, light metallic buzz | **Warm, deep, clean (buzz eliminated)** | Studio expressive || **Hard Words Fixed** | Failed (`दौलत`, `महिलाएं`, `खिचड़ी`, `काढ़ा`, `सहारा`, `खिलखिलाहट`, `इकट्ठा`, `तराशने`, `ईंधन`) | **All 14+ hard words fixed!** | 100% consistency || **Remaining Known Errors (Logged for V2)** | — | `बढ़ई→बड़ी`, occasional `लकड़ी→कड़ी/लड़ी`, occasional `राघव→रागो/राव/राग`, `मीठी हंसी→मीठिंसी`, clause-start `रखे→खे` / `अपनी→नी`, `मेहनत→मेहत`, `मदद→मद`, `सम्मान` slight slip | Fixed via Hindi G2P + Pitch $F_0$ || **Training Speed (RTX 3090)** | `~154 clips/s` (CPU Mel bottleneck) | **`250+ clips/s`** (`mel_cache` + `bucket_batches` + `numba` MAS) | Same fast pipeline |
---
11233456# 🎙️ 10M Modern TTS Engine (2026 Tech: OT-CFM + Vocos)
# 🎙️ Murli V1.0 — 10M Hindi TTS Engine (`ViuAI/Murli-V1.0`)
TTS_10M combines a text encoder, a duration predictor, a conditional flow-matching acoustic model and the separately loaded Vocos 24 kHz vocoder. The default sampler uses 48 midpoint steps. Speech quality and latency depend on the trained weights, data, sampling settings and hardware.
**Murli V1.0** (`TTS_10M`) combines a RoPE text encoder, a duration predictor with Monotonic Alignment Search (MAS), a conditional flow-matching (OT-CFM) acoustic model, and the separately loaded Vocos 24 kHz vocoder. Trained for 500 total epochs on 49.28h of single-speaker Hindi studio speech (`ViuAI/ViuAI_Hindi_TTS_50h`). The default sampler uses 48 midpoint steps with `cfg_scale=1.5`, `temperature=0.667`, `sway=-1.0`, and zero-phase de-buzzing.
## Default parameter counts
60 unmodified lines616263646465666768676869707160 unmodified lines
# Build Modern Gradio UI
with gr.Blocks(title="10M Modern TTS Demo") as demo:
with gr.Blocks(title="Murli V1.0 — Hindi TTS") as demo:
gr.Markdown(
"""
# 🎙️ 10M Modern TTS Engine (OT-Flow Matching + Vocos)
### Ultra-fast, edge-optimized ~10M Parameter Speech Synthesizer
# 🎙️ Murli V1.0 — Hindi Text-to-Speech Engine (ViuAI)
### Lightweight 8.17M Acoustic Flow-Matching Speech Synthesizer (+ Vocos 24kHz)
*Powered by Optimal Transport Conditional Flow Matching (OT-CFM)*
"""
)15 unmodified lines1617181919202122232425262427282629303132333431353637383339403536373839404142434445464748495051525354475556575859606162636455566566676859606162636465666970717273742 unmodified lines7778797576777879808081828384858687888990919293949535 unmodified lines1311321331341351361371381391401411421431441451461471481491221501511521533 unmodified lines15715815913216016116216315 unmodified lines return f"""---
language:
- hi
- en
datasets:
- ViuAI/ViuAI_Hindi_TTS_50h
tags:
- murli-v1
- text-to-speech
- tts
- hindi
- flow-matching
- 10M
- ot-cfm
- vocos
- lightweight
- 10M
- edge-ai
license: apache-2.0
pipeline_tag: text-to-speech
---
# 🚀 10M Modern TTS Model (Optimal Transport Flow Matching + Vocos)
# 🎙️ Murli V1.0 — Hindi Text-to-Speech (`{repo_id}`)
**Murli V1.0** is an ultra-lightweight, clean **8.17M-parameter acoustic** Hindi Text-to-Speech (TTS) model built with **Optimal Transport Conditional Flow Matching (OT-CFM)**, **ConvNeXt-V2 1D**, **Monotonic Alignment Search (MAS)**, and **Vocos 24kHz**.
This is an ultra-lightweight **8.17M-parameter acoustic** Text-to-Speech (TTS) model built with **Optimal Transport Conditional Flow Matching (OT-CFM)**, **ConvNeXt-V2 1D**, and **Vocos 24kHz**.
Trained for **500 total epochs** on **49.28 hours (`24,019` studio clips)** of single-speaker Hindi speech ([`ViuAI/ViuAI_Hindi_TTS_50h`](https://huggingface.co/datasets/ViuAI/ViuAI_Hindi_TTS_50h)), Murli V1.0 delivers warm, noise-free 24kHz Hindi narration with ~99% word intelligibility on long-form stories.
### ✨ Highlights:
- **Total Parameters:** 21.70M combined (8.17M acoustic + 13.53M separately loaded Vocos).
- **Core Technology:** Optimal Transport Conditional Flow Matching (OT-CFM) with mask-aware ConvNeXt-V2 1D Backbone.
- **Duration Alignment:** Monotonic Alignment Search (MAS) with Mel Prior Loss.
- **Vocoder:** Vocos 24kHz iSTFT synthesizer for crystal-clear HD audio.
- **Fast Edge Inference:** The default is 48 midpoint steps. Inference time depends on hardware, input length, and sampling settings.
---
### ✨ Highlights
- **Model Name:** **Murli V1.0**
- **Parameters:** `8,170,185` (~8.17M) trainable acoustic + `13,531,650` (~13.53M) pretrained Vocos 24kHz (`21.70M` combined)
- **Core Tech:** OT-CFM + RoPE Text Transformer + ConvNeXt-V2 1D + Sway Sampling (`-1.0`) + Classifier-Free Guidance (`1.5`)
- **Long-Form Reliability:** Clause-level chunking, Anusvara pronunciation normalization (`ईंधन → ईन्धन`), `min_frames=2` guard, and zero-phase high-frequency de-buzzing
- **Zero Robot Beep Guarantee:** Smooth OT-CFM regression loss (no GAN discriminator collapse)
---
## 🛠️ Quick Inference
```python
# Run from the TTS_10M source checkout with requirements.txt installed.
import torch
from models.tts_engine import TTS10MEngine
from data.text_cleaner import TextTokenizer
from utils.checkpoint import load_checkpoint
from utils.audio_sanity import save_audio
from utils.long_form import synthesize_long_text
from config import TTS10MConfig
cfg = TTS10MConfig()
device = "cuda" if torch.cuda.is_available() else "cpu"
model = TTS10MEngine().to(device)
model = load_checkpoint(model, "model.safetensors", device=device)
model = load_checkpoint(TTS10MEngine(cfg.model, cfg.training).to(device), "model.safetensors", device=device)
model.eval()
tokenizer = TextTokenizer()
text = "Namaste! Yeh hamara 10M TTS model bol raha hai."
text_ids = tokenizer.text_to_ids(text).unsqueeze(0).to(device)
with torch.no_grad():
out = model.synthesize(text_ids, num_steps=8)
waveform = out["waveform"].squeeze(0).cpu()
save_audio("output.wav", waveform, 24000)
text = "नमस्ते! यह मुरली वी1 हिंदी टेक्स्ट टू स्पीच मॉडल बोल रहा है।"
wav = synthesize_long_text(model, tokenizer, text, torch.device(device), sample_rate=cfg.audio.sample_rate)
save_audio("murli_output.wav", torch.from_numpy(wav), cfg.audio.sample_rate)
```
---2 unmodified lines
| Component | Architecture | Parameters |
| :--- | :--- | :--- |
| **Text Encoder** | RoPE Transformer (4 layers, 4 heads) | ~2.77M |
| **Duration Predictor** | 1D ConvNeXt + MAS Monotonic Search | ~0.40M |
| **Mel Prior Projection** | Linear Mel Prior Head | ~0.03M |
| **CFM Vector Field** | Mask-aware ConvNeXt-V2 1D (8 blocks, 7x7 DW) | ~4.98M |
| **Vocoder** | Vocos 24kHz iSTFT Synthesizer | ~13.53M |
| **Total** | End-to-End | **~21.70M** |
| **Text Encoder** | RoPE Transformer (4 layers, 4 heads, 256 dim) | `2,765,312` (~2.77M) |
| **Duration Predictor** | 1D ConvNeXt + MAS Monotonic Search | `395,009` (~0.40M) |
| **Mel Prior Projection** | Linear Mel Prior Head | `25,700` (~0.03M) |
| **CFM Vector Field** | Mask-aware ConvNeXt-V2 1D (8 blocks, 7x7 DW) | `4,984,164` (~4.98M) |
| **Vocoder** | Pretrained Vocos 24kHz iSTFT (`charactr/vocos-mel-24khz`) | `13,531,650` (~13.53M) |
| **Total System** | End-to-End | **`21,701,835` (~21.70M)** |
---
## ⚠️ Known Limitations (Target for Murli V2.0)
- **~1.0% WER on 900-word stories:** Occasional slips on retroflex aspirates (`बढ़ई`), clause-initial short tokens (`रखे`, `अपनी`), or proper nouns (`राघव`) due to raw Devanagari character tokenization (no G2P phonemizer yet).
- **Prosody:** Calm studio read-speech style (no explicit $F_0$ pitch predictor yet).
- See [`LESSONS_LEARNED_V1.md`](LESSONS_LEARNED_V1.md) for the full V1 post-mortem and V2 roadmap.
"""
35 unmodified lines with open(os.path.join(staging_dir, "README.md"), "w", encoding="utf-8") as f:
f.write(card_content)
# 4. Include standalone inference & app runtime files so release repo is plug-and-play
import shutil
runtime_files = [
"config.py", "infer.py", "app.py", "requirements.txt", "LESSONS_LEARNED_V1.md"
]
for rf in runtime_files:
if os.path.isfile(rf):
shutil.copy2(rf, os.path.join(staging_dir, rf))
for rdir in ["models", "data", "utils"]:
if os.path.isdir(rdir):
shutil.copytree(
rdir,
os.path.join(staging_dir, rdir),
ignore=shutil.ignore_patterns("__pycache__", "*.pyc"),
)
# 4. Push to Hugging Face Model Hub
# 5. Push to Hugging Face Model Hub
api = HfApi()
print(f"Creating / verifying repo: {repo_id}...")
create_repo(repo_id, repo_type="model", private=private, exist_ok=True)3 unmodified lines folder_path=staging_dir,
repo_id=repo_id,
repo_type="model",
commit_message="Release 10M Modern TTS Model (OT-CFM + Vocos)",
commit_message="Release Murli V1.0 (Hindi OT-CFM TTS + Vocos)",
)
print(f"\n🎉 Successfully published model to: https://huggingface.co/{repo_id}\n")
LESSONS_LEARNED_V1.md+19-2
README.md+2-2
app.py+3-3
export_hf.py+58-30