
    iI                     z    d Z 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
dgZy)zVipLlava model configuration    )strict   )PreTrainedConfig)auto_docstring   )CONFIG_MAPPING
AutoConfigzllava-hf/vip-llava-7b-hf)
checkpointc                        e Zd ZU dZdZddi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e   z  eedf   z  ed<   dZeed<   dZeed<    fdZ xZS )VipLlavaConfiga  
    projector_layernorm_eps (`float`, *optional*, defaults to 1e-05):
        The layer norm epsilon of the projector layernorm
    vision_feature_layers (`Union[int, list[int]]`, *optional*, defaults to `[-2, -5, -8, -11, 6]`):
        The vision feature layer, or list of layers to select the vision features from.

    Example:

    ```python
    >>> from transformers import VipLlavaForConditionalGeneration, VipLlavaConfig, CLIPVisionConfig, LlamaConfig

    >>> # Initializing a CLIP-vision config
    >>> vision_config = CLIPVisionConfig()

    >>> # Initializing a Llama config
    >>> text_config = LlamaConfig()

    >>> # Initializing a VipLlava vipllava-7b style configuration
    >>> configuration = VipLlavaConfig(vision_config, text_config)

    >>> # Initializing a model from the vipllava-7b style configuration
    >>> model = VipLlavaForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```vipllavaimage_token_idimage_token_index)text_configvision_configNr   r    }  geluprojector_hidden_actgh㈵>projector_layernorm_eps)ii   .vision_feature_layersi@  image_seq_lengthFtie_word_embeddingsc           
      f   t        | j                  t              rT| j                  j                  dd      | j                  d<   t	        | j                  d      di | j                  | _        n'| j                  t	        d   ddddddd	d
      | _        t        | j
                  t              rT| j
                  j                  dd      | j
                  d<   t	        | j
                  d      di | j
                  | _        n| j
                  t	        d          | _        t        |   di | y )N
model_typeclip_vision_modeli   i      iP        r   i   )intermediate_sizehidden_size
patch_size
image_sizenum_hidden_layersnum_attention_heads
vocab_sizeprojection_dimllama )
isinstancer   dictgetr   r   super__post_init__)selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/vipllava/configuration_vipllava.pyr0   zVipLlavaConfig.__post_init__C   s   d(($//3/A/A/E/ElTg/hD|,!/0B0B<0P!Q!gTXTfTf!gD'!/0C!D"& "$$& "	"D d&&--1-=-=-A-A,PW-XD\*-d.>.>|.LMaPTP`P`aD%-g68D''    )__name__
__module____qualname____doc__r   attribute_mapr	   sub_configsr   r-   r   __annotations__r   r   intr   strr   floatr   listtupler   r   boolr0   __classcell__)r3   s   @r4   r   r      s    6 J-M #-zJK48M4**T1826K((4/6"s" &#&%)U)?S3c?U38_<Sc %%( (r5   r   N)r9   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   autor   r	   r   __all__r+   r5   r4   <module>rI      sN    # . 3 # - 56A(% A(  7A(H 
r5   