§
    ‚ŠtjO  ã                   ó’   — d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed¬¦  «        e G d	„ d
ee¦  «        ¦   «         ¦   «         Z	d
gZ
dS )zBEiT model configurationé    )Ústricté   )ÚBackboneConfigMixin)ÚPreTrainedConfig)Úauto_docstringz%microsoft/beit-base-patch16-224-pt22k)Ú
checkpointc                   ó‚  ‡ — e Zd ZU dZd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z  ed<   dZeez  ed<   dZeed<   dZeed<   dZeee         z  eeef         z  ed<   dZeee         z  eeef         z  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d$<   d%Z ee         eed&f         z  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/<   d0Z&eed1<   d2Z'ee         d2z  ed3<   d2Z(ee         d2z  ed4<   dZ)eed5<   d#Z*eed6<   ˆ fd7„Z+ˆ xZ,S )8Ú
BeitConfiga×	  
    use_mask_token (`bool`, *optional*, defaults to `False`):
        Whether to use a mask token for masked image modeling.
    use_relative_position_bias (`bool`, *optional*, defaults to `False`):
        Whether to use T5-style relative position embeddings in the self-attention layers.
    use_shared_relative_position_bias (`bool`, *optional*, defaults to `False`):
        Whether to use the same relative position embeddings across all self-attention layers of the Transformer.
    use_mean_pooling (`bool`, *optional*, defaults to `True`):
        Whether to mean pool the final hidden states of the patches instead of using the final hidden state of the
        CLS token, before applying the classification head.
    pool_scales (`tuple[int]`, *optional*, defaults to `[1, 2, 3, 6]`):
        Pooling scales used in Pooling Pyramid Module applied on the last feature map.
    use_auxiliary_head (`bool`, *optional*, defaults to `True`):
        Whether to use an auxiliary head during training.
    auxiliary_loss_weight (`float`, *optional*, defaults to 0.4):
        Weight of the cross-entropy loss of the auxiliary head.
    auxiliary_channels (`int`, *optional*, defaults to 256):
        Number of channels to use in the auxiliary head.
    auxiliary_num_convs (`int`, *optional*, defaults to 1):
        Number of convolutional layers to use in the auxiliary head.
    auxiliary_concat_input (`bool`, *optional*, defaults to `False`):
        Whether to concatenate the output of the auxiliary head with the input before the classification layer.
    add_fpn (`bool`, *optional*, defaults to `False`):
        Whether to add a FPN as part of the backbone. Only relevant for [`BeitBackbone`].
    reshape_hidden_states (`bool`, *optional*, defaults to `True`):
        Whether to reshape the feature maps to 4D tensors of shape `(batch_size, hidden_size, height, width)` in
        case the model is used as backbone. If `False`, the feature maps will be 3D tensors of shape `(batch_size,
            seq_len, hidden_size)`. Only relevant for [`BeitBackbone`].

    Example:

    ```python
    >>> from transformers import BeitConfig, BeitModel

    >>> # Initializing a BEiT beit-base-patch16-224-pt22k style configuration
    >>> configuration = BeitConfig()

    >>> # Initializing a model (with random weights) from the beit-base-patch16-224-pt22k style configuration
    >>> model = BeitModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úbeiti    Ú
vocab_sizei   Úhidden_sizeé   Únum_hidden_layersÚnum_attention_headsi   Úintermediate_sizeÚgeluÚ
hidden_actg        Úhidden_dropout_probÚattention_probs_dropout_probg{®Gáz”?Úinitializer_rangegê-�™—q=Úlayer_norm_epséà   Ú
image_sizeé   Ú
patch_sizer   Únum_channelsFÚuse_mask_tokenÚ use_absolute_position_embeddingsÚuse_relative_position_biasÚ!use_shared_relative_position_biasgš™™™™™¹?Úlayer_scale_init_valueÚdrop_path_rateTÚuse_mean_pooling)é   é   r   é   .Úpool_scalesÚuse_auxiliary_headgš™™™™™Ù?Úauxiliary_loss_weighté   Úauxiliary_channelsr$   Úauxiliary_num_convsÚauxiliary_concat_inputéÿ   Úsemantic_loss_ignore_indexNÚ_out_featuresÚ_out_indicesÚadd_fpnÚreshape_hidden_statesc                 óÚ  •— d|v r-|                      d¦  «        €|                     d¦  «        |d<   dgd„ t          d| j        dz   ¦  «        D ¦   «         z   | _        |                      |                     dd ¦  «        |                     dd ¦  «        ¬¦  «         | j        r.| j        �t          | j        ¦  «        dk    rt          d	¦  «        ‚ t          ¦   «         j        d
i |¤Ž d S )NÚsegmentation_indicesÚout_indicesÚstemc                 ó   — g | ]}d |› �‘ŒS )Ústage© )Ú.0Úidxs     úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/beit/configuration_beit.pyú
<listcomp>z,BeitConfig.__post_init__.<locals>.<listcomp>m   s   € Ð&eÐ&eÐ&e¸ }¨s } }Ð&eÐ&eÐ&eó    r$   Úout_features)r6   r@   é   zÔBeitConfig requires `out_indices` to be a list of exactly 4 integers when `add_fpn=True`, specifying which features to use from the backbone. One can use `out_indices=[3, 5, 7, 11]` for a base-sized architecture.r:   )ÚgetÚpopÚranger   Ústage_namesÚ"set_output_features_output_indicesr2   r1   ÚlenÚ
ValueErrorÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r=   rJ   zBeitConfig.__post_init__h   s  ø€ Ø! VÐ+Ð+°·
²
¸=Ñ0IÔ0IÐ0QØ$*§J¢JÐ/EÑ$FÔ$FˆF�=Ñ!ð #˜8Ð&eÐ&eÅÀaÈÔI_ÐbcÑIcÑ@dÔ@dÐ&eÑ&eÔ&eÑeˆÔØ×/Ò/ØŸ
š
 =°$Ñ7Ô7ÀfÇjÂjÐQ_ÐaeÑFfÔFfð 	0ñ 	
ô 	
ð 	
ð Œ<ð 	˜TÔ.Ð6½#¸dÔ>OÑ:PÔ:PÐTUÒ:UÐ:UÝð1ñô ð ð 	�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r?   )-Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   ÚintÚ__annotations__r   r   r   r   r   Ústrr   Úfloatr   r   r   r   ÚlistÚtupler   r   r   Úboolr   r   r    r!   r"   r#   r'   r(   r)   r+   r,   r-   r/   r0   r1   r2   r3   rJ   Ú__classcell__)rM   s   @r=   r
   r
      s§  ø€ € € € € € ð*ð *ðX €Jà€J�ÐÐÑØ€K�ÐÐÑØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø!Ð�sÐ!Ð!Ñ!Ø€J�ÐÐÑØ'*Ð˜ ™Ð*Ð*Ñ*Ø03Ð  %¨#¡+Ð3Ð3Ñ3Ø#Ð�uÐ#Ð#Ñ#Ø!€N�EÐ!Ð!Ñ!Ø47€J��d˜3”i‘ %¨¨S¨¤/Ñ1Ð7Ð7Ñ7Ø46€J��d˜3”i‘ %¨¨S¨¤/Ñ1Ð6Ð6Ñ6Ø€L�#ÐÐÑØ €N�DÐ Ð Ñ Ø-2Ð$ dÐ2Ð2Ñ2Ø',Ð Ð,Ð,Ñ,Ø.3Ð% tÐ3Ð3Ñ3Ø$'Ð˜EÐ'Ð'Ñ'Ø"%€N�E˜C‘KÐ%Ð%Ñ%Ø!Ð�dÐ!Ð!Ñ!Ø/;€K��c”˜U 3¨ 8œ_Ñ,Ð;Ð;Ñ;Ø#Ð˜Ð#Ð#Ñ#Ø#&Ð˜5Ð&Ð&Ñ&Ø!Ð˜Ð!Ð!Ñ!Ø Ð˜Ð Ð Ñ Ø#(Ð˜DÐ(Ð(Ñ(Ø&)Ð Ð)Ð)Ñ)Ø&*€M�4˜”9˜tÑ#Ð*Ð*Ñ*Ø%)€L�$�s”)˜dÑ"Ð)Ð)Ñ)Ø€GˆTÐÐÑØ"&Ð˜4Ð&Ð&Ñ&ð(ð (ð (ð (ð (ð (ð (ð (ð (r?   r
   N)rQ   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   r
   Ú__all__r:   r?   r=   ú<module>r`      s¿   ðð Ð à .Ð .Ð .Ð .Ð .Ð .à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €ÐBÐCÑCÔCØð`(ð `(ð `(ð `(ð `(Ð$Ð&6ñ `(ô `(ñ „ñ DÔCð`(ðF ˆ.€€€r?   