
    ix                     j    d Z ddlmZ ddlmZ ddlmZ  ed      e G d d	e                    Zd	gZy
)z UnivNetModel model configuration    )strict   )PreTrainedConfig)auto_docstringzdg845/univnet-dev)
checkpointc                       e Zd ZU dZdZdZeed<   dZeed<   dZ	eed<   d	Z
ee   eed
f   z  ed<   dZee   eed
f   z  ed<   dZeez  ed<   dZeed<   dZeed<   dZeed<   dZeez  ed<   dZeed<   dZeed<   d Zy)UnivNetConfiga  
    model_in_channels (`int`, *optional*, defaults to 64):
        The number of input channels for the UnivNet residual network. This should correspond to
        `noise_sequence.shape[1]` and the value used in the [`UnivNetFeatureExtractor`] class.
    model_hidden_channels (`int`, *optional*, defaults to 32):
        The number of hidden channels of each residual block in the UnivNet residual network.
    num_mel_bins (`int`, *optional*, defaults to 100):
        The number of frequency bins in the conditioning log-mel spectrogram. This should correspond to the value
        used in the [`UnivNetFeatureExtractor`] class.
    resblock_kernel_sizes (`tuple[int]` or `list[int]`, *optional*, defaults to `[3, 3, 3]`):
        A tuple of integers defining the kernel sizes of the 1D convolutional layers in the UnivNet residual
        network. The length of `resblock_kernel_sizes` defines the number of resnet blocks and should match that of
        `resblock_stride_sizes` and `resblock_dilation_sizes`.
    resblock_stride_sizes (`tuple[int]` or `list[int]`, *optional*, defaults to `[8, 8, 4]`):
        A tuple of integers defining the stride sizes of the 1D convolutional layers in the UnivNet residual
        network. The length of `resblock_stride_sizes` should match that of `resblock_kernel_sizes` and
        `resblock_dilation_sizes`.
    resblock_dilation_sizes (`tuple[tuple[int]]` or `list[list[int]]`, *optional*, defaults to `[[1, 3, 9, 27], [1, 3, 9, 27], [1, 3, 9, 27]]`):
        A nested tuple of integers defining the dilation rates of the dilated 1D convolutional layers in the
        UnivNet residual network. The length of `resblock_dilation_sizes` should match that of
        `resblock_kernel_sizes` and `resblock_stride_sizes`. The length of each nested list in
        `resblock_dilation_sizes` defines the number of convolutional layers per resnet block.
    kernel_predictor_num_blocks (`int`, *optional*, defaults to 3):
        The number of residual blocks in the kernel predictor network, which calculates the kernel and bias for
        each location variable convolution layer in the UnivNet residual network.
    kernel_predictor_hidden_channels (`int`, *optional*, defaults to 64):
        The number of hidden channels for each residual block in the kernel predictor network.
    kernel_predictor_conv_size (`int`, *optional*, defaults to 3):
        The kernel size of each 1D convolutional layer in the kernel predictor network.
    kernel_predictor_dropout (`float`, *optional*, defaults to 0.0):
        The dropout probability for each residual block in the kernel predictor network.
    leaky_relu_slope (`float`, *optional*, defaults to 0.2):
        The angle of the negative slope used by the leaky ReLU activation.

    Example:

    ```python
    >>> from transformers import UnivNetModel, UnivNetConfig

    >>> # Initializing a Tortoise TTS style configuration
    >>> configuration = UnivNetConfig()

    >>> # Initializing a model (with random weights) from the Tortoise TTS style configuration
    >>> model = UnivNetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    univnet@   model_in_channels    model_hidden_channelsd   num_mel_bins)r   r   r   .resblock_kernel_sizes)   r      resblock_stride_sizes)   r   	      r   r   resblock_dilation_sizesr   kernel_predictor_num_blocks kernel_predictor_hidden_channelskernel_predictor_conv_sizeg        kernel_predictor_dropoutg{Gz?initializer_rangeg?leaky_relu_slopec                     t        | j                        t        | j                        cxk(  r"t        | j                        k(  st	        d       t	        d      y)zOPart of `@strict`-powered validation. Validates the architecture of the config.z`resblock_kernel_sizes`, `resblock_stride_sizes`, and `resblock_dilation_sizes` must all have the same length (which will be the number of resnet blocks in the model).N)lenr   r   r   
ValueError)selfs    /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/univnet/configuration_univnet.pyvalidate_architecturez#UnivNetConfig.validate_architectureZ   sf     **+s43M3M/NsRUVZVrVrRssY  tY  t    N)__name__
__module____qualname____doc__
model_typer   int__annotations__r   r   r   listtupler   r   r   r   r   r   floatr   r   r%    r&   r$   r	   r	      s    0d Js!#3#L#9B49uS#X6B9B49uS#X6B,YTE\Y'((,.$c.&'',/eck/#u#!e!r&   r	   N)	r*   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   __all__r1   r&   r$   <module>r6      sK    ' . 3 # ./J$ J  0JZ 
r&   