§
    ñ§g  ã                   ór   — d Z ddlZddlmZ ddlmZ ddlmZ  ej        e	¦  «        Z
 G d„ d	e¦  «        ZdS )
zPaliGemmamodel configurationé    Né   )ÚPretrainedConfig)Úloggingé   )ÚCONFIG_MAPPINGc                   óz   ‡ — e Zd ZdZdZdZ	 	 	 	 	 	 	 dˆ fd	„	Zed
„ ¦   «         Zej	        d„ ¦   «         Zˆ fd„Z
ˆ xZS )ÚPaliGemmaConfiga	  
    This is the configuration class to store the configuration of a [`PaliGemmaForConditionalGeneration`]. It is used to instantiate an
    PaliGemmamodel according to the specified arguments, defining the model architecture. Instantiating a configuration
    with the defaults will yield a similar configuration to that of the PaliGemma-2B.

    e.g. [paligemma-hf/paligemma-2b](https://huggingface.co/paligemma-hf/paligemma-2b)

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Args:
        vision_config (`PaliGemmaVisionConfig`,  *optional*):
            Custom vision config or dict
        text_config (`Union[AutoConfig, dict]`, *optional*):
            The config object of the text backbone. Can be any of `LlamaConfig` or `MistralConfig`.
        ignore_index (`int`, *optional*, defaults to -100):
            The ignore index for the loss function.
        image_token_index (`int`, *optional*, defaults to 256000):
            The image token index to encode the image prompt.
        vocab_size (`int`, *optional*, defaults to 257152):
            Vocabulary size of the PaliGemmamodel. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed when calling [`~PaliGemmaForConditionalGeneration`]
        projection_dim (`int`, *optional*, defaults to 2048):
            Dimension of the multimodal projection space.
        hidden_size (`int`, *optional*, defaults to 2048):
            Dimension of the hidden layer of the Language model.

    Example:

    ```python
    >>> from transformers import PaliGemmaForConditionalGeneration, PaliGemmaConfig, SiglipVisionConfig, GemmaConfig

    >>> # Initializing a Siglip-like vision config
    >>> vision_config = SiglipVisionConfig()

    >>> # Initializing a PaliGemma config
    >>> text_config = GemmaConfig()

    >>> # Initializing a PaliGemma paligemma-3b-224 style configuration
    >>> configuration = PaliGemmaConfig(vision_config, text_config)

    >>> # Initializing a model from the paligemma-3b-224 style configuration
    >>> model = PaliGemmaForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Ú	paligemmaFNéœÿÿÿé è é€ì é   c           
      óÀ  •— || _         || _        || _        || _        || _        || _        d| _        t          | j        t          ¦  «        r/d|v r|d         nd|d<   t          |d                  di |¤Ž| _        n$|€"t          d         dddddd	d
d¬¦  «        | _        || _
        t          | j
        t          ¦  «        r/d|v r|d         nd|d<   t          |d                  di |¤Ž| _
        n#|€!t          d         dddddd|¬¦  «        | _
        | j        j        | j        j        z  dz  | j
        _        || j        _         t          ¦   «         j        di |¤Ž d S )NFÚ
model_typeÚsiglip_vision_modeli   i€  é   éà   é   é   r   )Úintermediate_sizeÚhidden_sizeÚ
patch_sizeÚ
image_sizeÚnum_hidden_layersÚnum_attention_headsÚ
vocab_sizeÚvision_use_headÚgemmar   é   i @  é   é   )r   r   r   r   Únum_key_value_headsÚis_encoder_decoderr   r   © )Ú_ignore_indexÚimage_token_indexÚ_vocab_sizeÚprojection_dimr   Úvision_configr#   Ú
isinstanceÚdictr   Útext_configr   r   Únum_image_tokensÚsuperÚ__init__)
Úselfr)   r,   Úignore_indexr&   r   r(   r   ÚkwargsÚ	__class__s
            €úq/var/www/html/ai-engine/env/lib/python3.11/site-packages/transformers/models/paligemma/configuration_paligemma.pyr/   zPaliGemmaConfig.__init__N   s¿  ø€ ð *ˆÔØ!2ˆÔØ%ˆÔØ,ˆÔØ&ˆÔØ*ˆÔØ"'ˆÔådÔ(­$Ñ/Ô/ð 	à/;¸}Ð/LÐ/L˜lÔ+Ð+ÐRgð ˜,Ñ'õ "0°¸lÔ0KÔ!LÐ!]Ð!]È}Ð!]Ð!]ˆDÔÐØÐ"Ý!/Ð0EÔ!FØ"&Ø ØØØ"$Ø$&Ø!Ø %ð	"ñ 	"ô 	"ˆDÔð 'ˆÔÝdÔ&­Ñ-Ô-ð 	ØEQÐU`ÐE`ÐE`¨°LÔ(AÐ(AÐfmˆK˜Ñ%Ý-¨k¸,Ô.GÔHÐWÐWÈ;ÐWÐWˆDÔÐØÐ Ý-¨gÔ6Ø Ø"$Ø"'Ø$%Ø$%Ø#(Ø%ð ñ  ô  ˆDÔð .2Ô-?Ô-JÈdÔN`ÔNkÑ-kÐpqÑ,qˆÔÔ)Ø,:ˆÔÔ)Ø‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"Ð"Ð"ó    c                 óD   — t          j        dt          ¦  «         | j        S )NzHThe `ignore_index` attribute is deprecated and will be removed in v4.47.)ÚwarningsÚwarnÚFutureWarningr%   )r0   s    r4   r1   zPaliGemmaConfig.ignore_index„   s'   € åŒØVÝñ	
ô 	
ð 	
ð Ô!Ð!r5   c                 ó   — || _         d S )N)r%   )r0   Úvalues     r4   r1   zPaliGemmaConfig.ignore_indexŒ   s   € à"ˆÔÐÐr5   c                 ót   •— t          ¦   «                              ¦   «         }|                     dd ¦  «         |S )Nr%   )r.   Úto_dictÚpop)r0   Úoutputr3   s     €r4   r=   zPaliGemmaConfig.to_dict   s/   ø€ Ý‘”—’Ñ"Ô"ˆØ
Š
? DÑ)Ô)Ð)Øˆr5   )NNr   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úis_compositionr/   Úpropertyr1   Úsetterr=   Ú__classcell__)r3   s   @r4   r	   r	      s¿   ø€ € € € € ð.ð .ð` €JØ€Nð ØØØ ØØØð4#ð 4#ð 4#ð 4#ð 4#ð 4#ðl ð"ð "ñ „Xð"ð Ôð#ð #ñ Ôð#ðð ð ð ð ð ð ð ð r5   r	   )rC   r7   Úconfiguration_utilsr   Úutilsr   Úautor   Ú
get_loggerr@   Úloggerr	   r$   r5   r4   ú<module>rM      sŸ   ðð #Ð "à €€€à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !ð 
ˆÔ	˜HÑ	%Ô	%€ðyð yð yð yð yÐ&ñ yô yð yð yð yr5   