
    fTh                     p    S r SSKrSSKrSSKJr  SSKJr  \R                  " \	5      r
 " S S\5      rS/rg)zDac model configuration    N   )PretrainedConfig)loggingc            
       d   ^  \ rS rSrSrSrS/ SQSSSS	S
SSS4
U 4S jjr\S\4S j5       r	Sr
U =r$ )	DacConfig   a  
This is the configuration class to store the configuration of an [`DacModel`]. It is used to instantiate a
Dac model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[descript/dac_16khz](https://huggingface.co/descript/dac_16khz) architecture.

Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.

Args:
    encoder_hidden_size (`int`, *optional*, defaults to 64):
        Intermediate representation dimension for the encoder.
    downsampling_ratios (`List[int]`, *optional*, defaults to `[2, 4, 8, 8]`):
        Ratios for downsampling in the encoder. These are used in reverse order for upsampling in the decoder.
    decoder_hidden_size (`int`, *optional*, defaults to 1536):
        Intermediate representation dimension for the decoder.
    n_codebooks (`int`, *optional*, defaults to 9):
        Number of codebooks in the VQVAE.
    codebook_size (`int`, *optional*, defaults to 1024):
        Number of discrete codes in each codebook.
    codebook_dim (`int`, *optional*, defaults to 8):
        Dimension of the codebook vectors. If not defined, uses `encoder_hidden_size`.
    quantizer_dropout (`bool`, *optional*, defaults to 0):
        Whether to apply dropout to the quantizer.
    commitment_loss_weight (float, *optional*, defaults to 0.25):
        Weight of the commitment loss term in the VQVAE loss function.
    codebook_loss_weight (float, *optional*, defaults to 1.0):
        Weight of the codebook loss term in the VQVAE loss function.
    sampling_rate (`int`, *optional*, defaults to 16000):
        The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).
Example:

```python
>>> from transformers import DacModel, DacConfig

>>> # Initializing a "descript/dac_16khz" style configuration
>>> configuration = DacConfig()

>>> # Initializing a model (with random weights) from the "descript/dac_16khz" style configuration
>>> model = DacModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```dac@   )         r   i   	   i   r   r   g      ?g      ?i>  c                 ,  > Xl         X l        X0l        US S S2   U l        X@l        XPl        X`l        Xpl        Xl        US[        U5      -  -  U l
        [        [        R                  " U5      5      U l        Xl        Xl        ["        TU ]H  " S0 UD6  g )Nr    )encoder_hidden_sizedownsampling_ratiosdecoder_hidden_sizeupsampling_ratiosn_codebookscodebook_sizecodebook_dimquantizer_dropoutsampling_ratelenhidden_sizeintnpprod
hop_lengthcommitment_loss_weightcodebook_loss_weightsuper__init__)selfr   r   r   r   r   r   r   r!   r"   r   kwargs	__class__s               a/var/www/auris/envauris/lib/python3.13/site-packages/transformers/models/dac/configuration_dac.pyr$   DacConfig.__init__L   s     $7 #6 #6 !4TrT!:&*(!2*.!s;N7O2OPbgg&9:;&<#$8!"6"    returnc                     [         R                  " U R                  5      n[        R                  " U R
                  U-  5      $ )N)r   r   r   mathceilr   )r%   r    s     r(   
frame_rateDacConfig.frame_ratel   s0    WWT334
yy++j899r*   )r   r"   r   r!   r   r   r   r   r    r   r   r   r   )__name__
__module____qualname____firstlineno____doc__
model_typer$   propertyr   r/   __static_attributes____classcell__)r'   s   @r(   r   r      sQ    +Z J ( # #@ :C : :r*   r   )r5   r-   numpyr   configuration_utilsr   utilsr   
get_loggerr1   loggerr   __all__r   r*   r(   <module>r@      sA       3  
		H	%S:  S:l -r*   