Ë
    S^(hY$  ã                   ó¨   — d Z 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
 ddlmZ  ej                  e«      Z G d	„ d
e«      Z G d„ de
«      Zd
dgZy)z"Data2VecVision model configurationé    ©ÚOrderedDict)ÚMapping)Úversioné   )ÚPretrainedConfig)Ú
OnnxConfig)Úloggingc                   óf   ‡ — e Zd ZdZdZddddddddd	d
dddddddddg d¢g d¢ddddddfˆ fd„	Zˆ xZS )ÚData2VecVisionConfigaJ  
    This is the configuration class to store the configuration of a [`Data2VecVisionModel`]. It is used to instantiate
    an Data2VecVision 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 Data2VecVision
    [facebook/data2vec-vision-base](https://huggingface.co/facebook/data2vec-vision-base) architecture.

    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.
        intermediate_size (`int`, *optional*, defaults to 3072):
            Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        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.
        hidden_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        attention_probs_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        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-12):
            The epsilon used by the layer normalization layers.
        image_size (`int`, *optional*, defaults to 224):
            The size (resolution) of each image.
        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.
        use_mask_token (`bool`, *optional*, defaults to `False`):
            Whether to use a mask token for masked image modeling.
        use_absolute_position_embeddings (`bool`, *optional*, defaults to `False`):
            Whether to use BERT-style absolute position embeddings.
        use_relative_position_bias (`bool`, *optional*, defaults to `False`):
            Whether to use T5-style relative position embeddings in the self-attention layers.
        use_shared_relative_position_bias (`bool`, *optional*, defaults to `False`):
            Whether to use the same relative position embeddings across all self-attention layers of the Transformer.
        layer_scale_init_value (`float`, *optional*, defaults to 0.1):
            Scale to use in the self-attention layers. 0.1 for base, 1e-5 for large. Set 0 to disable layer scale.
        drop_path_rate (`float`, *optional*, defaults to 0.1):
            Stochastic depth rate per sample (when applied in the main path of residual layers).
        use_mean_pooling (`bool`, *optional*, defaults to `True`):
            Whether to mean pool the final hidden states of the patches instead of using the final hidden state of the
            CLS token, before applying the classification head.
        out_indices (`List[int]`, *optional*, defaults to `[3, 5, 7, 11]`):
            Indices of the feature maps to use for semantic segmentation.
        pool_scales (`Tuple[int]`, *optional*, defaults to `[1, 2, 3, 6]`):
            Pooling scales used in Pooling Pyramid Module applied on the last feature map.
        use_auxiliary_head (`bool`, *optional*, defaults to `True`):
            Whether to use an auxiliary head during training.
        auxiliary_loss_weight (`float`, *optional*, defaults to 0.4):
            Weight of the cross-entropy loss of the auxiliary head.
        auxiliary_channels (`int`, *optional*, defaults to 256):
            Number of channels to use in the auxiliary head.
        auxiliary_num_convs (`int`, *optional*, defaults to 1):
            Number of convolutional layers to use in the auxiliary head.
        auxiliary_concat_input (`bool`, *optional*, defaults to `False`):
            Whether to concatenate the output of the auxiliary head with the input before the classification layer.
        semantic_loss_ignore_index (`int`, *optional*, defaults to 255):
            The index that is ignored by the loss function of the semantic segmentation model.

    Example:

    ```python
    >>> from transformers import Data2VecVisionConfig, Data2VecVisionModel

    >>> # Initializing a Data2VecVision data2vec_vision-base-patch16-224-in22k style configuration
    >>> configuration = Data2VecVisionConfig()

    >>> # Initializing a model (with random weights) from the data2vec_vision-base-patch16-224-in22k style configuration
    >>> model = Data2VecVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```zdata2vec-visioni   é   i   Úgelug        g{®Gáz”?gê-�™—q=éà   é   r   Fgš™™™™™¹?T)r   é   é   é   )é   é   r   é   gš™™™™™Ù?é   r   éÿ   c                 óž  •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        y )N© )ÚsuperÚ__init__Úhidden_sizeÚnum_hidden_layersÚnum_attention_headsÚintermediate_sizeÚ
hidden_actÚhidden_dropout_probÚattention_probs_dropout_probÚinitializer_rangeÚlayer_norm_epsÚ
image_sizeÚ
patch_sizeÚnum_channelsÚuse_mask_tokenÚ use_absolute_position_embeddingsÚuse_relative_position_biasÚ!use_shared_relative_position_biasÚlayer_scale_init_valueÚdrop_path_rateÚuse_mean_poolingÚout_indicesÚpool_scalesÚuse_auxiliary_headÚauxiliary_loss_weightÚauxiliary_channelsÚauxiliary_num_convsÚauxiliary_concat_inputÚsemantic_loss_ignore_index)Úselfr   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   ÚkwargsÚ	__class__s                                €úx/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/data2vec/configuration_data2vec_vision.pyr   zData2VecVisionConfig.__init__p   sê   ø€ ô> 	‰ÑÑ"˜6Ò"à&ˆÔØ!2ˆÔØ#6ˆÔ Ø!2ˆÔØ$ˆŒØ#6ˆÔ Ø,HˆÔ)Ø!2ˆÔØ,ˆÔà$ˆŒØ$ˆŒØ(ˆÔØ,ˆÔØ0PˆÔ-Ø*DˆÔ'Ø1RˆÔ.Ø&<ˆÔ#Ø,ˆÔØ 0ˆÔà&ˆÔØ&ˆÔà"4ˆÔØ%:ˆÔ"Ø"4ˆÔØ#6ˆÔ Ø&<ˆÔ#Ø*DˆÕ'ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   Ú__classcell__)r:   s   @r;   r   r      sp   ø„ ñMð^ #€Jð ØØØØØØ%(ØØØØØØØ).Ø#(Ø*/Ø"ØØÚ!Ú ØØ!ØØØ$Ø#&÷9>Eñ >Er<   r   c                   óp   — e Zd Z ej                  d«      Zedeeee	ef   f   fd„«       Z
edefd„«       Zy)ÚData2VecVisionOnnxConfigz1.11Úreturnc                 ó(   — t        ddddddœfg«      S )NÚpixel_valuesÚbatchr(   ÚheightÚwidth)r   r   r   r   r   ©r8   s    r;   ÚinputszData2VecVisionOnnxConfig.inputsµ   s&   € äà W°ÀHÐQXÑ!YÐZðó
ð 	
r<   c                  ó   — y)Ng-Cëâ6?r   rK   s    r;   Úatol_for_validationz,Data2VecVisionOnnxConfig.atol_for_validation½   s   € àr<   N)r=   r>   r?   r   ÚparseÚtorch_onnx_minimum_versionÚpropertyr   ÚstrÚintrL   ÚfloatrN   r   r<   r;   rD   rD   ²   sZ   „ Ø!. §¡¨vÓ!6Ðàð
˜  W¨S°#¨XÑ%6Ð 6Ñ7ò 
ó ð
ð ð Uò ó ñr<   rD   N)r@   Úcollectionsr   Útypingr   Ú	packagingr   Úconfiguration_utilsr   Úonnxr	   Úutilsr
   Ú
get_loggerr=   Úloggerr   rD   Ú__all__r   r<   r;   ú<module>r^      s[   ðñ )å #Ý å å 3Ý Ý ð 
ˆ×	Ñ	˜HÓ	%€ôPEÐ+ô PEôh˜zô ð  "Ð#=Ð
>�r<   