Ë
    ÛÓ^j%/  ã                   ó   — 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)é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingzCIDAS/clipseg-rd64)Ú
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d<   dZe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dz  ed<   dZedz  ed<   dZeee   z  dz  ed <   d!„ Zy)"ÚCLIPSegTextConfigaà  
    Example:

    ```python
    >>> from transformers import CLIPSegTextConfig, CLIPSegTextModel

    >>> # Initializing a CLIPSegTextConfig with CIDAS/clipseg-rd64 style configuration
    >>> configuration = CLIPSegTextConfig()

    >>> # Initializing a CLIPSegTextModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
    >>> model = CLIPSegTextModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclipseg_text_modelÚtext_configi Á  Ú
vocab_sizeé   Úhidden_sizeé   Úintermediate_sizeé   Únum_hidden_layersé   Únum_attention_headséM   Úmax_position_embeddingsÚ
quick_geluÚ
hidden_actçñhãˆµøä>NÚlayer_norm_epsç        Úattention_dropoutç{®Gáz”?Úinitializer_rangeç      ð?Úinitializer_factoré   Úpad_token_idiþÀ  Úbos_token_idiÿÀ  Úeos_token_idc                 óˆ   — | j                   | j                  z  dk7  r&t        d| j                   › d| j                  › d�«      ‚y©zOPart of `@strict`-powered validation. Validates the architecture of the config.r   zThe hidden size (z6) is not a multiple of the number of attention heads (z).N©r   r   Ú
ValueError©Úselfs    ú|/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/clipseg/configuration_clipseg.pyÚvalidate_architecturez'CLIPSegTextConfig.validate_architectureE   óS   € à×Ñ˜d×6Ñ6Ñ6¸!Ò;ÜØ# D×$4Ñ$4Ð#5ð 6Ø×2Ñ2Ð3°2ð7óð ð <ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyr   ÚintÚ__annotations__r   r   r   r   r   r   Ústrr   Úfloatr   r   r!   r#   r$   r%   Úlistr-   © r/   r,   r
   r
      sÓ   … ñð  &€JØ#€Oà€J�ÓØ€K�ÓØ!Ð�sÓ!ØÐ�sÓØ Ð˜Ó Ø#%Ð˜SÓ%Ø"€J�Ó"Ø#'€N�E˜D‘LÓ'Ø,/Ð�s˜U‘{ TÑ)Ó/Ø#Ð�uÓ#Ø'*Ð˜ ™Ó*ð  !€L�#˜‘*Ó Ø$€L�#˜‘*Ó$Ø+0€L�#˜˜S™	‘/ DÑ(Ó0ór/   r
   c                   ó  — 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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ed<   dZeed<   dZeez  dz  ed<   dZeed<   dZeed<   d„ Zy)ÚCLIPSegVisionConfigaì  
    Example:

    ```python
    >>> from transformers import CLIPSegVisionConfig, CLIPSegVisionModel

    >>> # Initializing a CLIPSegVisionConfig with CIDAS/clipseg-rd64 style configuration
    >>> configuration = CLIPSegVisionConfig()

    >>> # Initializing a CLIPSegVisionModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
    >>> model = CLIPSegVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclipseg_vision_modelÚvision_configi   r   i   r   r   r   r   r   Únum_channelséà   NÚ
