§
    ‚Štj²)  ã                   óJ  — d Z ddlmZ ddlmZ ddlmZmZ  ej        e	¦  «        Z
 ed¬¦  «        e G d„ d	e¦  «        ¦   «         ¦   «         Z ed¬¦  «        e G d
„ de¦  «        ¦   «         ¦   «         Z ed¬¦  «        e G d„ de¦  «        ¦   «         ¦   «         Zg d¢ZdS )zCLIP model configurationé    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingzopenai/clip-vit-base-patch32)Ú
checkpointc                   ó6  — e Zd ZU dZdZdZ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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ez  d
z  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ee         z  d
z  ed!<   d"„ Zd
S )#ÚCLIPTextConfigaâ  
    Example:

    ```python
    >>> from transformers import CLIPTextConfig, CLIPTextModel

    >>> # Initializing a CLIPTextConfig with openai/clip-vit-base-patch32 style configuration
    >>> configuration = CLIPTextConfig()

    >>> # Initializing a CLIPTextModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
    >>> model = CLIPTextModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclip_text_modelÚtext_configi Á  Ú
vocab_sizeé   Úhidden_sizei   Úintermediate_sizeNÚprojection_dimé   Únum_hidden_layersé   Únum_attention_headséM   Úmax_position_embeddingsÚ
quick_geluÚ
hidden_actçñhãˆµøä>Úlayer_norm_epsç        Úattention_dropoutç{®Gáz”?Úinitializer_rangeç      ð?Úinitializer_factoré   Úpad_token_idiþÀ  Úbos_token_idiÿÀ  Úeos_token_idc                 ól   — | j         | j        z  dk    r t          d| j         › d| j        › d�¦  «        ‚dS ©zOPart of `@strict`-powered validation. Validates the architecture of the config.r   zThe hidden size (z6) is not a multiple of the number of attention heads (z).N©r   r   Ú
ValueError©Úselfs    úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/clip/configuration_clip.pyÚvalidate_architecturez$CLIPTextConfig.validate_architectureB   ó[   € àÔ˜dÔ6Ñ6¸!Ò;Ð;Ýð7 DÔ$4ð 7ð 7ØÔ2ð7ð 7ð 7ñô ð ð <Ð;ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyr   ÚintÚ__annotations__r   r   r   r   r   r   r   Ústrr   Úfloatr   r   r!   r#   r$   r%   Úlistr-   © r/   r,   r
   r
      s^  € € € € € € ðð ð  #€JØ#€Oà€J�ÐÐÑØ€K�ÐÐÑØ!Ð�sÐ!Ð!Ñ!Ø!$€N�C˜$‘JÐ$Ð$Ñ$ØÐ�sÐÐÑØ Ð˜Ð Ð Ñ Ø#%Ð˜SÐ%Ð%Ñ%Ø"€J�Ð"Ð"Ñ"Ø#'€N�E˜D‘LÐ'Ð'Ñ'Ø,/Ð�s˜U‘{ TÑ)Ð/Ð/Ñ/Ø#Ð�uÐ#Ð#Ñ#Ø'*Ð˜ ™Ð*Ð*Ñ*ð  !€L�#˜‘*Ð Ð Ñ Ø$€L�#˜‘*Ð$Ð$Ñ$Ø+0€L�#˜˜Sœ	‘/ DÑ(Ð0Ð0Ñ0ðð ð ð ð r/   r
   c                   ó@  — e Zd ZU dZ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e         z  eeef         z  dz  ed<   dZeee         z  eeef         z  dz  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<   dZeed<   d„ ZdS )ÚCLIPVisionConfigaî  
    Example:

    ```python
    >>> from transformers import CLIPVisionConfig, CLIPVisionModel

    >>> # Initializing a CLIPVisionConfig with openai/clip-vit-base-patch32 style configuration
    >>> configuration = CLIPVisionConfig()

    >>> # Initializing a CLIPVisionModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
    >>> model = CLIPVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclip_vision_modelÚvision_configi   r   i   r   r   r   r   r   r   r   Únum_channelséà   NÚ
