
    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GroupViT model configuration    )strict   )PreTrainedConfig)auto_docstringloggingznvidia/groupvit-gcc-yfcc)
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r\\-  \	S'   Sr\\-  \	S'   Sr\\	S'   Sr\\	S'   Sr\S-  \	S'   Sr\S-  \	S '   S!r\\\   -  S-  \	S"'   S#rg)$GroupViTTextConfig   aV  
Example:

```python
>>> from transformers import GroupViTTextConfig, GroupViTTextModel

>>> # Initializing a GroupViTTextModel with nvidia/groupvit-gcc-yfcc style configuration
>>> configuration = GroupViTTextConfig()

>>> model = GroupViTTextModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```groupvit_text_modeltext_configi   
vocab_size   hidden_sizei   intermediate_size   num_hidden_layers   num_attention_headsM   max_position_embeddings
quick_gelu
hidden_acth㈵>layer_norm_eps        dropoutattention_dropout{Gz?initializer_range      ?initializer_factor   Npad_token_idi  bos_token_idi  eos_token_id )__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%   r&   list__static_attributes__r'       ڄ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/groupvit/configuration_groupvit.pyr
   r
      s     'J#OJK!s!s  #%S%"J" NE GUS[%(us{(#u# ## L#* $L#*$+0L#S	/D(0r5   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4   -  \	S'   Sr\\   \\S4   -  \	S'   Sr\\   \\S4   -  \	S'   Sr\\	S'   Sr\\\   -  \\\4   -  \	S'   Sr\\\   -  \\\4   -  \	S'   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&r\\\-     \\\-  S4   -  \	S''   S( rS)r g*)+GroupViTVisionConfig?   a  
depths (`list[int]`, *optional*, defaults to [6, 3, 3]):
    The number of layers in each encoder block.
num_group_tokens (`list[int]`, *optional*, defaults to [64, 8, 0]):
    The number of group tokens for each stage.
num_output_groups (`list[int]`, *optional*, defaults to [64, 8, 8]):
    The number of output groups for each stage, 0 means no group.
assign_eps (`float`, *optional*, defaults to `1.0`):
    Epsilon used in layer norm
assign_mlp_ratio (`list[int]`, *optional*, defaults to `[0.5, 4]`):
    Ratio used to infer hidden size of MLP layers.

Example:

```python
>>> from transformers import GroupViTVisionConfig, GroupViTVisionModel

>>> # Initializing a GroupViTVisionModel with nvidia/groupvit-gcc-yfcc style configuration
>>> configuration = GroupViTVisionConfig()

>>> model = GroupViTVisionModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```groupvit_vision_modelvision_configi  r   i   r   r   r   )   r   r   .depths)@      r   num_group_tokens)r>   r?   r?   num_output_groupsr<   r      
image_size   
patch_sizer   num_channelsgelur   r   r   r   r   r   r   r    r!   r"   
assign_eps)g      ?r   assign_mlp_ratioc                     U R                   [        U R                  5      :w  a9  [        R	                  SU R                    S[        U R                  5       35        gg)zOPart of `@strict`-powered validation. Validates the architecture of the config.z&Manually setting num_hidden_layers to z1, but we expect num_hidden_layers = sum(depth) = N)r   sumr=   loggerwarning)selfs    r6   validate_architecture*GroupViTVisionConfig.validate_architecturer   sR    !!S%55NN89O9O8P Q!!$T[[!1 24 6r5   r'   N)!r(   r)   r*   r+   r,   r-   r.   r   r/   r0   r   r   r=   r3   tupler@   rA   r   rC   rE   rF   r   r1   r   r2   r   r   r    r"   rH   rI   rO   r4   r'   r5   r6   r8   r8   ?   sV   4 )J%OK!s!s*3FDIc3h'34>d3i%S/1>5?tCy5c?2?  47Jd3i%S/1746Jd3i%S/16L#J NE GUS[%(us{(#u# ##JDLd53;'%S0@*AALr5   r8   c                      ^  \ rS rSr% SrSr\\S.rSr	\
\-  S-  \S'   Sr\
\-  S-  \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$ )GroupViTConfig{   a  
projection_intermediate_dim (`int`, *optional*, defaults to 4096):
    Dimensionality of intermediate layer of text and vision projection layers.
output_segmentation (`bool`, *optional*, defaults to False):
    Whether or not to return the segmentation logits.
groupvit)r   r;   Nr   r;   r   projection_dimi   projection_intermediate_dimg/L
F@logit_scale_init_valuer   r    r!   r"   Foutput_segmentationc                    > 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 )NzS`text_config` is `None`. Initializing the `GroupViTTextConfig` with default values.zW`vision_config` is `None`. initializing the `GroupViTVisionConfig` 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.zn`text_config_dict` is provided which will be used to initialize `GroupViTTextConfig`. 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["zt`vision_config_dict` is provided which will be used to initialize `GroupViTVisionConfig`. The value `vision_config["r'   )r   rL   info
isinstancer
   to_dictr;   r8   popitemsupdater1   super__post_init__)rN   kwargsr   r;   r[   r\   _text_config_dictkeyvaluemessage_vision_config_dict	__class__s              r6   rg   GroupViTConfig.__post_init__   s   #KKKmn((*<==**224K**K%MKKqr**,@AA ..668M ..M "::&8$?#ZZ(<dC' 2 F5E F N N P 0557
%%s3C*COeHe.u %<<?5@Y[  336%7NP   KK( 8" 01)"6"L9K"L"T"T"V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 .<<1BMB''93s   =I:)r(   r)   r*   r+   r,   r-   r
   r8   sub_configsr   dictr   r0   r;   rV   r/   rW   rX   r2   r    r"   rY   boolrg   r4   __classcell__)rn   s   @r6   rS   rS   {   s     J"4G[\K26K((4/648M4**T18NC'++$*E*#u# ## %%Q( Q(r5   rS   )rS   r
   r8   N)r,   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr(   rL   r
   r8   rS   __all__r'   r5   r6   <module>ry      s    # . 3 , 
		H	% 56!1) !1  7!1H 567+ 7  77t 56e(% e(  7e(P Kr5   