Ë
    T^(h<6  ã                   ó`   — d Z ddlmZ ddlmZ  ej
                  e«      Z G d„ de«      ZdgZ	y)zVITS model configurationé   )ÚPretrainedConfig)Úloggingc            ,       óž   ‡ — e Zd ZdZdZddddddd	d
ddddd
d
d
ddddddg d¢g d¢g d¢g d¢g d¢g d¢gd
ddddddddddddddddd d!f,ˆ fd"„	Zˆ xZS )#Ú
VitsConfigaê!  
    This is the configuration class to store the configuration of a [`VitsModel`]. It is used to instantiate a VITS
    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 VITS
    [facebook/mms-tts-eng](https://huggingface.co/facebook/mms-tts-eng) architecture.

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

    Args:
        vocab_size (`int`, *optional*, defaults to 38):
            Vocabulary size of the VITS model. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed to the forward method of [`VitsModel`].
        hidden_size (`int`, *optional*, defaults to 192):
            Dimensionality of the text encoder layers.
        num_hidden_layers (`int`, *optional*, defaults to 6):
            Number of hidden layers in the Transformer encoder.
        num_attention_heads (`int`, *optional*, defaults to 2):
            Number of attention heads for each attention layer in the Transformer encoder.
        window_size (`int`, *optional*, defaults to 4):
            Window size for the relative positional embeddings in the attention layers of the Transformer encoder.
        use_bias (`bool`, *optional*, defaults to `True`):
            Whether to use bias in the key, query, value projection layers in the Transformer encoder.
        ffn_dim (`int`, *optional*, defaults to 768):
            Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        layerdrop (`float`, *optional*, defaults to 0.1):
            The LayerDrop probability for the encoder. See the [LayerDrop paper](see https://arxiv.org/abs/1909.11556)
            for more details.
        ffn_kernel_size (`int`, *optional*, defaults to 3):
            Kernel size of the 1D convolution layers used by the feed-forward network in the Transformer encoder.
        flow_size (`int`, *optional*, defaults to 192):
            Dimensionality of the flow layers.
        spectrogram_bins (`int`, *optional*, defaults to 513):
            Number of frequency bins in the target spectrogram.
        hidden_act (`str` or `function`, *optional*, defaults to `"relu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        hidden_dropout (`float`, *optional*, defaults to 0.1):
            The dropout probability for all fully connected layers in the embeddings and encoder.
        attention_dropout (`float`, *optional*, defaults to 0.1):
            The dropout ratio for the attention probabilities.
        activation_dropout (`float`, *optional*, defaults to 0.1):
            The dropout ratio for activations inside the fully connected layer.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        layer_norm_eps (`float`, *optional*, defaults to 1e-05):
            The epsilon used by the layer normalization layers.
        use_stochastic_duration_prediction (`bool`, *optional*, defaults to `True`):
            Whether to use the stochastic duration prediction module or the regular duration predictor.
        num_speakers (`int`, *optional*, defaults to 1):
            Number of speakers if this is a multi-speaker model.
        speaker_embedding_size (`int`, *optional*, defaults to 0):
            Number of channels used by the speaker embeddings. Is zero for single-speaker models.
        upsample_initial_channel (`int`, *optional*, defaults to 512):
            The number of input channels into the HiFi-GAN upsampling network.
        upsample_rates (`Tuple[int]` or `List[int]`, *optional*, defaults to `[8, 8, 2, 2]`):
            A tuple of integers defining the stride of each 1D convolutional layer in the HiFi-GAN upsampling network.
            The length of `upsample_rates` defines the number of convolutional layers and has to match the length of
            `upsample_kernel_sizes`.
        upsample_kernel_sizes (`Tuple[int]` or `List[int]`, *optional*, defaults to `[16, 16, 4, 4]`):
            A tuple of integers defining the kernel size of each 1D convolutional layer in the HiFi-GAN upsampling
            network. The length of `upsample_kernel_sizes` defines the number of convolutional layers and has to match
            the length of `upsample_rates`.
        resblock_kernel_sizes (`Tuple[int]` or `List[int]`, *optional*, defaults to `[3, 7, 11]`):
            A tuple of integers defining the kernel sizes of the 1D convolutional layers in the HiFi-GAN
            multi-receptive field fusion (MRF) module.
        resblock_dilation_sizes (`Tuple[Tuple[int]]` or `List[List[int]]`, *optional*, defaults to `[[1, 3, 5], [1, 3, 5], [1, 3, 5]]`):
            A nested tuple of integers defining the dilation rates of the dilated 1D convolutional layers in the
            HiFi-GAN multi-receptive field fusion (MRF) module.
        leaky_relu_slope (`float`, *optional*, defaults to 0.1):
            The angle of the negative slope used by the leaky ReLU activation.
        depth_separable_channels (`int`, *optional*, defaults to 2):
            Number of channels to use in each depth-separable block.
        depth_separable_num_layers (`int`, *optional*, defaults to 3):
            Number of convolutional layers to use in each depth-separable block.
        duration_predictor_flow_bins (`int`, *optional*, defaults to 10):
            Number of channels to map using the unonstrained rational spline in the duration predictor model.
        duration_predictor_tail_bound (`float`, *optional*, defaults to 5.0):
            Value of the tail bin boundary when computing the unconstrained rational spline in the duration predictor
            model.
        duration_predictor_kernel_size (`int`, *optional*, defaults to 3):
            Kernel size of the 1D convolution layers used in the duration predictor model.
        duration_predictor_dropout (`float`, *optional*, defaults to 0.5):
            The dropout ratio for the duration predictor model.
        duration_predictor_num_flows (`int`, *optional*, defaults to 4):
            Number of flow stages used by the duration predictor model.
        duration_predictor_filter_channels (`int`, *optional*, defaults to 256):
            Number of channels for the convolution layers used in the duration predictor model.
        prior_encoder_num_flows (`int`, *optional*, defaults to 4):
            Number of flow stages used by the prior encoder flow model.
        prior_encoder_num_wavenet_layers (`int`, *optional*, defaults to 4):
            Number of WaveNet layers used by the prior encoder flow model.
        posterior_encoder_num_wavenet_layers (`int`, *optional*, defaults to 16):
            Number of WaveNet layers used by the posterior encoder model.
        wavenet_kernel_size (`int`, *optional*, defaults to 5):
            Kernel size of the 1D convolution layers used in the WaveNet model.
        wavenet_dilation_rate (`int`, *optional*, defaults to 1):
            Dilation rates of the dilated 1D convolutional layers used in the WaveNet model.
        wavenet_dropout (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the WaveNet layers.
        speaking_rate (`float`, *optional*, defaults to 1.0):
            Speaking rate. Larger values give faster synthesised speech.
        noise_scale (`float`, *optional*, defaults to 0.667):
            How random the speech prediction is. Larger values create more variation in the predicted speech.
        noise_scale_duration (`float`, *optional*, defaults to 0.8):
            How random the duration prediction is. Larger values create more variation in the predicted durations.
        sampling_rate (`int`, *optional*, defaults to 16000):
            The sampling rate at which the output audio waveform is digitalized expressed in hertz (Hz).

    Example:

    ```python
    >>> from transformers import VitsModel, VitsConfig

    >>> # Initializing a "facebook/mms-tts-eng" style configuration
    >>> configuration = VitsConfig()

    >>> # Initializing a model (with random weights) from the "facebook/mms-tts-eng" style configuration
    >>> model = VitsModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úvitsé&   éÀ   é   é   é   Ti   gš™™™™™¹?r   i  Úrelug{®Gáz”?gñhãˆµøä>é   é    i   )é   r   r   r   )é   r   r   r   )r   é   é   )r   r   é   é
   g      @g      à?é   r   r   g        g      ð?gòÒMbXå?gš™™™™™é?i€>  c-                 ó  •— || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _        |!| _         |"| _!        |#| _"        |$| _#        |%| _$        |&| _%        |'| _&        |(| _'        |)| _(        |*| _)        |+| _*        |,| _+        tY        |«      tY        |«      k7  r$t[        dtY        |«      › dtY        |«      › d�«      ‚t]        ‰.| �¼  di |-¤Ž y )Nz'The length of `upsample_kernel_sizes` (z-) must match the length of `upsample_rates` (ú)© )0Ú
vocab_sizeÚhidden_sizeÚnum_hidden_layersÚnum_attention_headsÚwindow_sizeÚuse_biasÚffn_dimÚ	layerdropÚffn_kernel_sizeÚ	flow_sizeÚspectrogram_binsÚ
hidden_actÚhidden_dropoutÚattention_dropoutÚactivation_dropoutÚinitializer_rangeÚlayer_norm_epsÚ"use_stochastic_duration_predictionÚnum_speakersÚspeaker_embedding_sizeÚupsample_initial_channelÚupsample_ratesÚupsample_kernel_sizesÚresblock_kernel_sizesÚresblock_dilation_sizesÚleaky_relu_slopeÚdepth_separable_channelsÚdepth_separable_num_layersÚduration_predictor_flow_binsÚduration_predictor_tail_boundÚduration_predictor_kernel_sizeÚduration_predictor_dropoutÚduration_predictor_num_flowsÚ"duration_predictor_filter_channelsÚprior_encoder_num_flowsÚ prior_encoder_num_wavenet_layersÚ$posterior_encoder_num_wavenet_layersÚwavenet_kernel_sizeÚwavenet_dilation_rateÚwavenet_dropoutÚspeaking_rateÚnoise_scaleÚnoise_scale_durationÚsampling_rateÚlenÚ
ValueErrorÚsuperÚ__init__)/Úselfr   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   ÚkwargsÚ	__class__s/                                                 €úi/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/vits/configuration_vits.pyrI   zVitsConfig.__init__—   s¸  ø€ ð` %ˆŒØ&ˆÔØ!2ˆÔØ#6ˆÔ Ø&ˆÔØ ˆŒØˆŒØ"ˆŒØ.ˆÔØ"ˆŒØ 0ˆÔØ$ˆŒØ,ˆÔØ!2ˆÔØ"4ˆÔØ!2ˆÔØ,ˆÔØ2TˆÔ/Ø(ˆÔØ&<ˆÔ#Ø(@ˆÔ%Ø,ˆÔØ%:ˆÔ"Ø%:ˆÔ"Ø'>ˆÔ$Ø 0ˆÔØ(@ˆÔ%Ø*DˆÔ'Ø,HˆÔ)Ø-JˆÔ*Ø.LˆÔ+Ø*DˆÔ'Ø,HˆÔ)Ø2TˆÔ/Ø'>ˆÔ$Ø0PˆÔ-Ø4XˆÔ1Ø#6ˆÔ Ø%:ˆÔ"Ø.ˆÔØ*ˆÔØ&ˆÔØ$8ˆÔ!Ø*ˆÔäÐ$Ó%¬¨^Ó)<Ò<ÜØ9¼#Ð>SÓ:TÐ9Uð V%Ü%(¨Ó%8Ð$9¸ð<óð ô
 	‰ÑÑ"˜6Ó"ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typerI   Ú__classcell__)rL   s   @rM   r   r      s«   ø„ ñzðx €Jð ØØØØØØØØØØØØØØØØØ+/ØØ Ø!$Ú#Ú,Ú(Ú!*ªI²yÐ AØØ!"Ø#$Ø%'Ø&)Ø'(Ø#&Ø%&Ø+.Ø !Ø)*Ø-/ØØØØØØ Ø÷[c#ñ c#rN   r   N)
rR   Úconfiguration_utilsr   Úutilsr   Ú
get_loggerrO   Úloggerr   Ú__all__r   rN   rM   ú<module>rZ      s=   ðñ å 3Ý ð 
ˆ×	Ñ	˜HÓ	%€ôb#Ð!ô b#ðJ ˆ.�rN   