image_sizeé    Ú
patch_sizer   r   r   r   r   r   r   r   r    r!   c                 ól   — | j         | j        z  dk    r t          d| j         › d| j        › d�¦  «        ‚dS r'   r(   r*   s    r,   r-   z&CLIPVisionConfig.validate_architectureo   r.   r/   )r0   r1   r2   r3   r4   r5   r   r6   r7   r   r   r   r   r@   rB   r:   ÚtuplerD   r   r8   r   r9   r   r   r!   r-   r;   r/   r,   r=   r=   K   sN  € € € € € € ðð ð  %€JØ%€Oà€K�ÐÐÑØ!Ð�sÐ!Ð!Ñ!Ø€N�CÐÐÑØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø€L�#ÐÐÑØ;>€J��d˜3”i‘ %¨¨S¨¤/Ñ1°DÑ8Ð>Ð>Ñ>Ø;=€J��d˜3”i‘ %¨¨S¨¤/Ñ1°DÑ8Ð=Ð=Ñ=Ø"€J�Ð"Ð"Ñ"Ø €N�EÐ Ð Ñ Ø,/Ð�s˜U‘{ TÑ)Ð/Ð/Ñ/Ø#Ð�uÐ#Ð#Ñ#Ø #Ð˜Ð#Ð#Ñ#ðð ð ð ð r/   r=   c                   ó¨   ‡ — e Zd ZU dZdZeedœZdZe	ez  dz  e
d<   dZe	ez  dz  e
d<   dZedz  e
d<   d	Zeez  dz  e
d
<   dZedz  e
d<   ˆ fd„Zˆ xZS )Ú
CLIPConfiga  
    text_config (`dict`, *optional*):
        Dictionary of configuration options used to initialize [`CLIPTextConfig`].
    vision_config (`dict`, *optional*):
        Dictionary of configuration options used to initialize [`CLIPVisionConfig`].
    logit_scale_init_value (`float | int`, *optional*, defaults to 2.6592):
        The initial value of the *logit_scale* parameter. Default is used as per the original CLIP implementation.

    Example:

    ```python
    >>> from transformers import CLIPConfig, CLIPModel

    >>> # Initializing a CLIPConfig with openai/clip-vit-base-patch32 style configuration
    >>> configuration = CLIPConfig()

    >>> # Initializing a CLIPModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
    >>> model = CLIPModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config

    >>> # We can also initialize a CLIPConfig from a CLIPTextConfig and a CLIPVisionConfig
    >>> from transformers import CLIPTextConfig, CLIPVisionConfig

    >>> # Initializing a CLIPText and CLIPVision configuration
    >>> config_text = CLIPTextConfig()
    >>> config_vision = CLIPVisionConfig()

    >>> config = CLIPConfig(text_config=config_text, vision_config=config_vision)
    ```Úclip)r   r?   Nr   r?   r   r   gƒ/L¦
F@Úlogit_scale_init_valuer    r!   c                 óô  •— | j         €i }t                               d¦  «         n;t          | j         t          ¦  «        r| j                              ¦   «         }n| j         }| j        €i }t                               d¦  «         n;t          | j        t          ¦  «        r| j                             ¦   «         }n| j        }|                     dd ¦  «        }|                     dd ¦  «        }|�‘t	          di |¤Ž                     ¦   «         }| 	                    ¦   «         D ]I\  }}||v r@|||         k    r4|dk    r.||v r
d|› d|› d�}	nd	|› d
�}	t                               |	¦  «         ŒJ| 
                    |¦  «         |�¼t          di |¤Ž                     ¦   «         }
d|
v r'd„ |
d          	                    ¦   «         D ¦   «         |
d<   |
 	                    ¦   «         D ]I\  }}||v r@|||         k    r4|dk    r.||v r
d|› d|› d�}	nd|› d
�}	t                               |	¦  «         ŒJ| 
                    |
