
    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Mllama model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzmeta-llama/Llama-3.2-11B-Vision)
checkpointc                     ^  \ rS rSr% SrSrSrSS0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\	\\	   -  \\	\	4   -  \
S'   Sr\	\\	   -  \\	\	4   -  \
S'   Sr\\
S'   Sr\	\
S'   Sr\\	   S-  \
S'   Sr\\\	      S-  \
S '   S!r\\
S"'   U 4S# jrS$ r\S%\	4S& j5       r S'r!U =r"$ )(MllamaVisionConfig   aV  
num_global_layers (`int`, *optional*, defaults to 8):
    Number of global layers in the Transformer encoder. Vision model has a second transformer encoder, called global.
vision_output_dim (`int`, *optional*, defaults to 7680):
    Dimensionality of the vision model output. Includes output of transformer
    encoder with intermediate layers and global transformer encoder.
max_num_tiles (`int`, *optional*, defaults to 4):
    Maximum number of tiles for image splitting.
intermediate_layers_indices (`list[int]`, *optional*, defaults to [3, 7, 15, 23, 30]):
    Indices of intermediate layers of transformer encoder from which to extract and output features.
    These output features are concatenated with final hidden state of transformer encoder.
supported_aspect_ratios (`list[list[int]]`, *optional*):
    List of supported aspect ratios for image splitting. If not specified, the default supported aspect ratios
    are [[1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [3, 1], [4, 1]] for `max_num_tiles=4`.

Example:

```python
>>> from transformers import MllamaVisionConfig, MllamaVisionModel

>>> # Initializing a Llama config
>>> config = MllamaVisionConfig()

>>> # Initializing a vision model from the mllama-11b style configuration
>>> model = MllamaVisionModel(config)

>>> # Accessing the model configuration
>>> configuration = model.config
```mllama_vision_modelvision_confignum_attention_headsattention_headsi   hidden_sizegelu
hidden_act    num_hidden_layers   num_global_layers   r   num_channelsi   intermediate_sizei   vision_output_dimi  
image_size   
patch_sizeh㈵>norm_eps   max_num_tilesNintermediate_layers_indicessupported_aspect_ratios{Gz?initializer_rangec           	         > U R                   c  SS/SS/SS/SS/SS/SS/SS/SS//U l         U R                  c	  / SQU l        [        TU ]  " S0 UD6  g )N      r   r    )r                )r#   r"   super__post_init__selfkwargs	__class__s     ڀ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/mllama/configuration_mllama.pyr/    MllamaVisionConfig.__post_init__M   sv    ''/-.FQFQFQFQPQFUVXYTZ]^`a\befhidj+kD(++3/AD,''    c           
          U R                   SS/SS/SS/SS/SS/SS/SS/SS//:X  a  U R                  S:w  a  [        S5      egg)zOPart of `@strict`-powered validation. Validates the architecture of the config.r'   r(   r   r    z;max_num_tiles must be 4 for default supported aspect ratiosN)r#   r!   
ValueErrorr1   s    r4   validate_architecture(MllamaVisionConfig.validate_architectureU   sr     ((aVaVaVaVaQRVVWYZU[^_ab]cfgijek,ll""a'Z[[ ( mr6   returnc                 ,    [        U R                  5      $ )N)lenr#   r9   s    r4   max_aspect_ratio_id&MllamaVisionConfig.max_aspect_ratio_id]   s    4//00r6   )r"   r#   )#__name__
__module____qualname____firstlineno____doc__
model_typebase_config_keyattribute_mapr   int__annotations__r   strr   r   r   r   r   r   r   listtupler   r   floatr!   r"   r#   r%   r/   r:   propertyr?   __static_attributes____classcell__r3   s   @r4   r
   r
      s"   < 'J%O*,=>MKJssOSL#!s!!s!47Jd3i%S/1746Jd3i%S/16HeM348cT!186:T$s)_t3:#u#(\ 1S 1 1r6   r
   c                   f  ^  \ rS 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r\	\
S'   Sr\\
S'   Sr\\
S'   Sr\\
S'   Sr\\	   S-  \
S '   S!r\\	-  \
S"'   S#r\	\
S$'   S%r\	\\	   -  S-  \
S&'   S'r \	S-  \
S('   U 4S) jr!S*r"U =r#$ )+MllamaTextConfigb   a  
cross_attention_layers (`list[int]`, *optional*):
    Indices of the cross attention layers. If not specified, will default to [3, 8, 13, 18, 23, 28, 33, 38].

Example:

```python
>>> from transformers import MllamaTextModel, MllamaTextConfig

>>> # Initializing a Mllama text config
>>> config = MllamaTextConfig()

>>> # Initializing a model from the Mllama text configuration
>>> model = MllamaTextModel(config)

>>> # Accessing the model configuration
>>> configuration = model.config
```mllama_text_modeltext_configg    A  
vocab_sizei   r   silur   (   r   r   r   r   num_key_value_headsi 8  r   Nrope_parametersr   rms_norm_epsi   max_position_embeddingsr$   r%   T	use_cacheFtie_word_embeddingscross_attention_layersg        dropouti  bos_token_idi eos_token_idi pad_token_idc                 R   > U R                   c	  / SQU l         [        TU ]  " S0 UD6  g )N)r   r         r+      !   &   r-   )rb   r.   r/   r0   s     r4   r/   MllamaTextConfig.__post_init__   s'    &&.*HD'''r6   )rb   )$rA   rB   rC   rD   rE   rF   rG   default_thetarY   rI   rJ   r   r   rK   r   r   r\   r   r]   dictr^   rN   r_   r%   r`   boolra   rb   rL   rc   rd   re   rf   r/   rP   rQ   rR   s   @r4   rT   rT   b   s   & %J#OMJKJs!!  #s##'OTD['L%#*S*#u#It %%/3DI,3GUS[L#+1L#S	/D(1%L#*%( (r6   rT   c                      ^  \ rS rSr% SrSrSS0r\\S.r	Sr
\\-  S-  \S'   Sr\\-  S-  \S	'   S
r\\S'   U 4S jrSrU =r$ )MllamaConfig   a\  
Example:

```python
>>> from transformers import MllamaForConditionalGeneration, MllamaConfig, MllamaVisionConfig, MllamaTextConfig

>>> # Initializing a CLIP-vision config
>>> vision_config = MllamaVisionConfig()

>>> # Initializing a Llama config
>>> text_config = MllamaTextConfig()

>>> # Initializing a mllama-11b style configuration
>>> configuration = MllamaConfig(vision_config, text_config)

>>> # Initializing a model from the mllama-11b style configuration
>>> model = MllamaForConditionalGeneration(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```mllamaimage_token_idimage_token_index)rW   r   Nr   rW   rX   c                   > U R                   c%  [        5       U l         [        R                  S5        O9[	        U R                   [
        5      (       a  [        S0 U R                   D6U l         U R                  c%  [        5       U l        [        R                  S5        O9[	        U R                  [
        5      (       a  [        S0 U R                  D6U l        [        TU ]$  " S0 UD6  g )Nz9vision_config is None, using default mllama vision configz5text_config is None, using default mllama text configr-   )
r   r
   loggerinfo
isinstancero   rW   rT   r.   r/   r0   s     r4   r/   MllamaConfig.__post_init__   s    %!3!5DKKST**D11!3!Id6H6H!ID#/1DKKOP(($///C$2B2BCD''r6   )rA   rB   rC   rD   rE   rF   rH   rT   r
   sub_configsr   ro   r   rJ   rW   rv   rI   r/   rP   rQ   rR   s   @r4   rr   rr      sh    , J-M #3EWXK48M4**T1826K((4/6#s#( (r6   rr   )rr   rT   r
   N)rE   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerrA   rx   r
   rT   rr   __all__r-   r6   r4   <module>r      s    ! . 3 , 
		H	% <=E1) E1  >E1P <=.(' .(  >.(b <=.(# .(  >.(b Er6   