§
    ‚ŠtjF  ã                   óž   — d Z ddlm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ResNet model configurationé    )ÚClassVar)Ústricté   )ÚBackboneConfigMixin)ÚPreTrainedConfig)Úauto_docstringzmicrosoft/resnet-50)Ú
checkpointc                   ó  ‡ — e Zd ZU dZdZddgZeee                  e	d<   dZ
ee	d<   dZee	d	<   d
Zee         eedf         z  dz  e	d<   dZee         eedf         z  dz  e	d<   dZee	d<   dZee	d<   dZee	d<   dZee	d<   ˆ fd„Zd„ Zˆ xZS )ÚResNetConfigaô  
    layer_type (`str`, *optional*, defaults to `"bottleneck"`):
        The layer to use, it can be either `"basic"` (used for smaller models, like resnet-18 or resnet-34) or
        `"bottleneck"` (used for larger models like resnet-50 and above).
    downsample_in_first_stage (`bool`, *optional*, defaults to `False`):
        If `True`, the first stage will downsample the inputs using a `stride` of 2.
    downsample_in_bottleneck (`bool`, *optional*, defaults to `False`):
        If `True`, the first conv 1x1 in ResNetBottleNeckLayer will downsample the inputs using a `stride` of 2.

    Example:
    ```python
    >>> from transformers import ResNetConfig, ResNetModel

    >>> # Initializing a ResNet resnet-50 style configuration
    >>> configuration = ResNetConfig()

    >>> # Initializing a model (with random weights) from the resnet-50 style configuration
    >>> model = ResNetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    ÚresnetÚbasicÚ
bottleneckÚlayer_typesr   Únum_channelsé@   Úembedding_size)é   i   i   i   .NÚhidden_sizes)r   é   é   r   ÚdepthsÚ
layer_typeÚreluÚ
hidden_actFÚdownsample_in_first_stageÚdownsample_in_bottleneckc                 óZ  •— dgd„ t          dt          | j        ¦  «        dz   ¦  «        D ¦   «         z   | _        |                      |                     dd ¦  «        |                     dd ¦  «        ¬¦  «         t          | j        ¦  «        | _         t          ¦   «         j	        di |¤Ž d S )NÚstemc                 ó   — g | ]}d |› �‘ŒS )Ústage© )Ú.0Úidxs     úm/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/resnet/configuration_resnet.pyú
<listcomp>z.ResNetConfig.__post_init__.<locals>.<listcomp>A   s   € Ð&_Ð&_Ð&_¸ }¨s } }Ð&_Ð&_Ð&_ó    é   Úout_indicesÚout_features)r(   r)   r!   )
ÚrangeÚlenr   Ústage_namesÚ"set_output_features_output_indicesÚpopÚlistr   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r$   r1   zResNetConfig.__post_init__@   s³   ø€ Ø"˜8Ð&_Ð&_ÅÀaÍÈTÌ[ÑIYÔIYÐ\]ÑI]Ñ@^Ô@^Ð&_Ñ&_Ô&_Ñ_ˆÔØ×/Ò/ØŸ
š
 =°$Ñ7Ô7ÀfÇjÂjÐQ_ÐaeÑFfÔFfð 	0ñ 	
ô 	
ð 	
õ ! Ô!2Ñ3Ô3ˆÔØ�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r&   c                 ó†   — | j         | j        vr2t          d| j         › dd                     | j        ¦  «        › �¦  «        ‚dS )z.Check that `layer_types` is correctly defined.zlayer_type=z is not one of ú,N)r   r   Ú
ValueErrorÚjoin)r2   s    r$   Úvalidate_layer_typez ResNetConfig.validate_layer_typeH   sK   € àŒ? $Ô"2Ð2Ð2ÝÐg¨4¬?ÐgÐgÈ3Ï8Ê8ÐTXÔTdÑKeÔKeÐgÐgÑhÔhÐhð 3Ð2r&   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   r   r/   ÚstrÚ__annotations__r   Úintr   r   Útupler   r   r   r   Úboolr   r1   r9   Ú__classcell__)r4   s   @r$   r   r      s-  ø€ € € € € € ðð ð0 €JØ(/°Ð'>€K�˜$˜sœ)Ô$Ð>Ð>Ñ>à€L�#ÐÐÑØ€N�CÐÐÑØ7M€L�$�s”)˜e C¨ HœoÑ-°Ñ4ÐMÐMÑMØ1=€FˆD�ŒI˜˜c 3˜hœÑ'¨$Ñ.Ð=Ð=Ñ=Ø"€J�Ð"Ð"Ñ"Ø€J�ÐÐÑØ&+Ð˜tÐ+Ð+Ñ+Ø%*Ð˜dÐ*Ð*Ñ*ð(ð (ð (ð (ð (ðið ið ið ið ið ið ir&   r   N)r=   Útypingr   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   r   Ú__all__r!   r&   r$   ú<module>rK      sÑ   ðð !Ð  à Ð Ð Ð Ð Ð à .Ð .Ð .Ð .Ð .Ð .à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð0Ð1Ñ1Ô1Øð0ið 0ið 0ið 0ið 0iÐ&Ð(8ñ 0iô 0iñ „ñ 2Ô1ð0iðf Ð
€€€r&   