¦  «         t	          di |¤Ž| _         t          di |¤Ž| _         t          ¦   «         j        di |¤Ž d S )NzO`text_config` is `None`. Initializing the `CLIPTextConfig` with default values.zS`vision_config` is `None`. initializing the `CLIPVisionConfig` with default values.Útext_config_dictÚvision_config_dictÚtransformers_versionú`zp` is found in both `text_config_dict` and `text_config` but with different values. The value `text_config_dict["z"]` will be used instead.zj`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["z"]` will be overridden.Úid2labelc                 ó4   — i | ]\  }}t          |¦  «        |“ŒS r;   )r8   )Ú.0ÚkeyÚvalues      r,   ú
<dictcomp>z,CLIPConfig.__post_init__.<locals>.<dictcomp>Ù   s1   € ð 3ð 3ð 3Ù(2¨¨U•C˜‘H”H˜eð3ð 3ð 3r/   zv` is found in both `vision_config_dict` and `vision_config` but with different values. The value `vision_config_dict["zp`vision_config_dict` is provided which will be used to initialize `CLIPVisionConfig`. The value `vision_config["r;   )r   ÚloggerÚinfoÚ
isinstancer
   Úto_dictr?   r=   ÚpopÚitemsÚupdateÚsuperÚ__post_init__)r+   Úkwargsr   r?   rL   rM   Ú_text_config_dictrS   rT   ÚmessageÚ_vision_config_dictÚ	__class__s              €r,   r^   zCLIPConfig.__post_init__¤   sZ  ø€ ØÔÐ#ØˆKÝ�KŠKÐiÑjÔjÐjÐjÝ˜Ô(­.Ñ9Ô9ð 	+ØÔ*×2Ò2Ñ4Ô4ˆKˆKàÔ*ˆKàÔÐ%ØˆMÝ�KŠKÐmÑnÔnÐnÐnÝ˜Ô*Õ,<Ñ=Ô=ð 	/Ø Ô.×6Ò6Ñ8Ô8ˆMˆMà Ô.ˆMð "Ÿ:š:Ð&8¸$Ñ?Ô?ÐØ#ŸZšZÐ(<¸dÑCÔCÐàÐ'å .Ð BÐ BÐ1AÐ BÐ B× JÒ JÑ LÔ LÐð 0×5Ò5Ñ7Ô7ð )ð )‘
��UØ˜+Ð%Ð%¨%°;¸sÔ3CÒ*CÐ*CÈÐOeÒHeÐHeàÐ.Ð.Ð.ð[ ð [ð [Ø<?ð[ð [ð [ð  ˜ðPØ36ðPð Pð Pð  õ —K’K Ñ(Ô(Ð(øð ×ÒÐ0Ñ1Ô1Ð1àÐ)å"2Ð"HÐ"HÐ5GÐ"HÐ"H×"PÒ"PÑ"RÔ"RÐàÐ0Ð0Ð0ð3ð 3Ø6IÈ*Ô6U×6[Ò6[Ñ6]Ô6]ð3ñ 3ô 3Ð# JÑ/ð
 2×7Ò7Ñ9Ô9ð )ð )‘
��UØ˜-Ð'Ð'¨E°]À3Ô5GÒ,GÐ,GÈCÐSiÒLiÐLiàÐ0Ð0Ð0ðe ð eð eØFIðeð eð eð  ˜ðVØ9<ðVð Vð Vð  õ —K’K Ñ(Ô(Ð(øð × Ò Ð!4Ñ5Ô5Ð5õ *Ð8Ð8¨KÐ8Ð8ˆÔÝ-Ð>Ð>°Ð>Ð>ˆÔà�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r/   )r0   r1   r2   r3   r4   r
   r=   Úsub_configsr   Údictr7   r?   r   r6   rJ   r9   r!   r^   Ú__classcell__)rc   s   @r,   rH   rH   x   sÛ   ø€ € € € € € ðð ð@ €JØ"0ÐCSÐTÐT€Kà04€K�˜Ñ&¨Ñ-Ð4Ð4Ñ4Ø48€M�4Ð*Ñ*¨TÑ1Ð8Ð8Ñ8Ø!$€N�C˜$‘JÐ$Ð$Ñ$Ø17Ð˜E C™K¨$Ñ.Ð7Ð7Ñ7Ø'*Ð˜ ™Ð*Ð*Ñ*ðQ(ð Q(ð Q(ð Q(ð Q(ð Q(ð Q(ð Q(ð Q(r/   rH   )rH   r
   r=   N)r3   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Ú
get_loggerr0   rV   r
   r=   rH   Ú__all__r;   r/   r,   ú<module>rl      si  ðð Ð à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð 
ˆÔ	˜HÑ	%Ô	%€ð €Ð9Ð:Ñ:Ô:Øð-ð -ð -ð -ð -Ð%ñ -ô -ñ „ñ ;Ô:ð-ð` €Ð9Ð:Ñ:Ô:Øð(ð (ð (ð (ð (Ð'ñ (ô (ñ „ñ ;Ô:ð(ðV €Ð9Ð:Ñ:Ô:Øð{(ð {(ð {(ð {(ð {(Ð!ñ {(ô {(ñ „ñ ;Ô:ð{(ð| ?Ð
>Ð
>€€€r/   