Co-authored-by: gaoyang07 <Gary1546308416AL@gmail.com> Co-authored-by: cms42 <c@cms42.top> Co-authored-by: cms42 <44895820+cms42@users.noreply.github.com> Co-authored-by: Ruixiao Li <cgruixiao@outlook.com> Co-authored-by: Li Ruixiao(SII) <80368770+Li-dongyang@users.noreply.github.com>
31 lines
919 B
Python
31 lines
919 B
Python
# Copied and adapted from: mossVG/mova/diffusion/models/dac_vae.py
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import List
|
|
|
|
from sglang.multimodal_gen.configs.models.base import ArchConfig, ModelConfig
|
|
|
|
|
|
@dataclass
|
|
class DacVAEArchConfig(ArchConfig):
|
|
codebook_dim: int = 8
|
|
codebook_size: int = 1024
|
|
continuous: bool = True
|
|
decoder_dim: int = 2048
|
|
decoder_rates: List[int] = field(default_factory=lambda: [8, 5, 4, 3, 2])
|
|
encoder_dim: int = 128
|
|
encoder_rates: List[int] = field(default_factory=lambda: [2, 3, 4, 5, 8])
|
|
hop_length: int = 3840
|
|
latent_dim: int = 128
|
|
n_codebooks: int = 9
|
|
quantizer_dropout: bool = False
|
|
sample_rate: int = 48000
|
|
|
|
|
|
@dataclass
|
|
class DacVAEConfig(ModelConfig):
|
|
arch_config: DacVAEArchConfig = field(default_factory=DacVAEArchConfig)
|
|
load_encoder: bool = True
|
|
load_decoder: bool = True
|