
    Z j)                         S r SSKJr  SSKJr  SSKJrJr  \R                  " \	5      r
\" SS9\ " S S	\5      5       5       r\" SS9\ " S
 S\5      5       5       r\" SS9\ " S S\5      5       5       r/ SQrg)zCLIP model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzopenai/clip-vit-base-patch32)
checkpointc                   6   \ rS rSr% SrSrSrSr\\	S'   Sr
\\	S'   S	r\\	S
'   Sr\S-  \	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\S-  \	S'   Sr\\-  S-  \	S'   Sr\\	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S '   S!r\\\   -  S-  \	S"'   S# rS$rg)%CLIPTextConfig   a  
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_headsM   max_position_embeddings
quick_gelu
hidden_acth㈵>layer_norm_eps        attention_dropout{Gz?initializer_range      ?initializer_factor   pad_token_idi  bos_token_idi  eos_token_idc                     U R                   U R                  -  S:w  a&  [        SU R                    SU R                   S35      eg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    |/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/clip/configuration_clip.pyvalidate_architecture$CLIPTextConfig.validate_architectureB   S    d666!;#D$4$4#5 622327  <     )__name__
__module____qualname____firstlineno____doc__
model_typebase_config_keyr   int__annotations__r   r   r   r   r   r   r   strr   floatr   r    r"   r$   r%   r&   listr.   __static_attributes__r2   r1   r-   r
   r
      s      #J#OJK!s!!$NC$J$s  #%S%"J"#'NEDL',/sU{T)/#u#'**  !L#* $L#*$+0L#S	/D(0r1   r
   c                   .   \ rS rSr% SrSrSrSr\\	S'   Sr
\\	S'   S	r\\	S
'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\\   -  \\\4   -  S-  \	S'   Sr\\\   -  \\\4   -  S-  \	S'   Sr\\	S'   Sr\\	S'   Sr\\-  S-  \	S'   Sr\\	S'   Sr\\	S'   S rS rg)!CLIPVisionConfigK   a  
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                     U R                   U R                  -  S:w  a&  [        SU R                    SU R                   S35      egr(   r)   r+   s    r-   r.   &CLIPVisionConfig.validate_architectureo   r0   r1   r2   )r3   r4   r5   r6   r7   r8   r9   r   r:   r;   r   r   r   r   rE   rG   r>   tuplerI   r   r<   r   r=   r   r    r"   r.   r?   r2   r1   r-   rA   rA   K   s      %J%OK!s!NCs!!L#;>Jd3i%S/1D8>;=Jd3i%S/1D8="J" NE ,/sU{T)/#u# ##r1   rA   c                      ^  \ rS rSr% SrSr\\S.rSr	\
\-  S-  \S'   Sr\
\-  S-  \S'   Sr\S-  \S	'   S
r\\-  S-  \S'   Sr\S-  \S'   U 4S jrSrU =r$ )
CLIPConfigx   a  
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   rD   Nr   rD   r   r   g/L
F@logit_scale_init_valuer!   r"   c                    > U R                   c  0 n[        R                  S5        OF[        U R                   [        5      (       a  U R                   R                  5       nOU R                   nU R                  c  0 n[        R                  S5        OF[        U R                  [        5      (       a  U R                  R                  5       nOU R                  nUR                  SS 5      nUR                  SS 5      nUb  [	        S0 UD6R                  5       nUR                  5        HH  u  pxXr;   d  M  XU   :w  d  M  US:w  d  M  Xt;   a
  SU SU S3n	OS	U S
3n	[        R                  U	5        MJ     UR                  U5        Ub  [        S0 UD6R                  5       n
SU
;   a5  U
S   R                  5        VVs0 s H  u  px[        U5      U_M     snnU
S'   U
R                  5        HH  u  pxXs;   d  M  XU   :w  d  M  US:w  d  M  Xu;   a
  SU SU S3n	OSU S
3n	[        R                  U	5        MJ     UR                  U
5        [	        S0 UD6U l         [        S0 UD6U l        [        TU ]4  " S0 UD6  g s  snnf )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.id2labelzv` 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["r2   )r   loggerinfo
isinstancer
   to_dictrD   rA   popitemsupdater<   super__post_init__)r,   kwargsr   rD   rS   rT   _text_config_dictkeyvaluemessage_vision_config_dict	__class__s              r-   r`   CLIPConfig.__post_init__   s   #KKKij((.99**224K**K%MKKmn**,<== ..668M ..M "::&8$?#ZZ(<dC' . B1A B J J L 0557
%%s3C*COeHe.u %<<?5@Y[  336%7NP   KK( 8" 01)"2"H5G"H"P"P"R006I*6U6[6[6]36]
CHeO6]3#J/
 2779
'E35G,GCSiLi0u %FFIUJce  99<=TV   KK( :"   !45 *8K8->>''93s   =I:)r3   r4   r5   r6   r7   r8   r
   rA   sub_configsr   dictr;   rD   r   r:   rQ   r=   r"   r`   r?   __classcell__)rg   s   @r-   rN   rN   x   s    @ J"0CSTK04K&-448M4**T18!$NC$J$17ECK$.7'**Q( Q(r1   rN   )rN   r
   rA   N)r7   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr3   rX   r
   rA   rN   __all__r2   r1   r-   <module>rq      s     . 3 , 
		H	% 9:-% -  ;-` 9:(' (  ;(V 9:{(! {(  ;{(| ?r1   