
    i!                        d Z ddlmZ ddlmZ ddlmZmZ  ej                  e	      Z
 ed      e G d d	e                    Z ed      e G d
 de                    Z ed      e G d de                    Zg dZy)zALIGN model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzkakaobrain/align-base)
checkpointc                      e Zd ZU dZ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d<   dZeed<   dZeez  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<   dZedz  ed<   dZedz  ed<   dZeee   z  dz  ed<   y)AlignTextConfiga  
    Example:

    ```python
    >>> from transformers import AlignTextConfig, AlignTextModel

    >>> # Initializing a AlignTextConfig with kakaobrain/align-base style configuration
    >>> configuration = AlignTextConfig()

    >>> # Initializing a AlignTextModel (with random weights) from the kakaobrain/align-base style configuration
    >>> model = AlignTextModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```align_text_modeltext_configi:w  
vocab_sizei   hidden_size   num_hidden_layersnum_attention_headsi   intermediate_sizegelu
hidden_actg?hidden_dropout_probattention_probs_dropout_probi   max_position_embeddings   type_vocab_size{Gz?initializer_rangeg-q=layer_norm_epsr   Npad_token_idbos_token_ideos_token_id)__name__
__module____qualname____doc__
model_typebase_config_keyr   int__annotations__r   r   r   r   r   strr   floatr   r   r   r   r   r   r   r   list     ~/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/align/configuration_align.pyr
   r
      s      $J#OJKs!!!s!J'**03 %#+3#&S&OS#u#!NE! L#* #L#*#+/L#S	/D(/r,   r
   c                       e Zd ZU dZdZdZdZe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   eedf   z  ed<   dZe
e   eedf   z  ed<   dZe
eedf   z  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   eedf   z  ed<   dZeed<   dZeed <   d!Zeed"<   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,<    fd-Z  xZ!S ).AlignVisionConfiga	  
    width_coefficient (`float`, *optional*, defaults to 2.0):
        Scaling coefficient for network width at each stage.
    depth_coefficient (`float`, *optional*, defaults to 3.1):
        Scaling coefficient for network depth at each stage.
    depth_divisor (`int`, *optional*, defaults to 8):
        A unit of network width.
    kernel_sizes (`list[int]`, *optional*, defaults to `[3, 3, 5, 3, 5, 5, 3]`):
        List of kernel sizes to be used in each block.
    in_channels (`list[int]`, *optional*, defaults to `[32, 16, 24, 40, 80, 112, 192]`):
        List of input channel sizes to be used in each block for convolutional layers.
    out_channels (`list[int]`, *optional*, defaults to `[16, 24, 40, 80, 112, 192, 320]`):
        List of output channel sizes to be used in each block for convolutional layers.
    depthwise_padding (`list[int]`, *optional*, defaults to `[]`):
        List of block indices with square padding.
    strides (`list[int]`, *optional*, defaults to `[1, 2, 2, 2, 1, 2, 1]`):
        List of stride sizes to be used in each block for convolutional layers.
    num_block_repeats (`list[int]`, *optional*, defaults to `[1, 2, 2, 3, 3, 4, 1]`):
        List of the number of times each block is to repeated.
    expand_ratios (`list[int]`, *optional*, defaults to `[1, 6, 6, 6, 6, 6, 6]`):
        List of scaling coefficient of each block.
    squeeze_expansion_ratio (`float`, *optional*, defaults to 0.25):
        Squeeze expansion ratio.
    hidden_dim (`int`, *optional*, defaults to 1280):
        The hidden dimension of the layer before the classification head.
    pooling_type (`str` or `function`, *optional*, defaults to `"mean"`):
        Type of final pooling to be applied before the dense classification head. Available options are [`"mean"`,
        `"max"`]
    batch_norm_momentum (`float`, *optional*, defaults to 0.99):
        The momentum used by the batch normalization layers.
    drop_connect_rate (`float`, *optional*, defaults to 0.2):
        The drop rate for skip connections.

    Example:

    ```python
    >>> from transformers import AlignVisionConfig, AlignVisionModel

    >>> # Initializing a AlignVisionConfig with kakaobrain/align-base style configuration
    >>> configuration = AlignVisionConfig()

    >>> # Initializing a AlignVisionModel (with random weights) from the kakaobrain/align-base style configuration
    >>> model = AlignVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```align_vision_modelvision_configr   num_channelsiX  
