
    iV                     x    d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed      e G d	 d
ee                    Z	d
gZ
y)zBiT model configuration    )strict   )BackboneConfigMixin)PreTrainedConfig)auto_docstringzgoogle/bit-50)
checkpointc                   R    e Zd ZU dZdZddgZg dZ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   eed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	d<   dZeez  e	d<   dZee	d<   dZee	d<   dZee	d<   dZee   dz  e	d<   dZee   dz  e	d<    fdZd  Z xZS )!	BitConfiga&  
    layer_type (`str`, *optional*, defaults to `"preactivation"`):
        The layer to use, it can be either `"preactivation"` or `"bottleneck"`.
    global_padding (`str`, *optional*):
        Padding strategy to use for the convolutional layers. Can be either `"valid"`, `"same"`, or `None`.
    num_groups (`int`, *optional*, defaults to 32):
        Number of groups used for the `BitGroupNormActivation` layers.
    embedding_dynamic_padding (`bool`, *optional*, defaults to `False`):
        Whether or not to make use of dynamic padding for the embedding layer.
    width_factor (`int`, *optional*, defaults to 1):
        The width factor for the model.

    Example:
    ```python
    >>> from transformers import BitConfig, BitModel

    >>> # Initializing a BiT bit-50 style configuration
    >>> configuration = BitConfig()

    >>> # Initializing a model (with random weights) from the bit-50 style configuration
    >>> model = BitModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    bitpreactivation
bottleneck)NSAMEVALIDr   num_channels@   embedding_size)   i   i   i   .hidden_sizes)r         r   depths
layer_typerelu
hidden_actNglobal_padding    
num_groupsg        drop_path_rateFembedding_dynamic_paddingoutput_stride   width_factor_out_features_out_indicesc                    t        | j                        | _        t        | j                        | _        | j                  | j                  j	                         | _        dgt        dt        | j                        dz         D cg c]  }d| 	 c}z   | _        | j                  |j                  dd       |j                  dd              t        | ,  di | y c c}w )Nstemr!   stageout_indicesout_features)r(   r)    )listr   r   r   upperrangelenstage_names"set_output_features_output_indicespopsuper__post_init__)selfkwargsidx	__class__s      z/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/bit/configuration_bit.pyr3   zBitConfig.__post_init__H   s     !2!234;;'*"&"5"5";";"=D"8aT[[IY\]I]@^&_se}&__//

=$7fjjQ_aeFf 	0 	
 	'' '`s   C c                     | j                   | j                  vr4t        d| j                    ddj                  | j                               | j                  | j
                  vrt        d| j                   d      y)zOPart of `@strict`-powered validation. Validates the architecture of the config.zlayer_type=z is not one of ,zPadding strategy z not supportedN)r   layer_types
ValueErrorjoinr   supported_padding)r4   s    r8   validate_architecturezBitConfig.validate_architectureV   sw    ??$"2"22{4??*;?388TXTdTdKeJfghhd&<&<<01D1D0E^TUU =    )__name__
__module____qualname____doc__
model_typer;   r>   r   int__annotations__r   r   r+   tupler   r   strr   r   r   r   floatr   boolr    r"   r#   r$   r3   r?   __classcell__)r7   s   @r8   r
   r
      s    6 J"L1K/L#NC0FL$s)eCHo-F*6FDIc3h'6%J%J!%NC$J%J"%NECK%&+t+M3L#&*M49t#*%)L$s)d")(Vr@   r
   N)rD   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   r
   __all__r*   r@   r8   <module>rR      sR     . 1 3 # ?+CV#%5 CV  ,CVL -r@   