Ë
    T^(hu  ã                   ór   — d Z ddlmZ ddlmZ ddlmZmZ  ej                  e	«      Z
 G d„ dee«      ZdgZy)zVitDet model configurationé   )ÚPretrainedConfig)Úlogging)ÚBackboneConfigMixinÚ*get_aligned_output_features_output_indicesc                   óR   ‡ — e Zd ZdZdZdddddddd	d
d
ddddg g dddddfˆ fd„	Zˆ xZS )ÚVitDetConfigaú  
    This is the configuration class to store the configuration of a [`VitDetModel`]. It is used to instantiate an
    VitDet model according to the specified arguments, defining the model architecture. Instantiating a configuration
    with the defaults will yield a similar configuration to that of the VitDet
    [google/vitdet-base-patch16-224](https://huggingface.co/google/vitdet-base-patch16-224) architecture.

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

    Args:
        hidden_size (`int`, *optional*, defaults to 768):
            Dimensionality of the encoder layers and the pooler layer.
        num_hidden_layers (`int`, *optional*, defaults to 12):
            Number of hidden layers in the Transformer encoder.
        num_attention_heads (`int`, *optional*, defaults to 12):
            Number of attention heads for each attention layer in the Transformer encoder.
        mlp_ratio (`int`, *optional*, defaults to 4):
            Ratio of mlp hidden dim to embedding dim.
        hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        layer_norm_eps (`float`, *optional*, defaults to 1e-06):
            The epsilon used by the layer normalization layers.
        image_size (`int`, *optional*, defaults to 224):
            The size (resolution) of each image.
        pretrain_image_size (`int`, *optional*, defaults to 224):
            The size (resolution) of each image during pretraining.
        patch_size (`int`, *optional*, defaults to 16):
            The size (resolution) of each patch.
        num_channels (`int`, *optional*, defaults to 3):
            The number of input channels.
        qkv_bias (`bool`, *optional*, defaults to `True`):
            Whether to add a bias to the queries, keys and values.
        drop_path_rate (`float`, *optional*, defaults to 0.0):
            Stochastic depth rate.
        window_block_indices (`List[int]`, *optional*, defaults to `[]`):
            List of indices of blocks that should have window attention instead of regular global self-attention.
        residual_block_indices (`List[int]`, *optional*, defaults to `[]`):
            List of indices of blocks that should have an extra residual block after the MLP.
        use_absolute_position_embeddings (`bool`, *optional*, defaults to `True`):
            Whether to add absolute position embeddings to the patch embeddings.
        use_relative_position_embeddings (`bool`, *optional*, defaults to `False`):
            Whether to add relative position embeddings to the attention maps.
        window_size (`int`, *optional*, defaults to 0):
            The size of the attention window.
        out_features (`List[str]`, *optional*):
            If used as backbone, list of features to output. Can be any of `"stem"`, `"stage1"`, `"stage2"`, etc.
            (depending on how many stages the model has). If unset and `out_indices` is set, will default to the
            corresponding stages. If unset and `out_indices` is unset, will default to the last stage. Must be in the
            same order as defined in the `stage_names` attribute.
        out_indices (`List[int]`, *optional*):
            If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
            many stages the model has). If unset and `out_features` is set, will default to the corresponding stages.
            If unset and `out_features` is unset, will default to the last stage. Must be in the
            same order as defined in the `stage_names` attribute.

    Example:

    ```python
    >>> from transformers import VitDetConfig, VitDetModel

    >>> # Initializing a VitDet configuration
    >>> configuration = VitDetConfig()

    >>> # Initializing a model (with random weights) from the configuration
    >>> model = VitDetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úvitdeti   é   é   Úgelug        g{®Gáz”?g�íµ ÷Æ°>éà   é   r   TFé    Nc                 óè  •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        dgt+        d| j                  dz   «      D �cg c]  }d|› �‘Œ	 c}z   | _        t/        ||| j,                  ¬«      \  | _        | _        y c c}w )NÚstemé   Ústage)Úout_featuresÚout_indicesÚstage_names© )ÚsuperÚ__init__Úhidden_sizeÚnum_hidden_layersÚnum_attention_headsÚ	mlp_ratioÚ
hidden_actÚdropout_probÚinitializer_rangeÚlayer_norm_epsÚ
image_sizeÚpretrain_image_sizeÚ
patch_sizeÚnum_channelsÚqkv_biasÚdrop_path_rateÚwindow_block_indicesÚresidual_block_indicesÚ use_absolute_position_embeddingsÚ use_relative_position_embeddingsÚwindow_sizeÚranger   r   Ú_out_featuresÚ_out_indices)Úselfr   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r   r   ÚkwargsÚidxÚ	__class__s                           €úm/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/vitdet/configuration_vitdet.pyr   zVitDetConfig.__init__g   s  ø€ ô2 	‰ÑÑ"˜6Ò"à&ˆÔØ!2ˆÔØ#6ˆÔ Ø"ˆŒØ$ˆŒØ(ˆÔØ!2ˆÔØ,ˆÔØ$ˆŒØ#6ˆÔ Ø$ˆŒØ(ˆÔØ ˆŒØ,ˆÔØ$8ˆÔ!Ø&<ˆÔ#Ø0PˆÔ-Ø0PˆÔ-Ø&ˆÔà"˜8ÄÀaÈ×I_ÑI_ÐbcÑIcÓ@dÖ&e¸¨¨s¨e¢}Ò&eÑeˆÔÜ0ZØ%°;ÈD×L\ÑL\ô1
Ñ-ˆÔ˜DÕ-ùò 'fs   Â3C/)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   Ú__classcell__)r3   s   @r4   r   r      s\   ø„ ñIðV €Jð ØØØØØØØØØØØØØØØ!Ø)-Ø).ØØØ÷-2
ñ 2
ó    r   N)r8   Úconfiguration_utilsr   Úutilsr   Úutils.backbone_utilsr   r   Ú
get_loggerr5   Úloggerr   Ú__all__r   r;   r4   ú<module>rB      sD   ðñ !å 3Ý ß cð 
ˆ×	Ñ	˜HÓ	%€ô@
Ð&Ð(8ô @
ðF Ð
�r;   