
    qi                     L    d dl mZmZ ddlmZ ddlmZmZ  G d de      ZdgZ	y)	    )AnyLiteral   )PretrainedConfig   )CONFIG_MAPPING
AutoConfigc                        e Zd ZU dZdZeedZeee	f   e
d<   	 	 	 	 	 	 	 	 	 ddedz  dedz  dedz  d	edz  d
ed   dedz  dedz  f fdZ xZS )ModernVBertConfiga  
    This is the configuration class to store the configuration of a [`ModernVBert`] model. It is used to
    instantiate a ModernVBert model according to the specified arguments and defines the model architecture.
    e.g. [ModernVBERT/modernvbert](https://huggingface.co/ModernVBERT/modernvbert).

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

    Args:
        text_config (`AutoConfig`, *optional*): Configuration for the text encoder.
        vision_config (`ModernVBertVisionConfig`, *optional*): Configuration for the vision encoder.
        image_token_id (`int | None`, *optional*, defaults to 50407): The token id reserved for image tokens inserted into the text stream.
        pixel_shuffle_factor (`int | None`, *optional*, defaults to 4): Scale factor used by any pixel-shuffle / upsampling operations in the vision head.
        initializer_range (`float | None`, *optional*, defaults to 0.02): The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        initializer_cutoff_factor (`float | None`, *optional*, defaults to 2.0): The cutoff factor for the truncated_normal_initializer for initializing all weight matrices.
        classifier_pooling (`Literal["cls", "mean"]`, *optional*, defaults to `"cls"`): The pooling strategy to use for classification tasks.
        classifier_dropout (`float | None`, *optional*, defaults to 0.0): The dropout probability for the classification head.
        classifier_bias (`bool | None`, *optional*, defaults to `False`): Whether to add a bias term to the classification head.

    Example:
    ```python
    >>> from transformers import ModernVBertConfig

    >>> # Initializing configuration
    >>> configuration = ModernVBertConfig()

    >>> # Initializing a model from the configuration (model class is implemented in
    >>> # `modernvbert.modeling_modernvbert`)

    >>> from transformers import ModernVBertModel
    >>> model = ModernVBertModel(configuration)

    >>> # Accessing the model configuration
    >>> cfg = model.config
    ```modernvbert)text_configvision_configsub_configsNimage_token_idpixel_shuffle_factorinitializer_rangeinitializer_cutoff_factorclassifier_poolingclsmeanclassifier_dropoutclassifier_biasc
                 v   |dvrt        d| d      |t        d          }nt        |t              rt        d   di |}|| _        |t        d          }nt        |t              rt        d   di |}|| _        || _        || _        || _        || _	        || _
        |	| _        t        | 4  dd|i|
 y )Nr   zQInvalid value for `classifier_pooling`, should be either "cls" or "mean", but is .
modernbertsiglip_vision_modelr    )
ValueErrorr   
isinstancedictr   r   r   r   r   r   r   r   super__init__)selfr   r   r   r   r   r   r   r   r   kwargs	__class__s              k/opt/pipecat/venv/lib/python3.12/site-packages/transformers/models/modernvbert/configuration_modernvbert.pyr#   zModernVBertConfig.__init__C   s     _4cdvcwwxy  (68KT*(6EEK& *+@ACMt,*+@ARMRM*$8!!2)B&"4"4.AA&A    )	NNi     g{Gz?g       @r   g        F)__name__
__module____qualname____doc__
model_typer	   r   r!   strr   __annotations__intfloatr   boolr#   __classcell__)r&   s   @r'   r   r      s    "H J2<z"ZKc3hZ %*+,*.255:+.',%B d
	%B
 "Dj%B !4<%B $)4<%B $M2%B "DL%B %B %Br(   r   N)
typingr   r   configuration_utilsr   autor   r	   r   __all__r   r(   r'   <module>r9      s,   *   3 -MB( MB` 
r(   