Ë
    ÛÓ^j  ã                   ó°   — d dl mZ ddlmZ ddlmZ ddlmZmZ  ed¬«      e G d	„ d
e«      «       «       Z	 ed¬«      e G d„ de«      «       «       Z
d
dgZy)é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringé   )ÚCONFIG_MAPPINGÚ
AutoConfigzOpenGVLab/InternVL3-1B-hf)Ú
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ez  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e   z  eedf   z  ed<   dZeee   z  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'<   ˆ fd(„Z!ˆ xZ"S ))ÚInternVLVisionConfigae  
    projection_dropout (`float`, *optional*, defaults to 0.0):
        Dropout probability for the projection layer.
    norm_type (`str`, *optional*, defaults to `"layer_norm"`):
        The type of normalization to use in the encoder. Can be `"layer_norm"` or `"rms_norm"`.
    use_mask_token (`bool`, *optional*, defaults to `False`):
        Whether to use a mask token for masked image modeling
    use_mean_pooling (`bool`, *optional*, defaults to `True`):
        Whether to mean pool the final hidden states of the patches instead of using the final hidden state of the
        CLS token, before applying the classification head.

    Example:

    ```python
    >>> from transformers import InternVLVisionConfig, InternVLVisionModel

    >>> # Initializing a InternVLVisionModel OpenGVLab/InternVL3-1B-hf style configuration
    >>> configuration = InternVLVisionConfig()

    >>> # Initializing a model (with random weights) from the OpenGVLab/InternVL3-1B-hf configuration
    >>> model = InternVLVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úinternvl_visionÚvision_configi   Úhidden_sizeé   Únum_hidden_layersé   Únum_attention_headsFÚattention_biasÚuse_qk_normi   Úintermediate_sizeÚgeluÚ
hidden_actg        Úhidden_dropout_probÚattention_dropoutÚprojection_dropoutg{®Gáz”?Úinitializer_rangeÚ
layer_normÚ	norm_typeg�íµ ÷Æ°>Úlayer_norm_eps)éÀ  r    .Ú
image_size)é   r"   Ú
patch_sizer   Únum_channelsÚuse_mask_tokenTÚ use_absolute_position_embeddingsgš™™™™™¹?Úlayer_scale_init_valueÚuse_mean_poolingc                 óH  •— t        | j                  t        t        f«      r| j                  n| j                  | j                  f| _        t        | j                  t        t        f«      r| j                  n| j                  | j                  f| _        t        ‰| �  di |¤Ž y )N© )Ú
isinstancer!   ÚlistÚtupler#   ÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €ú~/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/internvl/configuration_internvl.pyr/   z"InternVLVisionConfig.__post_init__L   s   ø€ ä)¨$¯/©/¼DÄ%¸=ÔIˆD�OŠOÐPT×P_ÑP_Ðae×apÑapÐOqð 	Œô  *¨$¯/©/¼DÄ%¸=ÔIˆD�OŠOÐPT×P_ÑP_Ðae×apÑapÐOqð 	Œô 	‰ÑÑ' Ó'ó    )#Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyr   ÚintÚ__annotations__r   r   r   Úboolr   r   r   Ústrr   Úfloatr   r   r   r   r   r!   r,   r-   r#   r$   r%   r&   r'   r(   r/   Ú__classcell__©r3   s   @r4   r   r      s&  ø… ñð4 #€JØ%€Oà€K�ÓØÐ�sÓØ!Ð˜Ó!Ø €N�DÓ Ø€K�ÓØ!Ð�sÓ!Ø€J�ÓØ'*Ð˜ ™Ó*Ø%(Ð�u˜s‘{Ó(Ø&)Ð˜ ™Ó)Ø#Ð�uÓ#Ø!€IˆsÓ!Ø!€N�EÓ!Ø4>€J��d˜3‘i‘ %¨¨S¨¡/Ñ1Ó>Ø4<€J��d˜3‘i‘ %¨¨S¨¡/Ñ1Ó<Ø€L�#ÓØ €N�DÓ Ø-1Ð$ dÓ1Ø$'Ð˜EÓ'Ø!Ð�dÓ!÷(ð (r5   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<   dZeed<   dZeee   z  ed<   dZeed<   dZeed<   ˆ fd„Zˆ xZS )ÚInternVLConfiga>  
    downsample_ratio (`float`, *optional*, defaults to 0.5):
        Factor by which to downsample the image.

    Example:

    ```python
    >>> from transformers import InternVLForConditionalGeneration, InternVLConfig

    >>> # Initializing a InternVL style configuration
    >>> configuration = InternVLConfig()

    >>> # Initializing a model (with random weights) from the OpenGVLab/InternVL3-1B-hf configuration
    >>> model = InternVLForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úinternvl)Útext_configr   Nr   rF   isP Úimage_token_idé   Úimage_seq_lengthg      à?Údownsample_ratior   Úprojector_hidden_actéÿÿÿÿÚvision_feature_layerÚdefaultÚvision_feature_select_strategyTÚtie_word_embeddingsc                 óÜ  •— t        | j                  t        «      rt        di | j                  ¤Ž| _        n| j                  €t        «       | _        t        | j                  t        «      rT| j                  j                  dd«      | j                  d<   t        | j                  d      di | j                  ¤Ž| _        n| j                  €t        d   «       | _        t        ‰| �   di |¤Ž y )Nr:   Úqwen2r*   )	r+   r   Údictr   rF   Úgetr   r.   r/   r0   s     €r4   r/   zInternVLConfig.__post_init__y   sÇ   ø€ Ü�d×(Ñ(¬$Ô/Ü!5Ñ!K¸×8JÑ8JÑ!KˆDÕØ×ÑÐ'Ü!5Ó!7ˆDÔä�d×&Ñ&¬Ô-Ø-1×-=Ñ-=×-AÑ-AÀ,ÐPWÓ-XˆD×Ñ˜\Ñ*Ü-¨d×.>Ñ.>¸|Ñ.LÑMÑaÐPT×P`ÑP`ÑaˆDÕØ×ÑÐ%Ü-¨gÑ6Ó8ˆDÔä‰ÑÑ' Ó'r5   )r6   r7   r8   r9   r:   r	   r   Úsub_configsr   rS   r   r=   rF   rG   r<   rI   rJ   r@   rK   r?   rM   r,   rO   rP   r>   r/   rA   rB   s   @r4   rD   rD   V   s¢   ø… ñð& €JØ",Ð?SÑT€Kà48€M�4Ð*Ñ*¨TÑ1Ó8Ø26€K�Ð(Ñ(¨4Ñ/Ó6Ø €N�CÓ ØÐ�cÓØ!Ð�eÓ!Ø &Ð˜#Ó&Ø,.Ð˜#  S¡	™/Ó.Ø*3Ð" CÓ3Ø $Ð˜Ó$÷(ð (r5   rD   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   Úautor   r	   r   rD   Ú__all__r*   r5   r4   ú<module>r[      sv   ðõ  /å 3Ý #ß -ñ Ð6Ô7Øô:(Ð+ó :(ó ó 8ð:(ñz Ð6Ô7Øô-(Ð%ó -(ó ó 8ð-(ð` "Ð#3Ð
4�r5   