§
    ‚Š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Mllama model configurationé    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingzmeta-llama/Llama-3.2-11B-Vision)Ú
checkpointc                   ó¨  ‡ — e Zd ZU dZdZdZddi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	d<   dZee	d<   dZeee         z  eeef         z  e	d<   dZeee         z  eeef         z  e	d<   dZee	d<   dZee	d<   dZee         dz  e	d<   dZeee                  dz  e	d<   d Zee	d!<   ˆ fd"„Zd#„ Zed$efd%„¦   «         Zˆ xZ S )&ÚMllamaVisionConfiga²  
    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_sizeçñhãˆµøä>Únorm_epsé   Úmax_num_tilesNÚintermediate_layers_indicesÚsupported_aspect_ratiosç{®Gáz”?Úinitializer_rangec           	      ó¦   •— | j         €ddgddgddgddgddgddgddgddgg| _         | j        €	g d¢| _         t          ¦   «         j        di |¤Ž d S )Né   é   r   r   )r   é   é   é   é   © )r"   r!   ÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úm/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/mllama/configuration_mllama.pyr.   z MllamaVisionConfig.__post_init__M   s‰   ø€ ØÔ'Ð/Ø-.°¨F°Q¸°F¸QÀ¸FÀQÈÀFÈQÐPQÈFÐUVÐXYÐTZÐ]^Ð`aÐ\bÐefÐhiÐdjÐ+kˆDÔ(àÔ+Ð3Ø/AÐ/AÐ/AˆDÔ,Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c           
      ó„   — | j         ddgddgddgddgddgddgddgddggk    r| j        dk    rt          d¦  «        ‚dS dS )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©r0   s    r3   Úvalidate_architecturez(MllamaVisionConfig.validate_architectureU   sy   € ð Ô(¨a°¨V°a¸°V¸aÀ¸VÀaÈÀVÈaÐQRÈVÐVWÐYZÐU[Ð^_ÐabÐ]cÐfgÐijÐekÐ,lÒlÐlØÔ" aÒ'Ð'åÐZÑ[Ô[Ð[ð mÐlØ'Ð'r4   Úreturnc                 ó*   — t          | j        ¦  «        S )N)Úlenr"   r7   s    r3   Úmax_aspect_ratio_idz&MllamaVisionConfig.max_aspect_ratio_id]   s   € å�4Ô/Ñ0Ô0Ð0r4   )!Ú__name__Ú
