
    i                         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 ed      e G d
 de                    Zdd	gZ	y)zParakeet model configuration.    )strict   )PreTrainedConfig)auto_docstringznvidia/parakeet-ctc-1.1b)
checkpointc                   r    e Zd ZU dZdZdgZdZeed<   dZ	eed<   dZ
eed	<   d
Zeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZe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z  ed<   dZeez  ed <   dZee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'<    fd(Z  xZ!S ))ParakeetEncoderConfiga  
    convolution_bias (`bool`, *optional*, defaults to `True`):
        Whether to use bias in convolutions of the conformer's convolution module.
    conv_kernel_size (`int`, *optional*, defaults to 9):
        The kernel size of the convolution layers in the Conformer block.
    subsampling_factor (`int`, *optional*, defaults to 8):
        The factor by which the input sequence is subsampled.
    subsampling_conv_channels (`int`, *optional*, defaults to 256):
        The number of channels in the subsampling convolution layers.
    num_mel_bins (`int`, *optional*, defaults to 80):
        Number of mel features.
    subsampling_conv_kernel_size (`int`, *optional*, defaults to 3):
        The kernel size of the subsampling convolution layers.
    subsampling_conv_stride (`int`, *optional*, defaults to 2):
        The stride of the subsampling convolution layers.
    dropout_positions (`float`, *optional*, defaults to 0.0):
        The dropout ratio for the positions in the input sequence.
    scale_input (`bool`, *optional*, defaults to `True`):
        Whether to scale the input embeddings.

    Example:
        ```python
        >>> from transformers import ParakeetEncoderModel, ParakeetEncoderConfig

        >>> # Initializing a `ParakeetEncoder` configuration
        >>> configuration = ParakeetEncoderConfig()

        >>> # Initializing a model from the configuration
        >>> model = ParakeetEncoderModel(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```

    This configuration class is based on the ParakeetEncoder architecture from NVIDIA NeMo. You can find more details
    and pre-trained models at [nvidia/parakeet-ctc-1.1b](https://huggingface.co/nvidia/parakeet-ctc-1.1b).
    parakeet_encoderpast_key_values   hidden_size   num_hidden_layers   num_attention_headsi   intermediate_sizesilu
hidden_actTattention_biasconvolution_bias	   conv_kernel_sizesubsampling_factor   subsampling_conv_channelsP   num_mel_binsr   subsampling_conv_kernel_size   subsampling_conv_strideg?dropoutg        dropout_positions	layerdropactivation_dropoutattention_dropouti  max_position_embeddingsscale_inputg{Gz?initializer_rangec                 F    | j                   | _        t        |   di | y N )r   num_key_value_headssuper__post_init__selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/parakeet/configuration_parakeet.pyr.   z#ParakeetEncoderConfig.__post_init__X   s!    #'#;#; ''    )"__name__
__module____qualname____doc__
model_typekeys_to_ignore_at_inferencer   int__annotations__r   r   r   r   strr   boolr   r   r   r   r   r   r    r!   floatr"   r#   r$   r%   r&   r'   r(   r.   __classcell__r2   s   @r3   r	   r	      s   $L $J#4"5Ks  !s!JND!d!c%(s(L#() #)#$S$GUS[%(us{( Ius{ &))%(us{(#'S'K#u#( (r4   r	   c                        e Zd ZU dZdZdeiZdZee	d<   dZ
ee	d<   dZee	d	<   d
Zeez  d
z  e	d<   dZed
z  e	d<    fdZ xZS )ParakeetCTCConfiga  
    ctc_loss_reduction (`str`, *optional*, defaults to `"mean"`):
        Specifies the reduction to apply to the output of `torch.nn.CTCLoss`. Only relevant when training an
        instance of [`ParakeetForCTC`].
    ctc_zero_infinity (`bool`, *optional*, defaults to `True`):
        Whether to zero infinite losses and the associated gradients of `torch.nn.CTCLoss`. Infinite losses mainly
        occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
        of [`ParakeetForCTC`].
    encoder_config (`Union[dict, ParakeetEncoderConfig]`, *optional*):
        The config object or dictionary of the encoder.

    Example:

    ```python
    >>> from transformers import ParakeetForCTC, ParakeetCTCConfig
    >>> # Initializing a Parakeet configuration
    >>> configuration = ParakeetCTCConfig()
    >>> # Initializing a model from the configuration
    >>> model = ParakeetForCTC(configuration)
    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    parakeet_ctcencoder_configi  
vocab_sizemeanctc_loss_reductionTctc_zero_infinityNr   pad_token_idc                     t        | j                  t              rt        di | j                  | _        n| j                  t               | _        | j                  j                  | _        t        |   di | y r*   )
isinstancerE   dictr	   r(   r-   r.   r/   s     r3   r.   zParakeetCTCConfig.__post_init__   sd    d))40"7"N$:M:M"ND  ("7"9D!%!4!4!F!F''r4   )r5   r6   r7   r8   r9   r	   sub_configsrF   r;   r<   rH   r=   rI   r>   rE   rM   r   rJ   r.   r@   rA   s   @r3   rC   rC   ]   sg    0  J#%:;KJ$$"t"59ND++d29#L#*#( (r4   rC   N)
r8   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   rC   __all__r+   r4   r3   <module>rS      sy    $ . 3 # 56B(, B(  7B(J 56((( ((  7((V  7
8r4   