Download config.py from ViuAI/Murli-V1.6-Code: direct link, hf CLI and curl.
- Browser
- Download file 4.3 kB
-
https://huggingface.co/ViuAI/Murli-V1.6-Code/resolve/main/config.py
- Command line
-
hf download hf://ViuAI/Murli-V1.6-Code/config.py
-
curl -L -o config.py https://huggingface.co/ViuAI/Murli-V1.6-Code/resolve/main/config.py
4.3 kB
| """ | |
| Murli V1.6 Configuration — 2026 Single-Speaker (syspin_male_01, 49.28h @ 53.1 dB SNR) Only-Hindi Studio TTS. | |
| Hybrid ConvNeXt-V2 + RoPE DiT Self-Attention CFM (AdaLN-Zero) + Smooth Frame-Level Prosody. | |
| """ | |
| from dataclasses import dataclass, field | |
| from typing import Dict, List, Optional, Tuple | |
| EMOTION_TO_ID: Dict[str, int] = { | |
| "neutral": 0, | |
| "happy": 1, | |
| "sad": 2, | |
| "angry": 3, | |
| "surprise": 4, | |
| "fear": 5, | |
| "disgust": 6, | |
| "story": 7, | |
| } | |
| # Verified Studio Voices in ViuAI/Murli_TTS_Dataset (~108.8h total across 3 clean speakers) | |
| SPEAKER_TO_ID: Dict[str, int] = { | |
| "syspin_male_01": 0, # hindi_50h (49.28h, 53.1 dB SNR Male Studio) | |
| "kalita_rasa_male_01": 1, # hindi_kalita (12.88h, 44.4 dB SNR Expressive Rasa Male) | |
| "iisc_f_hindi_female_spk001": 2, # hindi_female_iisc (46.63h+, 50.0 dB SNR Female Studio) | |
| } | |
| SPEAKER_ALIASES: Dict[str, int] = { | |
| "syspin_male": 0, | |
| "male": 0, | |
| "rasa_male": 1, | |
| "kalita_male": 1, | |
| "iisc_female": 2, | |
| "female": 2, | |
| **SPEAKER_TO_ID, | |
| } | |
| # Default Single-Speaker Only-Hindi corpus source: (hf_subdir, speaker_filter_or_none) | |
| DEFAULT_CORPUS_SOURCES: List[Tuple[str, Optional[str]]] = [ | |
| ("hindi_50h", "syspin_male_01"), | |
| ] | |
| class AudioConfig: | |
| sample_rate: int = 24000 | |
| n_fft: int = 1024 | |
| hop_length: int = 256 | |
| win_length: int = 1024 | |
| n_mels: int = 100 | |
| f_min: float = 0.0 | |
| f_max: float = 12000.0 | |
| mel_scale: str = "htk" | |
| mel_min_clip: float = 1e-5 | |
| f0_min: float = 50.0 | |
| f0_max: float = 550.0 | |
| center: bool = True | |
| mel_mean: float = -6.0 | |
| mel_std: float = 2.5 | |
| class ModelConfig: | |
| vocab_size: int = 256 | |
| num_speakers: int = 4 # 0=syspin_male_01, 1=kalita_rasa_male_01, 2=iisc_female, 3=reserved | |
| num_emotions: int = 8 | |
| # Text Encoder (6-layer RoPE SwiGLU + 2 local ConvNeXt blocks) | |
| text_dim: int = 320 | |
| text_layers: int = 6 | |
| text_heads: int = 5 | |
| text_ff_mult: float = 2.667 | |
| text_dropout: float = 0.05 | |
| # Prosody & Alignment (Speaker + Emotion + ConvNeXt Prior + Smooth Frame F0/Energy + MAS) | |
| prosody_kernel_size: int = 5 | |
| prosody_layers: int = 3 | |
| # 2026 Hybrid ConvNeXt-V2 + RoPE DiT Self-Attention OT-CFM (AdaLN-Zero) | |
| mel_dim: int = 100 | |
| cfm_hidden_dim: int = 384 | |
| cfm_blocks: int = 12 | |
| cfm_kernel_size: int = 7 | |
| cfm_attn_heads: int = 6 | |
| cfm_attn_every: int = 3 # Insert RoPE DiT Attention every 3 ConvNeXt blocks (4 global attn layers) | |
| cfm_time_dim: int = 128 | |
| cfg_drop_prob: float = 0.1 | |
| vocoder_repo: str = "charactr/vocos-mel-24khz" | |
| # Winning Natural Smooth defaults | |
| default_speed: float = 0.88 | |
| min_frames: int = 2 | |
| default_steps: int = 48 | |
| default_cfg_scale: float = 1.3 | |
| default_temperature: float = 0.88 | |
| class TrainConfig: | |
| hf_dataset_name: str = "ViuAI/Murli_TTS_Dataset" | |
| data_subdirs: List[str] = field(default_factory=lambda: [ | |
| "hindi_50h", | |
| ]) | |
| target_speakers: Optional[List[str]] = field(default_factory=lambda: [ | |
| "syspin_male_01", | |
| ]) | |
| language: Optional[str] = "hi" | |
| target_gender: Optional[str] = None | |
| max_samples: Optional[int] = None | |
| cache_dir: str = "cache_v1_6" | |
| checkpoint_dir: str = "checkpoints_v1_6" | |
| sample_dir: str = "samples_v1_6" | |
| batch_size: int = 32 | |
| grad_accum_steps: int = 1 | |
| num_workers: int = 8 | |
| max_epochs: int = 600 | |
| max_steps: int = 300_000 | |
| lr: float = 2.5e-4 | |
| min_lr: float = 1e-5 | |
| warmup_steps: int = 2000 | |
| weight_decay: float = 0.01 | |
| grad_clip: float = 1.0 | |
| ema_decay: float = 0.9995 | |
| use_amp: bool = True | |
| compile_model: bool = False | |
| cfm_loss_weight: float = 1.0 | |
| prior_loss_weight: float = 0.5 | |
| dur_loss_weight: float = 1.0 | |
| f0_loss_weight: float = 0.6 | |
| energy_loss_weight: float = 0.5 | |
| frame_prosody_loss_weight: float = 0.4 | |
| log_every: int = 50 | |
| val_every: int = 1000 | |
| save_every: int = 5000 | |
| sample_every: int = 25_000 | |
| hf_backup_every: int = 50_000 | |
| hf_sample_repo: Optional[str] = None | |
| seed: int = 42 | |
| class MurliV16Config: | |
| audio: AudioConfig = field(default_factory=AudioConfig) | |
| model: ModelConfig = field(default_factory=ModelConfig) | |
| train: TrainConfig = field(default_factory=TrainConfig) | |