§
    ‚Štj	  ã                   óÒ   — 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dS )é    )Ú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                 óR   •— | j         | _         t          ¦   «         j        di |¤Ž d S ©N© )r   Únum_key_value_headsÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/lasr/configuration_lasr.pyr2   zLasrEncoderConfig.__post_init__`   s1   ø€ Ø#'Ô#;ˆÔ Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    )(Ú__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ÐOÑOØ=GÐ˜4 œ;¨¨u°c¨zÔ):Ñ:ÐGÐGÑ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          ¦   «         j        di |¤Ž d S r.   )Ú
isinstancerL   rF   r	   r'   r1   r2   r3   s     €r7   r2   zLasrCTCConfig.__post_init__ˆ   s|   ø€ Ý�dÔ)­4Ñ0Ô0ð 	6Ý"3Ð"JÐ"J°dÔ6IÐ"JÐ"JˆDÔÐØÔ Ð(Ý"3Ñ"5Ô"5ˆDÔØ!%Ô!4Ô!FˆÔØ�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r8   c                 ó    — | 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   sÎ   ø€ € € € € € ðð ð. €JØ#Ð%6Ð7€Kà€J�ÐÐÑØ$Ð˜Ð$Ð$Ñ$Ø"Ð�tÐ"Ð"Ñ"Ø59€N�DÐ+Ñ+¨dÑ2Ð9Ð9Ñ9Ø€L�#ÐÐÑð(ð (ð (ð (ð (ð ð>ð >ñ „Xð>ð >ð >ð >ð >r8   rJ   N)	Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   rJ   Ú__all__r/   r8   r7   ú<module>r\      sõ   ðð* /Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €˜?Ð+Ñ+Ô+ØðE(ð E(ð E(ð E(ð E(Ð(ñ E(ô E(ñ „ñ ,Ô+ðE(ðP €˜?Ð+Ñ+Ô+Øð+>ð +>ð +>ð +>ð +>Ð$ñ +>ô +>ñ „ñ ,Ô+ð+>ð\  Ð
0€€€r8   