configuration_dac.py 648 Bytes
Newer Older
eustlb's avatar
eustlb committed
1

Yoach Lacombe's avatar
add DAC  
Yoach Lacombe committed
2
3
4
5
6
7
8
9
10
from transformers import PretrainedConfig


class DACConfig(PretrainedConfig):
    model_type = "dac"

    def __init__(
        self,
        num_codebooks: int = 9,
Yoach Lacombe's avatar
Yoach Lacombe committed
11
        model_bitrate: int = 8,  # kbps
Yoach Lacombe's avatar
add DAC  
Yoach Lacombe committed
12
13
14
        codebook_size: int = 1024,
        latent_dim: int = 1024,
        frame_rate: int = 86,
Yoach Lacombe's avatar
Yoach Lacombe committed
15
        sampling_rate: int = 44100,
Yoach Lacombe's avatar
add DAC  
Yoach Lacombe committed
16
17
18
19
20
21
22
        **kwargs,
    ):
        self.codebook_size = codebook_size
        self.model_bitrate = model_bitrate
        self.latent_dim = latent_dim
        self.num_codebooks = num_codebooks
        self.frame_rate = frame_rate
Yoach Lacombe's avatar
Yoach Lacombe committed
23
        self.sampling_rate = sampling_rate
Yoach Lacombe's avatar
Yoach Lacombe committed
24
25

        super().__init__(**kwargs)