§
    ‚Štj  ã                   óâ   — 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dS )é    )Ú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                 ó&  •— t          | j        t          t          f¦  «        r| j        n| j        | j        f| _        t          | j        t          t          f¦  «        r| j        n| j        | j        f| _         t          ¦   «         j        di |¤Ž d S )N© )Ú
isinstancer!   ÚlistÚtupler#   ÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úq/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/internvl/configuration_internvl.pyr/   z"InternVLVisionConfig.__post_init__L   sŽ   ø€ å)¨$¬/½DÅ%¸=ÑIÔIÐqˆDŒOˆOÐPTÔP_ÐaeÔapÐOqð 	Œõ  *¨$¬/½DÅ%¸=ÑIÔIÐqˆDŒOˆOÐPTÔP_ÐaeÔ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Ð1Ñ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          ¦  «        rK| j                             dd¦  «        | j        d<   t          | j        d                  di | j        ¤Ž| _        n | j        €t          d         ¦   «         | _         t          ¦   «         j        di |¤Ž d S )Nr:   Úqwen2r*   )	r+   r   Údictr   rF   Úgetr   r.   r/   r0   s     €r4   r/   zInternVLConfig.__post_init__y   sê   ø€ Ý�dÔ(­$Ñ/Ô/ð 	8Ý!5Ð!KÐ!K¸Ô8JÐ!KÐ!KˆDÔÐØÔÐ'Ý!5Ñ!7Ô!7ˆDÔå�dÔ&­Ñ-Ô-ð 	9Ø-1Ô-=×-AÒ-AÀ,ÐPWÑ-XÔ-XˆDÔ˜\Ñ*Ý-¨dÔ.>¸|Ô.LÔMÐaÐaÐPTÔP`ÐaÐaˆDÔÐØÔÐ%Ý-¨gÔ6Ñ8Ô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ÐT€Kà48€M�4Ð*Ñ*¨TÑ1Ð8Ð8Ñ8Ø26€K�Ð(Ñ(¨4Ñ/Ð6Ð6Ñ6Ø €N�CÐ Ð Ñ ØÐ�cÐÐÑØ!Ð�eÐ!Ð!Ñ!Ø &Ð˜#Ð&Ð&Ñ&Ø,.Ð˜#  S¤	™/Ð.Ð.Ñ.Ø*3Ð" CÐ3Ð3Ñ3Ø $Ð˜Ð$Ð$Ñ$ð(ð (ð (ð (ð (ð (ð (ð (ð (r5   rD   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   Úautor   r	   r   rD   Ú__all__r*   r5   r4   ú<module>r[      s  ðð  /Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð €Ð6Ð7Ñ7Ô7Øð:(ð :(ð :(ð :(ð :(Ð+ñ :(ô :(ñ „ñ 8Ô7ð:(ðz €Ð6Ð7Ñ7Ô7Øð-(ð -(ð -(ð -(ð -(Ð%ñ -(ô -(ñ „ñ 8Ô7ð-(ð` "Ð#3Ð
4€€€r5   