§
    ‚ŠtjO  ã                   óœ   — 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dS )zDPT model configurationé    )Ústricté   )Ú%consolidate_backbone_kwargs_to_config)ÚPreTrainedConfig)Úauto_docstringé   )Ú
AutoConfigzIntel/dpt-large)Ú
checkpointc                   ót  ‡ — 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  •— | j         dvrt          d¦  «        ‚| j        rwt          | j        t
          ¦  «        r| j                             dd¦  «         t          d| j        dddg d¢g d¢d	d
œdœ|¤Ž\  | _        }| j         dk    rt          d¦  «        ‚n>|                     d¦  «        €| j        �"t          dd| j        i|¤Ž\  | _        }d | _	        | j        r| j
        nd | _
        | j        r| j        ng | _        | j        r| j        n| j        | _         t          ¦   «         j        di |¤Ž d S )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     €úg/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/dpt/configuration_dpt.pyrZ   zDPTConfig.__post_init__{   s—  ø€ ØÔÐ$@Ð@Ð@ÝÐWÑXÔXÐXàŒ>ð 	-Ý˜$Ô.µÑ5Ô5ð EØÔ$×/Ò/°¸eÑDÔDÐDå+Pð ,Ø $Ô 4Ø$)à&,Ø".Ø'˜i˜iØ$BÐ$BÐ$BØ15ð'ð 'ð,ð ,ð ð,ð ,Ñ(ˆDÔ  &ð Ô  IÒ-Ð-Ý Ð!_Ñ`Ô`Ð`ð .à�ZŠZ˜
Ñ#Ô#Ð/°4Ô3GÐ3SÝ+Pð ,ð ,Ø $Ô 4ð,àð,ð ,Ñ(ˆDÔ  &ð )-ˆDÔ%àEIÄ^Ð&] dÔ&AÐ&AÐY]ˆÔ#Ø=A¼^Ð"S $Ô"9Ð"9ÐQSˆÔØ=AÔ=TÐ"j $Ô"9Ð"9ÐZ^Ô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      sR  ø€ € € € € € ð7ð 7ðr €JØ$ jÐ1€Kð
 €K�ÐÐÑØ$&Ð�t˜c‘zÐ&Ð&Ñ&Ø&(Ð˜˜t™Ð(Ð(Ñ(Ø$(Ð�s˜T‘zÐ(Ð(Ñ(Ø€J�ÐÐÑØ.1Ð˜ ™ tÑ+Ð1Ð1Ñ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ÑLØ!€L�#Ð!Ð!Ñ!ØFTÐ˜˜S 5™[Ô)¨E°#¸±+¸sÐ2BÔ,CÑCÐTÐTÑTØ5HÐ�t˜C”y 5¨¨c¨¤?Ñ2ÐHÐHÑHØ!Ð˜Ð!Ð!Ñ!Ø€M�3ÐÐÑØ5:Ð% t¨d¡{Ð:Ð:Ñ:Ø/3Ð ¨¡Ð3Ð3Ñ3Ø €N�DÐ Ð Ñ Ø&*Ð˜˜t™Ð*Ð*Ñ*Ø#&Ð˜5Ð&Ð&Ñ&Ø&)Ð Ð)Ð)Ñ)Ø/2Ð ¨¡Ð2Ð2Ñ2ØARÐ˜D œI¨¨c°3¨h¬Ñ7¸$Ñ>ÐRÐRÑ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      sÍ   ðð Ð à .Ð .Ð .Ð .Ð .Ð .à CÐ CÐ CÐ CÐ CÐ CØ 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0ð €Ð,Ð-Ñ-Ô-ØðA(ð A(ð A(ð A(ð A(Ð ñ A(ô A(ñ „ñ .Ô-ðA(ðH ˆ-€€€r_   