Download config.py from ViuAI/Murli-V1.5-Code: direct link, hf CLI and curl.
- Browser
- Download file 3.55 kB
-
https://huggingface.co/ViuAI/Murli-V1.5-Code/resolve/main/config.py
- Command line
-
hf download hf://ViuAI/Murli-V1.5-Code/config.py
-
curl -L -o config.py https://huggingface.co/ViuAI/Murli-V1.5-Code/resolve/main/config.py
3.55 kB
| """ | |
| Murli V1.5 Configuration — Single-Speaker Studio-Grade Expressive Hindi TTS. | |
| Targeted fixes for every Murli V1.0 issue while staying lightweight (~20M) for Android ONNX. | |
| """ | |
| from dataclasses import dataclass, field | |
| from typing import Dict, List, Optional | |
| EMOTION_TO_ID: Dict[str, int] = { | |
| "neutral": 0, | |
| "happy": 1, | |
| "sad": 2, | |
| "angry": 3, | |
| "surprise": 4, | |
| "fear": 5, | |
| "disgust": 6, | |
| "story": 7, | |
| } | |
| 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 # Vocos 24kHz HTK mel: Nyquist (12000 Hz) | |
| 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: | |
| # Unified IPA / Hindi G2P vocabulary (fixes V1 raw char slips: Anusvara, schwa, ड़/ढ़, proper nouns) | |
| vocab_size: int = 256 | |
| 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 (ConvNeXt Prior + Duration + Log-F0 Pitch + Energy + FP32 MAS) | |
| prosody_kernel_size: int = 5 | |
| prosody_layers: int = 3 | |
| # ConvNeXt-V2 OT-CFM Vector Field (pure Conv1d/Linear/GRN -> fast Android ONNX) | |
| mel_dim: int = 100 | |
| cfm_hidden_dim: int = 384 | |
| cfm_blocks: int = 12 | |
| cfm_kernel_size: int = 7 | |
| cfm_time_dim: int = 128 | |
| cfg_drop_prob: float = 0.1 | |
| # Vocoder | |
| vocoder_repo: str = "charactr/vocos-mel-24khz" | |
| # Inference defaults (V1 lessons: min_frames=2 prevents short/edge char drop, speed=0.92 crisp) | |
| default_speed: float = 0.92 | |
| min_frames: int = 2 | |
| default_steps: int = 48 | |
| default_cfg_scale: float = 1.3 | |
| default_temperature: float = 0.90 | |
| class TrainConfig: | |
| hf_dataset_name: str = "ViuAI/Murli_TTS_Dataset" | |
| data_subdirs: List[str] = field(default_factory=lambda: ["hindi_50h"]) | |
| target_speaker: Optional[str] = "syspin_male_01" # Set to single studio speaker_id for strict 1-speaker training | |
| target_gender: Optional[str] = None # Optional gender filter (e.g. 'female' or 'male') for Rasa | |
| max_samples: Optional[int] = None | |
| cache_dir: str = "cache_v1_5" | |
| checkpoint_dir: str = "checkpoints_v1_5" | |
| sample_dir: str = "samples_v1_5" | |
| batch_size: int = 16 | |
| grad_accum_steps: int = 2 | |
| num_workers: int = 4 | |
| max_epochs: int = 300 | |
| max_steps: int = 200_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 | |
| use_amp: bool = True | |
| # Loss weights | |
| cfm_loss_weight: float = 1.0 | |
| prior_loss_weight: float = 0.5 | |
| dur_loss_weight: float = 1.0 | |
| f0_loss_weight: float = 0.5 | |
| energy_loss_weight: float = 0.5 | |
| log_every: int = 50 | |
| val_every: int = 1000 | |
| save_every: int = 2500 | |
| sample_every: int = 50_000 | |
| hf_backup_every: int = 50_000 | |
| hf_sample_repo: Optional[str] = None | |
| seed: int = 42 | |
| class MurliV15Config: | |
| audio: AudioConfig = field(default_factory=AudioConfig) | |
| model: ModelConfig = field(default_factory=ModelConfig) | |
| train: TrainConfig = field(default_factory=TrainConfig) | |