Ë
    ÛÓ^jO  ã                   ó‚   — 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
  ed	¬
«      e G d„ de«      «       «       ZdgZy)zDPT model configurationé    )Ústricté   )Ú%consolidate_backbone_kwargs_to_config)ÚPreTrainedConfig)Úauto_docstringé   )Ú
AutoConfigzIntel/dpt-large)Ú
checkpointc                   ó   ‡ — e Zd ZU dZdZdeiZdZee	d<   dZ
dez  e	d<   dZedz  e	d	<   d
Zedz  e	d<   dZee	d<   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dz  e	d<   dZeee   z  eeef   z  dz  e	d<   dZeee   z  eeef   z  dz  e	d<   dZedz  e	d<   dZee	d<   dZedz  e	d<   dZee   eed f   z  dz  e	d!<   d"Zee	d#<   d$Zeeez     eeez  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dz  e	d-<   dZ$ee	d.<   dZ%edz  e	d/<   d0Z&ee	d1<   d2Z'ee	d3<   d4Z(eez  e	d5<   d6Z)ee   eed f   z  dz  e	d7<   d8Z*ee   eed f   z  e	d9<   dZ+e,e-z  dz  e	d<   dZ.edz  e	d:<   d;Z/ee	d<<   ˆ fd=„Z0ˆ xZ1S )>Ú	DPTConfiga   
    is_hybrid (`bool`, *optional*, defaults to `False`):
        Whether to use a hybrid backbone. Useful in the context of loading DPT-Hybrid models.
    backbone_out_indices (`list[int]`, *optional*, defaults to `[2, 5, 8, 11]`):
        Indices of the intermediate hidden states to use from backbone.
    readout_type (`str`, *optional*, defaults to `"project"`):
        The readout type to use when processing the readout token (CLS token) of the intermediate hidden states of
        the ViT backbone. Can be one of [`"ignore"`, `"add"`, `"project"`].
        - "ignore" simply ignores the CLS token.
        - "add" passes the information from the CLS token to all other tokens by adding the representations.
        - "project" passes information to the other tokens by concatenating the readout to all other tokens before
          projecting the
        representation to the original feature dimension D using a linear layer followed by a GELU non-linearity.
    reassemble_factors (`list[int]`, *optional*, defaults to `[4, 2, 1, 0.5]`):
        The up/downsampling factors of the reassemble layers.
    neck_hidden_sizes (`list[str]`, *optional*, defaults to `[96, 192, 384, 768]`):
        The hidden sizes to project to for the feature maps of the backbone.
    fusion_hidden_size (`int`, *optional*, defaults to 256):
        The number of channels before fusion.
    head_in_index (`int`, *optional*, defaults to -1):
        The index of the features to use in the heads.
    use_batch_norm_in_fusion_residual (`bool`, *optional*, defaults to `False`):
        Whether to use batch normalization in the pre-activate residual units of the fusion blocks.
    use_bias_in_fusion_residual (`bool`, *optional*, defaults to `True`):
        Whether to use bias in the pre-activate residual units of the fusion blocks.
    add_projection (`bool`, *optional*, defaults to `False`):
        Whether to add a projection layer before the depth estimation head.
    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.
    semantic_classifier_dropout (`float`, *optional*, defaults to 0.1):
        The dropout ratio for the semantic classification head.
    backbone_featmap_shape (`list[int]`, *optional*, defaults to `[1, 1024, 24, 24]`):
        Used only for the `hybrid` embedding type. The shape of the feature maps of the backbone.
    neck_ignore_stages (`list[int]`, *optional*, defaults to `[0, 1]`):
        Used only for the `hybrid` embedding type. The stages of the readout layers to ignore.
    pooler_output_size (`int`, *optional*):
        Dimensionality of the pooler layer. If None, defaults to `hidden_size`.
    pooler_act (`str`, *optional*, defaults to `"tanh"`):
        The activation function to be used by the pooler.

    Example:

    ```python
    >>> from transformers import DPTModel, DPTConfig

    >>> # Initializing a DPT dpt-large style configuration
    >>> configuration = DPTConfig()

    >>> # Initializing a model from the dpt-large style configuration
    >>> model = DPTModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚdptÚbackbone_configé   Úhidden_sizeé   NÚnum_hidden_layersÚnum_attention_headsi   Úintermediate_sizeÚgeluÚ
hidden_actg        Úhidden_dropout_probÚattention_probs_dropout_probg{®Gáz”?Úinitializer_rangegê-�™—q=Úlayer_norm_epsé€  Ú
image_sizeé   Ú
patch_sizer   Únum_channelsFÚ	is_hybridTÚqkv_bias)r   é   é   é   .Úbackbone_out_indicesÚprojectÚreadout_type)é   r   é   g      à?Úreassemble_factors)é`   éÀ   r   r   Úneck_hidden_sizesé   Úfusion_hidden_sizeéÿÿÿÿÚhead_in_indexÚ!use_batch_norm_in_fusion_residualÚuse_bias_in_fusion_residualÚadd_projectionÚuse_auxiliary_headgš™™™™™Ù?Úauxiliary_loss_weightéÿ   Úsemantic_loss_ignore_indexgš™™™™™¹?Úsemantic_classifier_dropout)r)   i   é   r:   Úbackbone_featmap_shape)r   r)   Úneck_ignore_stagesÚpooler_output_sizeÚtanhÚ
pooler_actc                 ó¸  •— | j                   dvrt        d«      ‚| j                  r{t        | j                  t
        «      r| j                  j                  dd«       t        d| j                  dddg d¢g d¢d	d
œdœ|¤Ž\  | _        }| j                   dk7  rNt        d«      ‚|j                  d«      €| j                  �&t        dd| j                  i|¤Ž\  | _        }d | _	        | j                  r| j                  nd | _
        | j                  r| j                  ng | _        | j                  r| j                  n| j                  | _        t        ‰| �<  di |¤Ž y )N)ÚignoreÚaddr&   z8Readout_type must be one of ['ignore', 'add', 'project']Ú
