
    qi                         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j                  e      Z G d d	e      Zd	gZy
)    )deepcopy)Any   )PreTrainedConfig)logging   )CONFIG_MAPPINGc                   b     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Zdefd	Z xZS )ColModernVBertConfiga  
    Configuration class to store the configuration of a [`ColModernVBertForRetrieval`]. It is used to instantiate an instance
    of `ColModernVBertForRetrieval` 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
    ColModernVBert model, e.g. [ModernVBERT/colmodernvbert-merged](https://huggingface.co/ModernVBERT/colmodernvbert-merged).

    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 import ColModernVBertConfig, ColModernVBertForRetrieval

    config = ColModernVBertConfig()
    model = ColModernVBertForRetrieval(config)
    ```
    colmodernvbert
vlm_configsub_configsembedding_diminitializer_rangec                    |#t        d          }t        j                  d       ndt        |t              r,t        |      }d|vrt        d      t        |d      di |}n(t        |t              st        dt        |       d      t        |d      s|j                         j                  |_        || _        || _        || _        t!        | D  di | y )	Nmodernvbertzc`vlm_config` is `None`. Initializing `vlm_config` with the `ModernVBertConfig` 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__s        q/opt/pipecat/venv/lib/python3.12/site-packages/transformers/models/colmodernvbert/configuration_colmodernvbert.pyr!   zColModernVBertConfig.__init__@   s     '68JKKu 
D)!*-J:-t  (
<(@AOJOJJ(89ijnoyjzi{{|}  z<0$.$>$>$@$K$KJ!$*!2"6"    returnc                 :     | j                   j                  |i |S )N)r   r   )r"   argsr#   s      r%   r   z$ColModernVBertConfig.get_text_config`   s    .t..???r&   )N   g{Gz?)__name__
__module____qualname____doc__r   r   r   r   strr   __annotations__intfloatr!   r   __classcell__)r$   s   @r%   r   r       s[    8 "J#/1A"BKc3hB  #'	# # !	#@@2B @r&   r   N)copyr   typingr   configuration_utilsr   utilsr   autor	   
get_loggerr+   r   r   __all__r   r&   r%   <module>r;      sF   *   3  ! 
		H	%A@+ A@H "
"r&   