§
    ‚Štj4  ã                   ó’   — 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Hiera model configurationé    )Ústricté   )ÚBackboneConfigMixin)ÚPreTrainedConfig)Úauto_docstringzfacebook/hiera-base-224)Ú
checkpointc                   ó  ‡ — e Zd ZU dZdZddiZ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         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
e         eedf         z  ed<   dZe
e         eedf         z  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         eedf         z  ed<   dZe
e         eedf         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d(<   d)Zeed*<   d+Z ed+z  ed,<   d+Z!ed+z  ed-<   d+Z"ed+z  ed.<   d/Z#ed+z  ed0<   d1Z$eed2<   d+Z%e
e         d+z  ed3<   d+Z&e
e         d+z  ed4<   ˆ fd5„Z'd6„ Z(ˆ xZ)S )7ÚHieraConfigai  
    patch_stride (`list(int)`, *optional*, defaults to `[4, 4]`):
        The stride of the patch.
    patch_padding (`list(int)`, *optional*, defaults to `[3, 3]`):
        The padding of the patch.
    num_heads (`list(int)`, *optional*, defaults to `[1, 2, 4, 8]`):
        Number of attention heads in each layer of the Transformer encoder.
    embed_dim_multiplier (`float`, *optional*, defaults to 2.0):
        The multiplier to the dimensionality of patch embedding in each layer of the Transformer encoder.
    num_query_pool (`int`, *optional*, defaults to 3):
        The number of query pool stages.
    query_stride (`list(int)`, *optional*, defaults to `[2, 2]`):
        The stride of the query pool.
    masked_unit_size (`list(int)`, *optional*, defaults to `[8, 8]`):
        The size of the masked unit.
    masked_unit_attention (`list(bool)`, *optional*, defaults to `[True, True, False, False]`):
        Whether to use masked unit attention in each layer of the Transformer encoder.
    layer_norm_init (`float`, *optional*, defaults to 1.0):
        The initial weight value for layer normalization layers.
    decoder_depth (`int`, *optional*):
        Depth of the decoder for MAE pretraining.
    normalize_pixel_loss (`bool`, *optional*, defaults to `True`):
        Whether to normalize the pixel loss by the number of pixels.
    mask_ratio (`float`, *optional*, defaults to 0.6):
        The ratio of masked tokens in the input.

    Example:

    ```python
    >>> from transformers import HieraConfig, HieraModel

    >>> # Initializing a Hiera hiera-base-patch16-224 style configuration
    >>> configuration = HieraConfig()

    >>> # Initializing a model (with random weights) from the hiera-base-patch16-224 style configuration
    >>> model = HieraModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚhieraÚnum_hidden_layersÚ
num_layersé`   Ú	embed_dim)éà   r   .Ú
image_size)é   r   Ú
patch_size)é   r   Úpatch_stride)r   r   Úpatch_paddingg      @Ú	mlp_ratio)é   r   é   r   Údepths)é   r   r   é   Ú	num_headsg       @Úembed_dim_multiplierr   Únum_query_pool)r   r   Úquery_stride)r   r   Úmasked_unit_size)TTFFÚmasked_unit_attentiong        Údrop_path_rateÚnum_channelsÚgeluÚ
hidden_actg{®Gáz”?Úinitializer_rangeg      ð?Úlayer_norm_initg�íµ ÷Æ°>Úlayer_norm_epsNÚdecoder_hidden_sizeÚdecoder_depthÚdecoder_num_headsTÚnormalize_pixel_lossg333333ã?Ú
mask_ratioÚ_out_featuresÚ_out_indicesc                 óš  •— t          | j        | j        t          | j        ¦  «        dz
  z  z  ¦  «        | _        dgd„ t          dt          | j        ¦  «        dz   ¦  «        D ¦   «         z   | _        |                      | 	                    dd ¦  «        | 	                    dd ¦  «        ¬¦  «          t          ¦   «         j        di |¤Ž d S )Nr   Ústemc                 ó   — g | ]}d |› �‘ŒS )Ústage© )Ú.0Úidxs     úk/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/hiera/configuration_hiera.pyú
<listcomp>z-HieraConfig.__post_init__.<locals>.<listcomp>f   s   € Ð&_Ð&_Ð&_¸ }¨s } }Ð&_Ð&_Ð&_ó    Úout_indicesÚout_features)r;   r<   r5   )Úintr   r   Úlenr   Úhidden_sizeÚrangeÚstage_namesÚ"set_output_features_output_indicesÚpopÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r8   rE   zHieraConfig.__post_init__b   sÓ   ø€ õ ˜tœ~°Ô0IÍcÐRVÔR]ÑN^ÔN^ÐabÑNbÑ0cÑcÑdÔdˆÔØ"˜8Ð&_Ð&_ÅÀaÍÈTÌ[ÑIYÔIYÐ\]ÑI]Ñ@^Ô@^Ð&_Ñ&_Ô&_Ñ_ˆÔØ×/Ò/ØŸ
š
 =°$Ñ7Ô7ÀfÇjÂjÐQ_ÐaeÑFfÔFfð 	0ñ 	