model_typeÚbitÚsameÚ
bottleneck)r   r(   é	   )Ústage1Ústage2Ústage3T)Úglobal_paddingÚ
layer_typeÚdepthsÚout_featuresÚembedding_dynamic_padding)r   Údefault_config_typeÚdefault_config_kwargsr&   z<Readout type must be 'project' when using `DPT-hybrid` mode.Úbackboner   © )r'   Ú
ValueErrorr    Ú
isinstancer   ÚdictÚ
setdefaultr   Úgetr%   r;   r<   r=   r   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €út/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/dpt/configuration_dpt.pyrZ   zDPTConfig.__post_init__{   sQ  ø€ Ø×ÑÐ$@Ñ@ÜÐWÓXÐXà�>Š>Ü˜$×.Ñ.´Ô5Ø×$Ñ$×/Ñ/°¸eÔDä+Pð ,Ø $× 4Ñ 4Ø$)à&,Ø".Ú'Ú$BØ15ñ'ñ,ð ñ,Ñ(ˆDÔ  &ð × Ñ  IÒ-Ü Ð!_Ó`Ð`Ø�Z‰Z˜
Ó#Ð/°4×3GÑ3GÐ3SÜ+Pñ ,Ø $× 4Ñ 4ð,àñ,Ñ(ˆDÔ  &ð )-ˆDÔ%àEIÇ^Â^ d×&AÒ&AÐY]ˆÔ#Ø=A¿^º^ $×"9Ò"9ÐQSˆÔØ=A×=TÒ=T $×"9Ò"9ÐZ^×ZjÑZjˆÔÜ‰ÑÑ' Ó'ó    )2Ú__name__Ú
__module__Ú__qualname__Ú__doc__rC   r	   Úsub_configsr   ÚintÚ__annotations__r   r   r   r   Ústrr   Úfloatr   r   r   r   ÚlistÚtupler   r   r    Úboolr!   r%   r'   r*   r-   r/   r1   r2   r3   r4   r5   r6   r8   r9   r;   r<   r   rV   r   r=   r?   rZ   Ú__classcell__)r]   s   @r^   r   r      s`  ø… ñ7ðr €JØ$ jÐ1€Kð
 €K�ÓØ$&Ð�t˜c‘zÓ&Ø&(Ð˜˜t™Ó(Ø$(Ð�s˜T‘zÓ(Ø€J�ÓØ.1Ð˜ ™ tÑ+Ó1Ø7:Ð  %¨#¡+°Ñ"4Ó:Ø#Ð�uÓ#Ø#(€N�E˜D‘LÓ(Ø;>€J��d˜3‘i‘ %¨¨S¨¡/Ñ1°DÑ8Ó>Ø;=€J��d˜3‘i‘ %¨¨S¨¡/Ñ1°DÑ8Ó=Ø €L�#˜‘*Ó Ø€IˆtÓØ €Hˆd�T‰kÓ Ø?LÐ˜$˜s™) e¨C°¨H¡oÑ5¸Ñ<ÓLØ!€L�#Ó!ØFTÐ˜˜S 5™[Ñ)¨E°#¸±+¸sÐ2BÑ,CÑCÓTØ5HÐ�t˜C‘y 5¨¨c¨¡?Ñ2ÓHØ!Ð˜Ó!Ø€M�3ÓØ5:Ð% t¨d¡{Ó:Ø/3Ð ¨¡Ó3Ø €N�DÓ Ø&*Ð˜˜t™Ó*Ø#&Ð˜5Ó&Ø&)Ð Ó)Ø/2Ð ¨¡Ó2ØARÐ˜D ™I¨¨c°3¨h©Ñ7¸$Ñ>ÓRØ6<Ð˜˜S™	 E¨#¨s¨(¡OÑ3Ó<Ø6:€O�TÐ,Ñ,¨tÑ3Ó:Ø%)Ð˜˜d™
Ó)Ø€J�Ó÷ (ð  (r_   r   N)rc   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   Úauto.configuration_autor	   r   Ú__all__rS   r_   r^   ú<module>rs      sP   ðñ å .å CÝ 3Ý #Ý 0ñ Ð,Ô-ØôA(Ð ó A(ó ó .ðA(ðH ˆ-�r_   