__module__Ú__qualname__Ú__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.   r8   Úpropertyr<   Ú__classcell__©r2   s   @r3   r
   r
      sË  ø€ € € € € € ðð ð< '€JØ%€OØ*Ð,=Ð>€Mà€K�ÐÐÑØ€J�ÐÐÑØÐ�sÐÐÑØÐ�sÐÐÑØ€O�SÐÐÑØ€L�#ÐÐÑØ!Ð�sÐ!Ð!Ñ!Ø!Ð�sÐ!Ð!Ñ!Ø47€J��d˜3”i‘ %¨¨S¨¤/Ñ1Ð7Ð7Ñ7Ø46€J��d˜3”i‘ %¨¨S¨¤/Ñ1Ð6Ð6Ñ6Ø€HˆeÐÐÑØ€M�3ÐÐÑØ48Ð  c¤¨TÑ!1Ð8Ð8Ñ8Ø6:Ð˜T $ s¤)œ_¨tÑ3Ð:Ð:Ñ:Ø#Ð�uÐ#Ð#Ñ#ð(ð (ð (ð (ð (ð\ð \ð \ð ð1 Sð 1ð 1ð 1ñ „Xð1ð 1ð 1ð 1ð 1r4   r
   c                   óh  ‡ — e Zd ZU dZ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	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e	d<   dZee         dz  e	d<   d Zeez  e	d!<   d"Zee	d#<   d$Zeee         z  dz  e	d%<   d&Zedz  e	d'<   ˆ fd(„Z ˆ xZ!S ))ÚMllamaTextConfiga  
    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                 óZ   •— | j         €	g d¢| _          t          ¦   «         j        di |¤Ž d S )N)r   r   é   é   r*   é   é!   é&   r,   )r[   r-   r.   r/   s     €r3   r.   zMllamaTextConfig.__post_init__�   s=   ø€ ØÔ&Ð.Ø*HÐ*HÐ*HˆDÔ'Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r4   )"r=   r>   r?   r@   rA   rB   Údefault_thetarR   rD   rE   r   r   rF   r   r   rU   r   rV   ÚdictrW   rI   rX   r$   rY   ÚboolrZ   r[   rG   r\   r]   r^   r_   r.   rK   rL   s   @r3   rN   rN   b   sŸ  ø€ € € € € € ðð ð& %€JØ#€OØ€Mà€J�ÐÐÑØ€K�ÐÐÑØ€J�ÐÐÑØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø Ð˜Ð Ð Ñ Ø#Ð�sÐ#Ð#Ñ#Ø#'€O�T˜D‘[Ð'Ð'Ñ'Ø€L�%ÐÐÑØ#*Ð˜SÐ*Ð*Ñ*Ø#Ð�uÐ#Ð#Ñ#Ø€IˆtÐÐÑØ %Ð˜Ð%Ð%Ñ%Ø/3Ð˜D œI¨Ñ,Ð3Ð3Ñ3Ø€GˆU�S‰[ÐÐÑØ€L�#ÐÐÑØ+1€L�#˜˜Sœ	‘/ DÑ(Ð1Ð1Ñ1Ø%€L�#˜‘*Ð%Ð%Ñ%ð(ð (ð (ð (ð (ð (ð (ð (ð (r4   rN   c                   ó|   ‡ — e Zd ZU dZdZddi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ed<   ˆ fd
„Zˆ xZS )ÚMllamaConfiga”  
    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)rP   r   Nr   rP   rQ   c                 óÎ  •— | j         €.t          ¦   «         | _         t                               d¦  «         n0t	          | j         t
          ¦  «        rt          di | j         ¤Ž| _         | j        €.t          ¦   «         | _        t                               d¦  «         n0t	          | j        t
          ¦  «        rt          di | j        ¤Ž| _         t          ¦   «         j	        di |¤Ž d S )Nz9vision_config is None, using default mllama vision configz5text_config is None, using default mllama text configr,   )
r   r
   ÚloggerÚinfoÚ
isinstancerg   rP   rN   r-   r.   r/   s     €r3   r.   zMllamaConfig.__post_init__¸   sÞ   ø€ ØÔÐ%Ý!3Ñ!5Ô!5ˆDÔÝ�KŠKÐSÑTÔTÐTÐTÝ˜Ô*­DÑ1Ô1ð 	JÝ!3Ð!IÐ!I°dÔ6HÐ!IÐ!IˆDÔàÔÐ#Ý/Ñ1Ô1ˆDÔÝ�KŠKÐOÑPÔPÐPÐPÝ˜Ô(­$Ñ/Ô/ð 	DÝ/ÐCÐC°$Ô2BÐCÐCˆDÔà�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r4   )r=   r>   r?   r@   rA   rC   rN   r
   Úsub_configsr   rg   r   rE   rP   rm   rD   r.   rK   rL   s   @r3   rj   rj   •   s¯   ø€ € € € € € ðð ð, €JàÐ-ð€Mð #3ÐEWÐXÐX€Kà48€M�4Ð*Ñ*¨TÑ1Ð8Ð8Ñ8Ø26€K�Ð(Ñ(¨4Ñ/Ð6Ð6Ñ6Ø#Ð�sÐ#Ð#Ñ#ð(ð (ð (ð (ð (ð (ð (ð (ð (r4   rj   )rj   rN   r
   N)r@   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Ú
get_loggerr=   ro   r
   rN   rj   Ú__all__r,   r4   r3   ú<module>rx      sj  ðð !Ð  à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð 
ˆÔ	˜HÑ	%Ô	%€ð €Ð<Ð=Ñ=Ô=ØðE1ð E1ð E1ð E1ð E1Ð)ñ E1ô E1ñ „ñ >Ô=ðE1ðP €Ð<Ð=Ñ=Ô=Øð.(ð .(ð .(ð .(ð .(Ð'ñ .(ô .(ñ „ñ >Ô=ð.(ðb €Ð<Ð=Ñ=Ô=Øð.(ð .(ð .(ð .(ð .(Ð#ñ .(ô .(ñ „ñ >Ô=ð.(ðb EÐ
DÐ
D€€€r4   