image_sizeé    Ú
patch_sizer   r   r   r   r   r   r   r   r    r!   c                 óˆ   — | j                   | j                  z  dk7  r&t        d| j                   › d| j                  › d�«      ‚yr'   r(   r*   s    r,   r-   z)CLIPSegVisionConfig.validate_architectureq   r.   r/   )r0   r1   r2   r3   r4   r5   r   r6   r7   r   r   r   r@   rB   r:   ÚtuplerD   r   r8   r   r9   r   r   r!   r-   r;   r/   r,   r=   r=   N   sÓ   … ñð  (€JØ%€Oà€K�ÓØ!Ð�sÓ!ØÐ�sÓØ!Ð˜Ó!Ø€L�#ÓØ;>€J��d˜3‘i‘ %¨¨S¨¡/Ñ1°DÑ8Ó>Ø;=€J��d˜3‘i‘ %¨¨S¨¡/Ñ1°DÑ8Ó=Ø"€J�Ó"Ø €N�EÓ Ø,/Ð�s˜U‘{ TÑ)Ó/Ø#Ð�uÓ#Ø #Ð˜Ó#ór/   r=   c                   ó4  ‡ — 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dz  e
d<   d	Zeez  dz  e
d
<   dZed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z  e
d<   dZee
d<   dZee
d<   dZee
d<   dZee
d<   ˆ fd„Zˆ xZS )ÚCLIPSegConfiga  
    extract_layers (`list[int]`, *optional*, defaults to `[3, 6, 9]`):
        Layers to extract when forwarding the query image through the frozen visual backbone of CLIP.
    reduce_dim (`int`, *optional*, defaults to 64):
        Dimensionality to reduce the CLIP vision embedding.
    conditional_layer (`int`, *optional*, defaults to 0):
        The layer to use of the Transformer encoder whose activations will be combined with the condition
        embeddings using FiLM (Feature-wise Linear Modulation). If 0, the last layer is used.
    use_complex_transposed_convolution (`bool`, *optional*, defaults to `False`):
        Whether to use a more complex transposed convolution in the decoder, enabling more fine-grained
        segmentation..

    Example:

    ```python
    >>> from transformers import CLIPSegConfig, CLIPSegModel

    >>> # Initializing a CLIPSegConfig with CIDAS/clipseg-rd64 style configuration
    >>> configuration = CLIPSegConfig()

    >>> # Initializing a CLIPSegModel (with random weights) from the CIDAS/clipseg-rd64 style configuration
    >>> model = CLIPSegModel(configuration)

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

    >>> # We can also initialize a CLIPSegConfig from a CLIPSegTextConfig and a CLIPSegVisionConfig

    >>> # Initializing a CLIPSegText and CLIPSegVision configuration
    >>> config_text = CLIPSegTextConfig()
    >>> config_vision = CLIPSegVisionConfig()

    >>> config = CLIPSegConfig(text_config=config_text, vision_config=config_vision)
    ```Úclipseg)r   r?   Nr   r?   r   Úprojection_dimgƒ/L¦
F@Úlogit_scale_init_valuer    r!   )r   é   é	   .Úextract_layersé@   Ú
reduce_dimé   Údecoder_num_attention_headsr   Údecoder_attention_dropoutr   Údecoder_hidden_actr   Údecoder_intermediate_sizer   Úconditional_layerFÚ"use_complex_transposed_convolutionc                 ó¾  •— | j                   €i }t        j                  d«       nAt        | j                   t        «      r| j                   j                  «       }n| j                   }| j                  €i }t        j                  d«       nAt        | j                  t        «      r| j                  j                  «       }n| j                  }|j                  dd «      }|j                  dd «      }|�t	        di |¤Žj                  «       }|j                  «       D ]B  \  }}||v sŒ|||   k7  sŒ|dk7  sŒ||v r
d|› d|› d�}	nd	|› d
�}	t        j                  |	«       ŒD |j                  |«       |�¶t        di |¤Žj                  «       }
d|
v r3|
d   j                  «       D ��ci c]  \  }}t        |«      |“Œ c}}|
d<   |
j                  «       D ]B  \  }}||v sŒ|||   k7  sŒ|dk7  sŒ||v r
d|› d|› d�}	nd|› d
�}	t        j                  |	«       ŒD |j                  |
«       t	        di |¤Ž| _         t        di |¤Ž| _        t        ‰| �4  di |¤Ž y c c}}w )NzR`text_config` is `None`. Initializing the `CLIPSegTextConfig` with default values.zV`vision_config` is `None`. initializing the `CLIPSegVisionConfig` with default values.Útext_config_dictÚvision_config_dictÚtransformers_versionú`zp` is found in both `text_config_dict` and `text_config` but with different values. The value `text_config_dict["z"]` will be used instead.zj`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["z"]` will be overridden.Úid2labelzv` is found in both `vision_config_dict` and `vision_config` but with different values. The value `vision_config_dict["zp`vision_config_dict` is provided which will be used to initialize `CLIPVisionConfig`. The value `vision_config["r;   )r   ÚloggerÚinfoÚ
isinstancer
   Úto_dictr?   r=   ÚpopÚitemsÚupdater8   ÚsuperÚ__post_init__)r+   Úkwargsr   r?   rY   rZ   Ú_text_config_dictÚkeyÚvalueÚmessageÚ_vision_config_dictÚ	__class__s              €r,   rf   zCLIPSegConfig.__post_init__²   s©  ø€ Ø×ÑÐ#ØˆKÜ�K‰KÐlÕmÜ˜×(Ñ(Ô*;Ô<Ø×*Ñ*×2Ñ2Ó4‰Kà×*Ñ*ˆKà×ÑÐ%ØˆMÜ�K‰KÐpÕqÜ˜×*Ñ*Ô,?Ô@Ø ×.Ñ.×6Ñ6Ó8‰Mà ×.Ñ.ˆMð "Ÿ:™:Ð&8¸$Ó?ÐØ#ŸZ™ZÐ(<¸dÓCÐàÐ'ä 1Ñ EÐ4DÑ E× MÑ MÓ OÐð 0×5Ñ5Ó7ò )‘
