Ë
    S^(h¥  ã                   óx   — d Z ddlZddlmZ ddlmZ ddlmZmZ  ej                  e
«      Z G d„ d	e«      Zd	gZy)
zColPali model configurationé    N)Údeepcopyé   )ÚPretrainedConfigé   )ÚCONFIG_MAPPINGÚ
AutoConfigc                   ó>   ‡ — e Zd ZdZdZeedœZ	 	 	 ddefˆ fd„Z	ˆ xZ
S )ÚColPaliConfigaà  
    Configuration class to store the configuration of a [`ColPaliForRetrieval`]. It is used to instantiate an instance
    of `ColPaliForRetrieval` according to the specified arguments, defining the model architecture following the methodology
    from the "ColPali: Efficient Document Retrieval with Vision Language Models" paper.

    Creating a configuration with the default settings will result in a configuration where the VLM backbone is set to the
    default PaliGemma configuration, i.e the one from [vidore/colpali-v1.2](https://huggingface.co/vidore/colpali-v1.2).

    The ColPali config is very similar to [`PaligemmaConfig`], but with an extra attribute defining the embedding dimension.

    Note that contrarily to what the class name suggests (actually the name refers to the ColPali **methodology**), you can
    use a different VLM backbone model than PaliGemma by passing the corresponding VLM configuration to the class constructor.

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

    Args:
        vlm_config (`PretrainedConfig`, *optional*):
            Configuration of the VLM backbone model.
        text_config (`PretrainedConfig`, *optional*):
            Configuration of the text backbone model. Overrides the `text_config` attribute of the `vlm_config` if provided.
        embedding_dim (`int`, *optional*, defaults to 128):
            Dimension of the multi-vector embeddings produced by the model.

    Example:

    ```python
    from transformers.models.colpali import ColPaliConfig, ColPaliForRetrieval

    config = ColPaliConfig()
    model = ColPaliForRetrieval(config)
    ```
    Úcolpali)Ú
vlm_configÚtext_configÚembedding_dimc                 ó<  •— |€#t        d   «       }t        j                  d«       n„t        |t        «      rIt        |«      }d|vrt        d«      ‚|d   t         vrt        d|d   › d�«      ‚t        |d      d
i |¤Ž}n+t        |t        «      r|}nt        dt        |«      › d�«      ‚|| _        |�|n|j                  x| _        }t        | j                  t        «      r$d|v r|d   nd	|d<   t        |d      d
i |¤Ž| _        || _        t        ‰| �<  d
i |¤Ž y )NÚ	paligemmaza`vlm_config` is `None`. Initializing `vlm_config` with the `PaliGemmaConfig` with default values.Ú
model_typez^The `model_type` key is missing in the `vlm_config` dictionary. Please provide the model type.zThe model type `z6` is not supported. Please provide a valid model type.zWInvalid type for `vlm_config`. Expected `PretrainedConfig`, `dict`, or `None`, but got ú.Úgemma© )r   ÚloggerÚinfoÚ
isinstanceÚdictr   ÚKeyErrorÚ
ValueErrorr   Ú	TypeErrorÚtyper   r   r   ÚsuperÚ__init__)Úselfr   r   r   ÚkwargsÚ	__class__s        €úo/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/colpali/configuration_colpali.pyr   zColPaliConfig.__init__A   sO  ø€ ð ÐÜ'¨Ñ4Ó6ˆJÜ�K‰KØsõô ˜
¤DÔ)Ü! *Ó-ˆJØ :Ñ-ÜØtóð ð ˜LÑ)´Ñ?Ü Ø& z°,Ñ'?Ð&@Ð@vÐwóð ô (¨
°<Ñ(@ÑAÑOÀJÑO‰JÜ˜
Ô$4Ô5Ø#‰JäØiÔjnÐoyÓjzÐi{Ð{|Ð}óð ð %ˆŒØ8CÐ8O©ÐU_×UkÑUkÐkˆÔ˜;Ü�d×&Ñ&¬Ô-ØEQÐU`ÑE`¨°LÒ(AÐfmˆK˜Ñ%Ü-¨k¸,Ñ.GÑHÑWÈ;ÑWˆDÔà*ˆÔä‰ÑÑ"˜6Ó"ó    )NNé€   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Úsub_configsÚintr   Ú__classcell__)r!   s   @r"   r
   r
      s9   ø„ ñ ðD €JØ!1À*ÑM€Kð ØØ ñ	&#ð ÷	&#ñ &#r#   r
   )r(   ÚloggingÚcopyr   Úconfiguration_utilsr   Úautor   r   Ú	getLoggerr%   r   r
   Ú__all__r   r#   r"   ú<module>r2      sD   ðñ "ã Ý å 3ß -ð 
ˆ×	Ñ	˜8Ó	$€ôL#Ð$ô L#ð^ Ð
�r#   