
    iA                         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)    )strict   )PreTrainedConfig)auto_docstringzgoogle/medasr)
checkpointc                       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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'<   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d.<   d/Z$e%d/z  ed0<    fd1Z& xZ'S )2LasrEncoderConfiga8  
    convolution_bias (`bool`, *optional*, defaults to `False`):
        Whether to use bias in convolutions of the conformer's convolution module.
    conv_kernel_size (`int`, *optional*, defaults to 32):
        The kernel size of the convolution layers in the Conformer block.
    subsampling_conv_channels (`int`, *optional*, defaults to 256):
        The number of channels in the subsampling convolution layers.
    subsampling_conv_kernel_size (`int`, *optional*, defaults to 5):
        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.
    feed_forward_residual_weights (`tuple[float, float]`, *optional*, defaults to `[1.5, 0.5]`):
        The residual weights for the feed forward layers.
    conv_residual_weights (`tuple[float, float]`, *optional*, defaults to `[2.0, 1.0]`):
        The residual weights for the convolution layers.
    batch_norm_momentum (`float`, *optional*, defaults to 0.01):
        The momentum for the batch normalization layers

    Example:
        ```python
        >>> from transformers import LasrEncoderModel, LasrEncoderConfig

        >>> # Initializing a `LasrEncoder` configuration
        >>> configuration = LasrEncoderConfig()

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

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

    This configuration class is based on the LasrEncoder architecture from Google Health AI. You can find more details
    and pre-trained models at [TODO/TODO](https://huggingface.co/TODO/TODO).
    lasr_encoderpast_key_values   hidden_size   num_hidden_layers   num_attention_headsi   intermediate_sizesilu
hidden_actFattention_biasconvolution_bias    conv_kernel_size   subsampling_conv_channels   num_mel_bins   subsampling_conv_kernel_size   subsampling_conv_strideg?dropoutg        dropout_positions	layerdropactivation_dropoutattention_dropouti'  max_position_embeddingsg{Gz?initializer_rangegư>layer_norm_eps)g      ?g      ?.feed_forward_residual_weights)g       @g      ?conv_residual_weightsg{Gz?batch_norm_momentumNrope_parametersc                 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/lasr/configuration_lasr.pyr2   zLasrEncoderConfig.__post_init__`   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!   floatr"   r#   r$   r%   r&   r'   r(   r)   listtupler*   r+   r,   dictr2   __classcell__r6   s   @r7   r	   r	      s_   $L  J#4"5Ks  !s!J ND "d"c%(s(L#() #)#$S$GUS[%(us{( Ius{ &))%(us{(#(S(#u# NE EO!4;ucz1B#BO=G4;ucz)::G!%%#'OTD['( (r8   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e	d<    fdZed        Z xZS )LasrCTCConfigaa  
    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 [`LasrForCTC`].
    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 [`LasrForCTC`].

    Example:
        ```python
        >>> from transformers import LasrForCTC, LasrCTCConfig
        >>> # Initializing a Lasr configuration
        >>> configuration = LasrCTCConfig()
        >>> # Initializing a model from the configuration
        >>> model = LasrForCTC(configuration)
        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```
    This configuration class is based on the Lasr CTC architecture from Google Health AI. You can find more details
    and pre-trained models at [TODO/TODO](https://huggingface.co/TODO/TODO).
    lasr_ctcencoder_configr   
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.   )
isinstancerL   rF   r	   r'   r1   r2   r3   s     r7   r2   zLasrCTCConfig.__post_init__   sd    d))40"3"Jd6I6I"JD  ("3"5D!%!4!4!F!F''r8   c                 4    | j                   j                  dz  S )Nr   )rL   r    )r4   s    r7   inputs_to_logits_ratioz$LasrCTCConfig.inputs_to_logits_ratio   s    ""::A==r8   )r9   r:   r;   r<   r=   r	   sub_configsrM   r?   r@   rO   rA   rP   rB   rL   rF   r   rQ   r2   propertyrU   rG   rH   s   @r7   rJ   rJ   e   sr    . J#%67KJ$$"t"59ND++d29L#( > >r8   rJ   N)	huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   rJ   __all__r/   r8   r7   <module>r\      ss   * / 3 # ?+E(( E(  ,E(P ?++>$ +>  ,+>\ 
0r8   