Ë
    ÛÓ^j	  ã                   ó    — 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ÚLasrEncoderConfiga  
    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 [google/medasr](https://huggingface.co/google/medasr).
    Ú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{®Gáz”?Úinitializer_rangeg�íµ ÷Æ°>Úlayer_norm_eps)g      ø?g      à?.Úfeed_forward_residual_weights)g       @g      ð?Úconv_residual_weightsg{®Gáz„?Úbatch_norm_momentumNÚrope_parametersc                 óF   •— | j                   | _        t        ‰| �  di |¤Ž y ©N© )r   Únum_key_value_headsÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úv/var/www/ramen.bs-engineer-server.com/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�ÓØ €N�DÓ Ø"Ð�dÓ"ØÐ�cÓØ%(Ð˜sÓ(Ø€L�#ÓØ()Ð  #Ó)Ø#$Ð˜SÓ$Ø€GˆU�S‰[ÓØ%(Ð�u˜s‘{Ó(Ø €Iˆu�s‰{Ó Ø&)Ð˜ ™Ó)Ø%(Ð�u˜s‘{Ó(Ø#(Ð˜SÓ(Ø#Ð�uÓ#Ø €N�EÓ ØEOÐ! 4¨¡;°°u¸c°zÑ1BÑ#BÓOØ=GÐ˜4 ™;¨¨u°c¨zÑ):Ñ:ÓGØ!%Ð˜Ó%Ø#'€O�T˜D‘[Ó'÷(ð (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 )ÚLasrCTCConfigaE  
    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 [google/medasr](https://huggingface.co/google/medasr).
    Ú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Ñ"J°d×6IÑ6IÑ"JˆDÕØ× Ñ Ð(Ü"3Ó"5ˆDÔØ!%×!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Ð7€Kà€J�ÓØ$Ð˜Ó$Ø"Ð�tÓ"Ø59€N�DÐ+Ñ+¨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   