Download config.py from ViuAI/Murli-V2-Code: direct link, hf CLI and curl.
- Browser
- Download file 3.09 kB
-
https://huggingface.co/ViuAI/Murli-V2-Code/resolve/main/config.py
- Command line
-
hf download hf://ViuAI/Murli-V2-Code/config.py
-
curl -L -o config.py https://huggingface.co/ViuAI/Murli-V2-Code/resolve/main/config.py
3.09 kB
| """ | |
| Configuration for Murli V2.0 — 50M+ Bilingual (Hindi + English) Zero-Shot DiT TTS. | |
| """ | |
| from dataclasses import dataclass, field | |
| class AudioConfig: | |
| sample_rate: int = 24000 | |
| n_fft: int = 1024 | |
| win_length: int = 1024 | |
| hop_length: int = 256 | |
| n_mels: int = 100 | |
| f_min: float = 0.0 | |
| f_max: float = 12000.0 | |
| mel_scale: str = "htk" | |
| center: bool = True | |
| mel_min_clip: float = 1e-7 | |
| f0_min: float = 50.0 | |
| f0_max: float = 600.0 | |
| class ModelConfig: | |
| # Unified IPA + Prosody vocabulary (matches data/text_cleaner.py) | |
| vocab_size: int = 256 | |
| max_seq_len: int = 2048 | |
| n_mels: int = 100 | |
| # Bilingual Text Encoder (ConvNeXt-V2 local + RoPE SwiGLU Transformer) | |
| text_dim: int = 384 | |
| text_layers: int = 6 | |
| text_heads: int = 6 | |
| text_ff_mult: float = 2.667 | |
| # Zero-Shot Speaker / Style Perceiver Resampler | |
| style_dim: int = 384 | |
| style_tokens: int = 16 | |
| style_layers: int = 4 | |
| style_heads: int = 6 | |
| # Duration + Pitch (F0) + Energy Predictor | |
| prosody_dim: int = 384 | |
| prosody_layers: int = 4 | |
| prosody_kernel: int = 5 | |
| duration_loss_weight: float = 1.5 | |
| f0_loss_weight: float = 1.0 | |
| energy_loss_weight: float = 0.5 | |
| prior_loss_weight: float = 0.5 | |
| # 2026 Diffusion Transformer (DiT) OT-CFM Vector Field (~66M trainable engine) | |
| dit_dim: int = 512 | |
| dit_layers: int = 8 | |
| dit_heads: int = 8 | |
| dit_ff_mult: float = 2.667 | |
| dropout: float = 0.05 | |
| # Classifier-Free Guidance & Flow Sampling | |
| cfg_drop_prob: float = 0.1 | |
| default_ode_steps: int = 32 | |
| default_ode_method: str = "midpoint" # "euler" or "midpoint" | |
| default_cfg_scale: float = 1.8 | |
| default_temperature: float = 0.65 | |
| sway_sampling_coef: float = -1.0 | |
| # Vocoder backend: "vocos" (24kHz 100-band) or "bigvgan_v2" | |
| vocoder_backend: str = "vocos" | |
| class TrainingConfig: | |
| batch_size: int = 32 | |
| grad_accum_steps: int = 2 | |
| learning_rate: float = 1.5e-4 | |
| min_lr: float = 1e-6 | |
| weight_decay: float = 0.01 | |
| warmup_steps: int = 2000 | |
| max_epochs: int = 200 | |
| max_grad_norm: float = 1.0 | |
| ema_decay: float = 0.9999 | |
| use_bf16: bool = True | |
| grad_checkpointing: bool = False | |
| save_every_steps: int = 2500 | |
| log_every_steps: int = 25 | |
| checkpoint_dir: str = "checkpoints" | |
| class HFConfig: | |
| code_repo_id: str = "ViuAI/Murli-V2-Code" | |
| release_repo_id: str = "ViuAI/Murli-V2.0" | |
| dataset_repo_id: str = "ViuAI/Murli_TTS_Dataset" | |
| class MurliV2Config: | |
| audio: AudioConfig = field(default_factory=AudioConfig) | |
| model: ModelConfig = field(default_factory=ModelConfig) | |
| training: TrainingConfig = field(default_factory=TrainingConfig) | |
| hf: HFConfig = field(default_factory=HFConfig) | |
| def __post_init__(self): | |
| if self.model.vocoder_backend == "bigvgan_v2": | |
| self.audio.mel_scale = "slaney" | |
| self.audio.center = False | |
| self.audio.mel_min_clip = 1e-5 | |