ô 	
ð 	
ð 	�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r:   c           
      ó�  — | j         d         | j        d         t          | j        ¦  «        dz
  z  z  dk    rDt	          d| j         d         › d| j        d         › dt          | j        ¦  «        dz
  › d�¦  «        ‚| j        t          | j        ¦  «        k    r-t	          d| j        › dt          | j        ¦  «        › d�¦  «        ‚d	S )
zOPart of `@strict`-powered validation. Validates the architecture of the config.r   r   zmasked_unit_size[0] (z() must be divisible by query_stride[0] (z/) raised to the power of the number of layers (ú)znum_query_pool (z*) must be less than the number of layers (N)r!   r    r>   r   Ú
ValueErrorr   )rF   s    r8   Úvalidate_architecturez!HieraConfig.validate_architecturel   sý   € àÔ  Ô# dÔ&7¸Ô&:½sÀ4Ä;Ñ?OÔ?OÐRSÑ?SÑ&TÑTÐXYÒYÐYÝðX¨Ô(=¸aÔ(@ð Xð XÐjnÔj{Ð|}Ôj~ð Xð XÝ@CÀDÄKÑ@PÔ@PÐSTÑ@TðXð Xð Xñô ð ð
 Ô¥# d¤kÑ"2Ô"2Ò2Ð2ÝØu 4Ô#6ÐuÐuÕbeÐfjÔfqÑbrÔbrÐuÐuÐuñô ð ð 3Ð2r:   )*Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚattribute_mapr   r=   Ú__annotations__r   ÚlistÚtupler   r   r   r   Úfloatr   r   r   r   r    r!   r"   Úboolr#   r$   r&   Ústrr'   r(   r)   r*   r+   r,   r-   r.   r/   r0   rE   rL   Ú__classcell__)rH   s   @r8   r
   r
      sÐ  ø€ € € € € € ð'ð 'ðR €Jà(¨,Ð7€Mà€IˆsÐÐÑØ.8€J��S”	˜E # s (œOÑ+Ð8Ð8Ñ8Ø.4€J��S”	˜E # s (œOÑ+Ð4Ð4Ñ4Ø06€L�$�s”)˜e C¨ HœoÑ-Ð6Ð6Ñ6Ø17€M�4˜”9˜u S¨# XœÑ.Ð7Ð7Ñ7Ø€IˆuÐÐÑØ*7€FˆD�ŒI˜˜c 3˜hœÑ'Ð7Ð7Ñ7Ø-9€Iˆt�CŒy˜5  c œ?Ñ*Ð9Ð9Ñ9Ø(+Ð˜% #™+Ð+Ð+Ñ+Ø€N�CÐÐÑØ06€L�$�s”)˜e C¨ HœoÑ-Ð6Ð6Ñ6Ø4:Ð�d˜3”i %¨¨S¨¤/Ñ1Ð:Ð:Ñ:Ø;UÐ˜4 œ:¨¨d°C¨iÔ(8Ñ8ÐUÐUÑUØ"%€N�E˜C‘KÐ%Ð%Ñ%Ø€L�#ÐÐÑØ€J�ÐÐÑØ#Ð�uÐ#Ð#Ñ#Ø €O�UÐ Ð Ñ Ø €N�EÐ Ð Ñ Ø&*Ð˜˜t™Ð*Ð*Ñ*Ø $€M�3˜‘:Ð$Ð$Ñ$Ø$(Ð�s˜T‘zÐ(Ð(Ñ(Ø(,Ð˜$ ™+Ð,Ð,Ñ,Ø€J�ÐÐÑØ&*€M�4˜”9˜tÑ#Ð*Ð*Ñ*Ø%)€L�$�s”)˜dÑ"Ð)Ð)Ñ)ð(ð (ð (ð (ð (ðð ð ð ð ð ð r:   r
   N)rP   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   r
   Ú__all__r5   r:   r8   ú<module>r_      s¾   ðð  Ð à .Ð .Ð .Ð .Ð .Ð .à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð4Ð5Ñ5Ô5Øð^ð ^ð ^ð ^ð ^Ð%Ð'7ñ ^ô ^ñ „ñ 6Ô5ð^ðB ˆ/€€€r:   