Ë
    T^(h2  ã                   ó°   — d Z ddlmZ ddlmZmZ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Pvt model configurationé    ©ÚOrderedDict)ÚCallableÚListÚMapping)Úversioné   )ÚPretrainedConfig)Ú
OnnxConfig)Úloggingc            %       óæ   ‡ — e Zd ZdZdZdddg d¢g d¢g d¢g d	¢g d	¢g d
¢g d¢ddddddddfdedededee   dee   dee   dee   dee   dee   dee   deee	f   de
de
de
d e
d!e
d"ed#ef$ˆ fd$„Zˆ xZS )%Ú	PvtConfigaM  
    This is the configuration class to store the configuration of a [`PvtModel`]. It is used to instantiate an Pvt
    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 Pvt
    [Xrenya/pvt-tiny-224](https://huggingface.co/Xrenya/pvt-tiny-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:
        image_size (`int`, *optional*, defaults to 224):
            The input image size
        num_channels (`int`, *optional*, defaults to 3):
            The number of input channels.
        num_encoder_blocks (`int`, *optional*, defaults to 4):
            The number of encoder blocks (i.e. stages in the Mix Transformer encoder).
        depths (`List[int]`, *optional*, defaults to `[2, 2, 2, 2]`):
            The number of layers in each encoder block.
        sequence_reduction_ratios (`List[int]`, *optional*, defaults to `[8, 4, 2, 1]`):
            Sequence reduction ratios in each encoder block.
        hidden_sizes (`List[int]`, *optional*, defaults to `[64, 128, 320, 512]`):
            Dimension of each of the encoder blocks.
        patch_sizes (`List[int]`, *optional*, defaults to `[4, 2, 2, 2]`):
            Patch size before each encoder block.
        strides (`List[int]`, *optional*, defaults to `[4, 2, 2, 2]`):
            Stride before each encoder block.
        num_attention_heads (`List[int]`, *optional*, defaults to `[1, 2, 5, 8]`):
            Number of attention heads for each attention layer in each block of the Transformer encoder.
        mlp_ratios (`List[int]`, *optional*, defaults to `[8, 8, 4, 4]`):
            Ratio of the size of the hidden layer compared to the size of the input layer of the Mix FFNs in the
            encoder blocks.
        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.
        drop_path_rate (`float`, *optional*, defaults to 0.0):
            The dropout probability for stochastic depth, used in the blocks of the Transformer encoder.
        layer_norm_eps (`float`, *optional*, defaults to 1e-06):
            The epsilon used by the layer normalization layers.
        qkv_bias (`bool`, *optional*, defaults to `True`):
            Whether or not a learnable bias should be added to the queries, keys and values.
        num_labels ('int', *optional*, defaults to 1000):
            The number of classes.
    Example:

    ```python
    >>> from transformers import PvtModel, PvtConfig

    >>> # Initializing a PVT Xrenya/pvt-tiny-224 style configuration
    >>> configuration = PvtConfig()

    >>> # Initializing a model from the Xrenya/pvt-tiny-224 style configuration
    >>> model = PvtModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úpvtéà   r	   é   )é   r   r   r   )é   r   r   é   )é@   é€   i@  i   )r   r   r   r   )r   r   é   r   )r   r   r   r   Úgelug        g{®Gáz”?g�íµ ÷Æ°>Tiè  Ú
image_sizeÚnum_channelsÚnum_encoder_blocksÚdepthsÚsequence_reduction_ratiosÚhidden_sizesÚpatch_sizesÚstridesÚnum_attention_headsÚ
mlp_ratiosÚ
hidden_actÚhidden_dropout_probÚattention_probs_dropout_probÚinitializer_rangeÚdrop_path_rateÚlayer_norm_epsÚqkv_biasÚ
num_labelsc                 ó   •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |
| _
        |	| _        || _        || _        || _        || _        || _        || _        || _        || _        y )N© )ÚsuperÚ__init__r   r   r   r   r   r   r   r    r"   r!   r#   r$   r%   r&   r'   r(   r*   r)   )Úselfr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   ÚkwargsÚ	__class__s                       €úg/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/pvt/configuration_pvt.pyr.   zPvtConfig.__init__b   sž   ø€ ô, 	‰ÑÑ"˜6Ò"à$ˆŒØ(ˆÔØ"4ˆÔØˆŒØ)BˆÔ&Ø(ˆÔØ&ˆÔØˆŒØ$ˆŒØ#6ˆÔ Ø$ˆŒØ#6ˆÔ Ø,HˆÔ)Ø!2ˆÔØ,ˆÔØ,ˆÔØ$ˆŒØ ˆ�ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚintr   r   Ústrr   ÚfloatÚboolr.   Ú__classcell__)r1   s   @r2   r   r       s)  ø„ ñ=ð~ €Jð ØØ"#Ú(Ú/;Ú"5Ú!-Ú)Ú)5Ú ,Ø-3Ø%(Ø.1Ø#'Ø #Ø $ØØñ')!àð)!ð ð)!ð  ð	)!ð
 �S‘	ð)!ð $(¨¡9ð)!ð ˜3‘ið)!ð ˜#‘Yð)!ð �c‘ð)!ð " #™Yð)!ð ˜‘Ið)!ð ˜C ˜MÑ*ð)!ð #ð)!ð ',ð)!ð !ð)!ð  ð!)!ð" ð#)!ð$ ð%)!ð& ÷')!ñ )!r3   r   c                   ó†   — 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ede	fd„«       Zy)ÚPvtOnnxConfigz1.11Úreturnc                 ó(   — t        ddddddœfg«      S )NÚpixel_valuesÚbatchr   ÚheightÚwidth)r   r   r   r	   r   ©r/   s    r2   ÚinputszPvtOnnxConfig.inputs‘   s&   € äà W°ÀHÐQXÑ!YÐZðó
ð 	
r3   c                  ó   — y)Ng-Cëâ6?r,   rF   s    r2   Úatol_for_validationz!PvtOnnxConfig.atol_for_validation™   s   € àr3   c                  ó   — y)Né   r,   rF   s    r2   Údefault_onnx_opsetz PvtOnnxConfig.default_onnx_opset�   s   € àr3   N)r4   r5   r6   r   ÚparseÚtorch_onnx_minimum_versionÚpropertyr   r:   r9   rG   r;   rI   rL   r,   r3   r2   r?   r?   Ž   su   „ Ø!. §¡¨vÓ!6Ðàð
˜  W¨S°#¨XÑ%6Ð 6Ñ7ò 
ó ð
ð ð Uò ó ðð ð Cò ó ñr3   r?   N)r7   Úcollectionsr   Útypingr   r   r   Ú	packagingr   Úconfiguration_utilsr
   Úonnxr   Úutilsr   Ú
get_loggerr4   Úloggerr   r?   Ú__all__r,   r3   r2   ú<module>rY      s[   ðñ" å #ß *Ñ *å å 3Ý Ý ð 
ˆ×	Ñ	˜HÓ	%€ôk!Ð ô k!ô\�Jô ð( ˜Ð
(�r3   