a
    ½Àh~  ã                   @   s`   d dl mZ d dlmZ ddlmZ ddlmZ ddlm	Z	 e 
e¡ZG dd	„ d	eƒZd	gZd
S )é    )Údeepcopy)ÚAnyé   )ÚPretrainedConfig)Úloggingé   )ÚCONFIG_MAPPINGc                       sV   e Zd ZU dZdZdeiZeee	f e
d< deedœ‡ fd	d
„Zedœdd„Z‡  ZS )ÚColQwen2Configac  
    Configuration class to store the configuration of a [`ColQ2en2ForRetrieval`]. It is used to instantiate an instance
    of `ColQwen2ForRetrieval` according to the specified arguments, defining the model architecture following the methodology
    from the "ColPali: Efficient Document Retrieval with Vision Language Models" paper.

    Instantiating a configuration with the defaults will yield a similar configuration to the vision encoder used by the pre-trained
    ColQwen2-v1.0 model, e.g. [vidore/colqwen2-v1.0-hf](https://huggingface.co/vidore/colqwen2-v1.0-hf).

    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.
        embedding_dim (`int`, *optional*, defaults to 128):
            Dimension of the multi-vector embeddings produced by the model.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
    Example:

    ```python
    from transformers.models.colqwen2 import ColQwen2Config, ColQwen2ForRetrieval

    config = ColQwen2Config()
    model = ColQwen2ForRetrieval(config)
    ```
    Zcolqwen2Ú
vlm_configÚsub_configsNé€   ç{®Gáz”?)Úembedding_dimÚinitializer_rangec                    s¤   |d u rt d ƒ }t d¡ n^t|tƒrXt|ƒ}d|vr@tdƒ‚t |d  f i |¤Ž}n$t|tƒrh|}ntdt	|ƒ› dƒ‚|| _
|| _|| _tƒ jf i |¤Ž d S )NZqwen2_vlz_`vlm_config` is `None`. Initializing `vlm_config` with the `Qwen2VLConfig` with default values.Ú
model_typez^The `model_type` key is missing in the `vlm_config` dictionary. Please provide the model type.zWInvalid type for `vlm_config`. Expected `PretrainedConfig`, `dict`, or `None`, but got Ú.)r   ÚloggerÚinfoÚ
isinstanceÚdictr   ÚKeyErrorr   Ú	TypeErrorÚtyper
   r   r   ÚsuperÚ__init__)Úselfr
   r   r   Úkwargs©Ú	__class__© úo/var/www/html/assistant/venv/lib/python3.9/site-packages/transformers/models/colqwen2/configuration_colqwen2.pyr   ;   s*    
ÿ
ÿ
ÿzColQwen2Config.__init__)Úreturnc                 O   s   | j j|i |¤ŽS )N)r
   Úget_text_config)r   Úargsr   r   r   r    r"   Z   s    zColQwen2Config.get_text_config)Nr   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ústrr   Ú__annotations__ÚintÚfloatr   r"   Ú__classcell__r   r   r   r    r	      s   
   üür	   N)Úcopyr   Útypingr   Zconfiguration_utilsr   Úutilsr   Úautor   Z
get_loggerr$   r   r	   Ú__all__r   r   r   r    Ú<module>   s   
C