
    i-                        d Z 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)zBlip model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzSalesforce/blip-vqa-base)
checkpointc                   b   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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d<   dZedz  ed<   dZeee   z  d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d&<   dZeed'<   y)(BlipTextConfigaq  
    label_smoothing (float, *optional*):
        A float in [0.0, 1.0]. Specifies the amount of smoothing when computing the loss, where 0.0 means no smoothing. The targets
        become a mixture of the original ground truth and a uniform distribution as described in
        `Rethinking the Inception Architecture for Computer Vision <https://huggingface.co/papers/1512.00567>`__. Default: :math:`0.0`.

    Example:

    ```python
    >>> from transformers import BlipTextConfig, BlipTextModel

    >>> # Initializing a BlipTextConfig with Salesforce/blip-vqa-base style configuration
    >>> configuration = BlipTextConfig()

    >>> # Initializing a BlipTextModel (with random weights) from the Salesforce/blip-vqa-base style configuration
    >>> model = BlipTextModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```blip_text_modeltext_configi<w  
vocab_size   hidden_sizeencoder_hidden_size   intermediate_sizeprojection_dim   num_hidden_layers   num_attention_heads   max_position_embeddingsgelu
hidden_actg-q=layer_norm_eps        hidden_dropout_probattention_probs_dropout_prob{Gz?initializer_rangei:w  Nbos_token_id   eos_token_idr   pad_token_idf   sep_token_idT
is_decoder	use_cachelabel_smoothing) __name__
__module____qualname____doc__
model_typebase_config_keyr   int__annotations__r   r   r   r   r   r   r   r   strr   floatr   r   r!   r"   r$   listr%   r'   r(   boolr)   r*        |/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/blip/configuration_blip.pyr
   r
      s   * #J#OJK""!s!NCs  #&S&J!NE!'**03 %#+3#u#$L#*$+,L#S	/D(, L#* "L#*"JIt OU r8   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  ed<   dZeee   z  eee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<   y)BlipVisionConfiga  
    Example:

    ```python
    >>> from transformers import BlipVisionConfig, BlipVisionModel

    >>> # Initializing a BlipVisionConfig with Salesforce/blip-vqa-base style configuration
    >>> configuration = BlipVisionConfig()

    >>> # Initializing a BlipVisionModel (with random weights) from the Salesforce/blip-vqa-base style configuration
    >>> model = BlipVisionModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```blip_vision_modelvision_configr   r   r   r   r   r   r   r   r   i  
image_size   
patch_sizer   r   gh㈵>r   r   attention_dropoutg|=r!   N)r+   r,   r-   r.   r/   r0   r   r1   r2   r   r   r   r   r>   r5   tupler@   r   r3   r   r4   rA   r!   r7   r8   r9   r;   r;   J   s      %J%OK!s!NCs!!47Jd3i%S/1746Jd3i%S/16J NE %(us{($u$r8   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d<   dZeed<   dZeed<    fdZ xZS )
BlipConfiga'  
    image_text_hidden_size (`int`, *optional*, defaults to 256):
        Dimensionality of the hidden state of the image-text fusion layer.
    label_smoothing (float, *optional*):
        A float in [0.0, 1.0]. Specifies the amount of smoothing when computing the loss, where 0.0 means no smoothing. The targets
        become a mixture of the original ground truth and a uniform distribution as described in
        `Rethinking the Inception Architecture for Computer Vision <https://huggingface.co/papers/1512.00567>`__. Default: :math:`0.0`.

    Example:

    ```python
    >>> from transformers import BlipConfig, BlipModel

    >>> # Initializing a BlipConfig with Salesforce/blip-vqa-base style configuration
    >>> configuration = BlipConfig()

    >>> # Initializing a BlipPModel (with random weights) from the Salesforce/blip-vqa-base style configuration
    >>> model = BlipModel(configuration)

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

    >>> # We can also initialize a BlipConfig from a BlipTextConfig and a BlipVisionConfig

    >>> # Initializing a BLIPText and BLIPVision configuration
    >>> config_text = BlipTextConfig()
    >>> config_vision = BlipVisionConfig()

    >>> config = BlipConfig(text_config=config_text, vision_config=config_vision)
    ```blip)r   r=   Nr   r=   r   r   g/L
F@logit_scale_init_value   image_text_hidden_sizer   r*   Ttie_word_embeddingsg      ?initializer_factorr    r!   c                    | j                   %t               | _         t        j                  d       n4t	        | j                   t
              rt        di | j                   | _         | j                  %t               | _        t        j                  d       n4t	        | j                  t
              rt        di | j                  | _        | j                  j                  | j                   _	        t        | ,  di | y )NzO`text_config` is `None`. Initializing the `BlipTextConfig` with default values.zS`vision_config` is `None`. initializing the `BlipVisionConfig` with default values.r7   )r   r
   loggerinfo
isinstancedictr=   r;   r   r   super__post_init__)selfkwargs	__class__s     r9   rQ   zBlipConfig.__post_init__   s    #-/DKKij(($/-A0@0@AD%!1!3DKKmn**D1!1!GD4F4F!GD/3/A/A/M/M,''r8   )r+   r,   r-   r.   r/   r
   r;   sub_configsr   rO   r   r2   r=   r   r1   rF   r4   rH   r*   rI   r6   rJ   r!   rQ   __classcell__)rT   s   @r9   rD   rD   m   s    > J"0CSTK26K((4/648M4**T18NC$*E*"%C% OU  $$ ###u#( (r8   rD   )rD   r
   r;   N)r.   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr+   rL   r
   r;   rD   __all__r7   r8   r9   <module>r\      s     . 3 , 
		H	% 56,!% ,!  7,!^ 56%' %  7%B 56<(! <(  7<(~ ?r8   