
    i                         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	m
Z
  ed	      e G d
 de                    ZdgZy)    )Literal)strict   )PreTrainedConfig)auto_docstring   )CONFIG_MAPPING
AutoConfigzModernVBERT/modernvbert)
checkpointc                        e Zd ZU dZdZeedZdZee	z  dz  e
d<   dZee	z  dz  e
d<   dZee
d<   d	Zee
d
<   dZee
d<   dZee
d<   dZed   e
d<   dZeez  e
d<   dZee
d<   dZee
d<    fdZ xZS )ModernVBertConfiga?  
    pixel_shuffle_factor (`int | None`, *optional*, defaults to 4):
        Scale factor used by any pixel-shuffle / upsampling operations in the vision head.
    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_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_configNr   r   i  image_token_id   pixel_shuffle_factorg{Gz?initializer_rangeg       @initializer_cutoff_factorcls)r   meanclassifier_poolingg        classifier_dropoutFclassifier_biastie_word_embeddingsc                 |   | j                   t        d          | _         n7t        | j                   t              rt        d   di | j                   | _         | j                  t        d          | _        n7t        | j                  t              rt        d   di | j                  | _        t        |   di | y )N
modernbertsiglip_vision_model )r   r	   
isinstancedictr   super__post_init__)selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/modernvbert/configuration_modernvbert.pyr#   zModernVBertConfig.__post_init__J   s    #-l;=D(($/-l;Od>N>NOD%!/0E!F!HD**D1!/0E!F!\I[I[!\D''    )__name__
__module____qualname____doc__
model_typer
   sub_configsr   r   r!   __annotations__r   r   intr   r   floatr   r   r   r   r   boolr   r#   __classcell__)r&   s   @r'   r   r      s    6 J",zJK26K!D(4/648M#d*T18NC !#!#u#'*u*16.6&))!OT! %%( (r(   r   N)typingr   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   autor	   r
   r   __all__r   r(   r'   <module>r:      sK   *  . 3 # - 455(( 5(  65(p 
r(   