image_sizeg       @width_coefficientg@depth_coefficient   depth_divisor)r   r      r   r8   r8   r   .kernel_sizes)          (   P   p      in_channels)r;   r<   r=   r>   r?   r@   i@  out_channelsr+   depthwise_padding)   r   r   r   rD   r   rD   strides)rD   r   r   r   r      rD   num_block_repeats)rD      rH   rH   rH   rH   rH   expand_ratiosg      ?squeeze_expansion_ratioswishr   i 
  
hidden_dimmeanpooling_typer   r   gMbP?batch_norm_epsgGz?batch_norm_momentumg?drop_connect_ratec                     t        | j                        dz  | _        dD ]"  }t        | |t	        t        | |                   $ t        |   di | y )NrF   )r9   rA   rB   rC   rE   rG   rI   r+   )sumrG   r   setattrr*   getattrsuper__post_init__)selfkwargsattr	__class__s      r-   rW   zAlignVisionConfig.__post_init__   sX    !$T%;%;!<q!@
 
	;D D$WT4%8 9:
	; 	''r,   )"r    r!   r"   r#   r$   r%   r2   r&   r'   r3   r*   tupler4   r)   r5   r7   r9   rA   rB   rC   rE   rG   rI   rJ   r   r(   rL   rN   r   rO   rP   rQ   rW   __classcell__r[   s   @r-   r/   r/   @   s{   .` &J%OL#47Jd3i%S/17"u""u"M30EL$s)eCHo-E/MKcU38_,M0OL$s)eCHo-O02teCHo-2+@GT#YsCx(@5JtCy5c?2J1FM49uS#X.F%)U)JJL##u#!NE!!%%%(us{(( (r,   r/   c                        e Zd ZU dZdZeedZdZe	e
z  dz  ed<   dZe	e
z  dz  ed<   dZeed<   d	Zeed
<   dZeed<    fdZ xZS )AlignConfiga  
    temperature_init_value (`float`, *optional*, defaults to 1.0):
        The initial value of the *temperature* parameter. Default is used as per the original ALIGN implementation.

    Example:

    ```python
    >>> from transformers import AlignConfig, AlignModel

    >>> # Initializing a AlignConfig with kakaobrain/align-base style configuration
    >>> configuration = AlignConfig()

    >>> # Initializing a AlignModel (with random weights) from the kakaobrain/align-base style configuration
    >>> model = AlignModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config

    >>> # We can also initialize a AlignConfig from a AlignTextConfig and a AlignVisionConfig
    >>> from transformers import AlignTextConfig, AlignVisionConfig

    >>> # Initializing ALIGN Text and Vision configurations
    >>> config_text = AlignTextConfig()
    >>> config_vision = AlignVisionConfig()

    >>> config = AlignConfig(text_config=config_text, vision_config=config_vision)
    ```align)r   r1   Nr   r1   i  projection_dimg      ?temperature_init_valuer   r   c                    | j                   %t               | _         t        j                  d       n4t	        | j                   t
              rt        di | j                   | _         | j                  %t               | _        t        j                  d       n4t	        | j                  t
              rt        di | j                  | _        t        | $  di | y )NzP`text_config` is `None`. Initializing the `AlignTextConfig` with default values.zT`vision_config` is `None`. initializing the `AlignVisionConfig` with default values.r+   )
r   r
   loggerinfo
isinstancedictr1   r/   rV   rW   )rX   rY   r[   s     r-   rW   zAlignConfig.__post_init__   s    #.0DKKjk(($/.B1A1ABD%!2!4DKKno**D1!2!HT5G5G!HD''r,   )r    r!   r"   r#   r$   r
   r/   sub_configsr   rh   r   r'   r1   rb   r&   rc   r)   r   rW   r]   r^   s   @r-   r`   r`      sn    8 J"1DUVK26K((4/648M4**T18NC$'E'#u#( (r,   r`   )r
   r/   r`   N)r#   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr    re   r
   r/   r`   __all__r+   r,   r-   <module>ro      s      . 3 , 
		H	% 23"0& "0  4"0J 23V(( V(  4V(r 233(" 3(  43(l Br,   