
    Z j%/                         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)    )strict   )PreTrainedConfig)auto_docstringloggingzCIDAS/clipseg-rd64)
checkpointc                   "   \ 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\\	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)$CLIPSegTextConfig   a  
Example:

```python
>>> from transformers import CLIPSegTextConfig, CLIPSegTextModel

>>> # Initializing a CLIPSegTextConfig with CIDAS/clipseg-rd64 style configuration
>>> configuration = CLIPSegTextConfig()

>>> # Initializing a CLIPSegTextModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
>>> model = CLIPSegTextModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```clipseg_text_modeltext_configi   
vocab_size   hidden_size   intermediate_size   num_hidden_layers   num_attention_headsM   max_position_embeddings
quick_gelu
hidden_acth㈵>N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/clipseg/configuration_clipseg.pyvalidate_architecture'CLIPSegTextConfig.validate_architectureE   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   strr   floatr   r    r"   r$   r%   r&   listr.   __static_attributes__r2   r1   r-   r
   r
      s      &J#OJK!s!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\\\   -  \\\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)CLIPSegVisionConfigN   a  
Example:

```python
>>> from transformers import CLIPSegVisionConfig, CLIPSegVisionModel

>>> # Initializing a CLIPSegVisionConfig with CIDAS/clipseg-rd64 style configuration
>>> configuration = CLIPSegVisionConfig()

>>> # Initializing a CLIPSegVisionModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
>>> model = CLIPSegVisionModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```clipseg_vision_modelvision_configi   r   i   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.   )CLIPSegVisionConfig.validate_architectureq   r0   r1   r2   )r3   r4   r5   r6   r7   r8   r9   r   r:   r;   r   r   r   rE   rG   r>   tuplerI   r   r<   r   r=   r   r    r"   r.   r?   r2   r1   r-   rA   rA   N   s      (J%OK!s!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'   Sr\\   \\S4   -  \S'   Sr\\S'   Sr\\S'   Sr\\-  \S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   U 4S jrSrU =r $ ) CLIPSegConfigz   a  
extract_layers (`list[int]`, *optional*, defaults to `[3, 6, 9]`):
    Layers to extract when forwarding the query image through the frozen visual backbone of CLIP.
reduce_dim (`int`, *optional*, defaults to 64):
    Dimensionality to reduce the CLIP vision embedding.
conditional_layer (`int`, *optional*, defaults to 0):
    The layer to use of the Transformer encoder whose activations will be combined with the condition
    embeddings using FiLM (Feature-wise Linear Modulation). If 0, the last layer is used.
use_complex_transposed_convolution (`bool`, *optional*, defaults to `False`):
    Whether to use a more complex transposed convolution in the decoder, enabling more fine-grained
    segmentation..

Example:

```python
>>> from transformers import CLIPSegConfig, CLIPSegModel

>>> # Initializing a CLIPSegConfig with CIDAS/clipseg-rd64 style configuration
>>> configuration = CLIPSegConfig()

>>> # Initializing a CLIPSegModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
>>> model = CLIPSegModel(configuration)

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

>>> # We can also initialize a CLIPSegConfig from a CLIPSegTextConfig and a CLIPSegVisionConfig

>>> # Initializing a CLIPSegText and CLIPSegVision configuration
>>> config_text = CLIPSegTextConfig()
>>> config_vision = CLIPSegVisionConfig()

>>> config = CLIPSegConfig(text_config=config_text, vision_config=config_vision)
```clipseg)r   rD   Nr   rD   r   projection_dimg/L
F@logit_scale_init_valuer!   r"   )r      	   .extract_layers@   
reduce_dim   decoder_num_attention_headsr   decoder_attention_dropoutr   decoder_hidden_actr   decoder_intermediate_sizer   conditional_layerF"use_complex_transposed_convolutionc                    > 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 )NzR`text_config` is `None`. Initializing the `CLIPSegTextConfig` with default values.zV`vision_config` is `None`. initializing the `CLIPSegVisionConfig` 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   r`   ra   _text_config_dictkeyvaluemessage_vision_config_dict	__class__s              r-   rm   CLIPSegConfig.__post_init__   s   #KKKlm((*;<<**224K**K%MKKpq**,?@@ ..668M ..M "::&8$?#ZZ(<dC' 1 E4D E M M O 0557
%%s3C*COeHe.u %<<?5@Y[  336%7NP   KK( 8" 01)"5"K8J"K"S"S"U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 -;{;0A=A''93s   =I:)!r3   r4   r5   r6   r7   r8   r
   rA   sub_configsr   dictr;   rD   rQ   r:   rR   r=   r"   rU   r>   rL   rW   rY   rZ   r[   r<   r\   r]   r^   boolrm   r?   __classcell__)rt   s   @r-   rN   rN   z   s    !F J"3FYZK37K))D077;M4--4;!$NC$J$17ECK$.7'**2;NDIc3h/;J'((-0us{0**%)s)s/4&4Q( Q(r1   rN   )rN   r
   rA   N)huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr3   re   r
   rA   rN   __all__r2   r1   r-   <module>r      s   ( / 3 , 
		H	% /0,( ,  1,^ /0'* '  1'T /0G($ G(  1G(T Hr1   