��UØ˜+Ò%¨%°;¸sÑ3CÓ*CÈÐOeÓHeàÐ.Ñ.à ˜uð %<Ø<?¸5Ð@Yð[ñ  ð3Ø36°%Ð7NðPð  ô —K‘K Õ(ð)ð" ×ÑÐ0Ô1àÐ)ä"5Ñ"KÐ8JÑ"K×"SÑ"SÓ"UÐàÐ0Ñ0à6IÈ*Ñ6U×6[Ñ6[Ó6]÷3Ù(2¨¨U”C˜“H˜e‘Oó3Ð# JÑ/ð
 2×7Ñ7Ó9ò )‘
��UØ˜-Ò'¨E°]À3Ñ5GÓ,GÈCÐSiÓLiàÐ0Ñ0à ˜uð %FØFIÀUÐJcðeñ  ð9Ø9<¸Ð=TðVð  ô —K‘K Õ(ð)ð" × Ñ Ð!4Ô5ô -Ñ;¨{Ñ;ˆÔÜ0ÑA°=ÑAˆÔä‰ÑÑ' Ó'ùó93s   Æ&I)r0   r1   r2   r3   r4   r
   r=   Úsub_configsr   Údictr7   r?   rJ   r6   rK   r9   r!   rN   r:   rF   rP   rR   rS   rT   r8   rU   rV   rW   Úboolrf   Ú__classcell__)rm   s   @r,   rH   rH   z   sí   ø… ñ!ðF €JØ"3ÐFYÑZ€Kà37€K�Ð)Ñ)¨DÑ0Ó7Ø7;€M�4Ð-Ñ-°Ñ4Ó;Ø!$€N�C˜$‘JÓ$Ø17Ð˜E C™K¨$Ñ.Ó7Ø'*Ð˜ ™Ó*à2;€N�D˜‘I  c¨3 h¡Ñ/Ó;Ø€J�ÓØ'(Ð Ó(Ø-0Ð˜u s™{Ó0Ø*Ð˜Ó*Ø%)Ð˜sÓ)ØÐ�sÓØ/4Ð&¨Ó4÷Q(ð Q(r/   rH   )rH   r
   r=   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Ú
get_loggerr0   r^   r
   r=   rH   Ú__all__r;   r/   r,   ú<module>rw      s°   ðõ( /å 3ß ,ð 
ˆ×	Ñ	˜HÓ	%€ñ Ð/Ô0Øô,Ð(ó ,ó ó 1ð,ñ^ Ð/Ô0Øô'Ð*ó 'ó ó 1ð'ñT Ð/Ô0ØôG(Ð$ó G(ó ó 1ðG(òT H�r/   