
    i                     j    d Z ddlmZ ddlmZ ddlmZ  ed      e G d d	e                    Zd	gZy
)zSegGpt model configuration    )strict   )PreTrainedConfig)auto_docstringzBAAI/seggpt-vit-large)
checkpointc                       e Zd ZU dZdZdZeed<   dZeed<   dZ	eed<   d	Z
eed
<   dZeez  ed<   dZeed<   dZeed<   dZeee   z  eedf   z  ed<   dZeee   z  eeef   z  ed<   dZeed<   dZeed<   dZedz  ed<   dZeez  ed<   dZeee   z  eeef   z  ed<   dZeed <   dZeed!<   d"Zeed#<   d$Zee   eedf   z  ed%<   d&Zeed'<    fd(Zd) Z  xZ!S )*SegGptConfiga  
    mlp_dim (`int`, *optional*):
        The dimensionality of the MLP layer in the Transformer encoder. If unset, defaults to
        `hidden_size` * 4.
    pretrain_image_size (`int`, *optional*, defaults to 224):
        The pretrained size of the absolute position embeddings.
    use_relative_position_embeddings (`bool`, *optional*, defaults to `True`):
        Whether to use relative position embeddings in the attention layers.
    merge_index (`int`, *optional*, defaults to 2):
        The index of the encoder layer to merge the embeddings.
    intermediate_hidden_state_indices (`list[int]`, *optional*, defaults to `[5, 11, 17, 23]`):
        The indices of the encoder layers which we store as features for the decoder.
    beta (`float`, *optional*, defaults to 0.01):
        Regularization factor for SegGptLoss (smooth-l1 loss).

    Example:

    ```python
    >>> from transformers import SegGptConfig, SegGptModel

    >>> # Initializing a SegGPT seggpt-vit-large style configuration
    >>> configuration = SegGptConfig()

    >>> # Initializing a model (with random weights) from the seggpt-vit-large style configuration
    >>> model = SegGptModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```seggpti   hidden_size   num_hidden_layers   num_attention_headsgelu
hidden_actg        hidden_dropout_probg{Gz?initializer_rangegư>layer_norm_eps)i  i  .
image_size
patch_sizer   num_channelsTqkv_biasNmlp_dimg?drop_path_rate   pretrain_image_size@   decoder_hidden_size use_relative_position_embeddings   merge_index)            !intermediate_hidden_state_indicesg{Gz?betac                     | j                   t        | j                  dz        n| j                   | _         t        |   di | y )N    )r   intr   super__post_init__)selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/seggpt/configuration_seggpt.pyr-   zSegGptConfig.__post_init__M   s9    48LL4Hs4++a/0dll''    c                     | j                   t        | j                        kD  r%t        d| j                   d| j                        y)zOPart of `@strict`-powered validation. Validates the architecture of the config.zYMerge index must be less than the minimum encoder output index, but got self.merge_index=z, and self.intermediate_hidden_state_indices=N)r!   minr&   
ValueError)r.   s    r1   validate_architecturez"SegGptConfig.validate_architectureQ   sb    c$"H"HIIl[_[k[kZm  n[sw  tZ  tZ  s\  ]  Jr2   )"__name__
__module____qualname____doc__
model_typer   r+   __annotations__r   r   r   strr   floatr   r   r   listtupler   r   r   boolr   r   r   r   r   r!   r&   r'   r-   r6   __classcell__)r0   s   @r1   r	   r	      s;   < JKs!!J'**#u# NE 4>Jd3i%S/1>46Jd3i%S/16L#HdGS4Z"%NECK%=@tCy5c?:@!!-1$d1KET%tCy5c?'BTD%(r2   r	   N)	r:   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   __all__r*   r2   r1   <module>rG      sH    ! . 3 # 23># >  4>B 
r2   