o
    ei                     @   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                       s^   e Zd ZU dZdZdeiZeee	f e
d< 			dded	ef fd
dZdef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)
    ```
    colqwen2
vlm_configsub_configsN   {Gz?embedding_diminitializer_rangec                    s   |d u rt d  }td n,t|tr,t|}d|vr tdt |d  di |}nt|ts;tdt	| dt
|dsF| j|_|| _|| _|| _t jdi | d S )	N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 .
vocab_size )r   loggerinfo
isinstancedictr   KeyErrorr   	TypeErrortypehasattrget_text_configr   r   r   r   super__init__)selfr   r   r   kwargs	__class__r   q/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/transformers/models/colqwen2/configuration_colqwen2.pyr    ;   s,   



zColQwen2Config.__init__returnc                 O   s   | j j|i |S )N)r   r   )r!   argsr"   r   r   r%   r   [   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   configuration_utilsr   utilsr   autor   
get_loggerr(   r   r	   __all__r   r   r   r%   <module>   s   

D