
    is                         d dl mZ d dlmZ ddlmZ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 e
d	
      e G d de                    ZddgZy)    )Sequence)strict   )BackboneConfigMixin%consolidate_backbone_kwargs_to_config)PreTrainedConfig)auto_docstring   )
AutoConfigzPaddlePaddle/UVDoc_safetensors)
checkpointc                        e Zd ZU dZdZdZee   dz  ed<   dZ	ee
   dz  ed<   dZeee
   ee
df   z     ed<   d	Zeeee
e
e
ef   ee
ez     z        ed
<   dZeeee
df   ee
   z        ed<   dZe
ed<    fdZ xZS )UVDocBackboneConfiga  
    resnet_head (`Sequence[list[int] | tuple[int, ...]]`, *optional*, defaults to `((3, 32), (32, 32))`):
        Configuration for the ResNet head layers in format [in_channels, out_channels].
    resnet_configs (`Sequence[Sequence[tuple[int, int, int, bool] | list[int | bool]]]`, *optional*, defaults to `(((32, 32, 1, False),
        (32, 32, 3, False), (32, 32, 3, False)), ((32, 64, 1, True), (64, 64, 3, False), (64, 64, 3, False), (64, 64, 3, False)), ((64, 128, 1, True),
        (128, 128, 3, False), (128, 128, 3, False), (128, 128, 3, False), (128, 128, 3, False), (128, 128, 3, False)))`):
        Configuration for the ResNet stages in format [in_channels, out_channels, dilation_value, downsample].
    stage_configs (Sequence[Sequence[tuple[int, ...] | list[int]]], *optional*, defaults to `(((128, 1),), ((128, 2),),
        ((128, 5),), ((128, 8),(128, 3),(128, 2),), ((128, 12), (128, 7), (128, 4),), ((128, 18), (128, 12), (128, 6),),)`):
        Configuration for the bridge module stages in format [in_channels, dilation_value].
        Each inner sequence corresponds to a single bridge block, and the outer sequence groups blocks by bridge stage.
    uvdoc_backboneN_out_features_out_indices))r       )r   r   .resnet_head)))r   r      Fr   r   r   Fr   ))r   @   r   Tr   r   r   Fr   r   ))r      r   Tr   r   r   Fr   r   r   r   resnet_configs)))r   r   )r   r
   ))r      ))r      )r   r   r   )r      )r      )r      ))r      r   )r      stage_configsr   kernel_sizec                 f   | j                   D cg c]  }t        |       c}| _        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 c c}w )Nstemr   stageout_indicesout_features)r)   r*    )	r$   lendepthsrangestage_names"set_output_features_output_indicespopsuper__post_init__)selfkwargsstagesidx	__class__s       ~/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/uvdoc/configuration_uvdoc.pyr3   z!UVDocBackboneConfig.__post_init__g   s    151C1CDvs6{D"8aTM_M_I`cdId@e&fse}&ff//

=$7fjjQ_aeFf 	0 	
 	'' E&fs   B)B.)__name__
__module____qualname____doc__
model_typer   liststr__annotations__r   intr   r   tupler   boolr$   r%   r3   __classcell__r8   s   @r9   r   r       s     "J&*M49t#*%)L$s)d"):K$s)eCHo56 
YNHXeCc4,?&@4d
CS&STU ,FM8HU38_tCy%@AB * K( (    r   c                        e Zd ZU dZdZdeiZdZee	z  d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edf   z     e
d<    fdZ xZS )UVDocConfiga  
    padding_mode (`str`, *optional*, defaults to `"reflect"`):
        Padding mode for convolutional layers. Supported modes are `"reflect"`, `"constant"`, and `"replicate"`.
    kernel_size (`int`, *optional*, defaults to 5):
        Kernel size for convolutional layers in the backbone network.
    bridge_connector (`list[int] | tuple[int, ...]`, *optional*, defaults to `(128, 128)`):
        Configuration for the bridge connector in format [in_channels, out_channels].
    out_point_positions2D (`Sequence[list[int] | tuple[int, ...]]`, *optional*, defaults to `((128, 32), (32, 2))`):
        Configuration for the output point positions 2D layer in format [in_channels, out_channels].
    uvdocbackbone_configNprelu
hidden_actreflectpadding_moder   r%   )r   r   .bridge_connector))r   r   )r   r
   out_point_positions2Dc                 d    t        d| j                  dd|\  | _        }t        |   di | y )Nr   )rK   default_config_typer+   )r   rK   r2   r3   )r4   r5   r8   s     r9   r3   zUVDocConfig.__post_init__   sB    'L (
 00 0(
 (
$f
 	''rG   )r:   r;   r<   r=   r>   r   sub_configsrK   dictr   rA   rM   r@   rO   r%   rB   rP   r?   rC   rQ   r   r3   rE   rF   s   @r9   rI   rI   p   s    	 J$j1K6:OT,,t3:J!L#!K4>d3i%S/1>CW8DIc3h$?@W( (rG   rI   N)collections.abcr   huggingface_hub.dataclassesr   backbone_utilsr   r   configuration_utilsr   utilsr	   autor   r   rI   __all__r+   rG   r9   <module>r]      s   , % . X 3 #  ;<K(-/? K(  =K(\ ;<(" (  =(> !-
0rG   