Ë
    T^(hÝY  ã                   ó0  — d dl mZ d dlmZmZmZ d dlZd dlZd dlm	Z	 d dl
mZmZ d dlmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZmZ  ej2                  e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Ze G d„ de«      «       Z G d„ de«      Z y)é    )Ú	dataclass)ÚOptionalÚTupleÚUnionN)ÚCrossEntropyLoss)ÚInstructBlipQFormerConfigÚInstructBlipVisionConfig)Ú$InstructBlipForConditionalGenerationÚ/InstructBlipForConditionalGenerationModelOutputé   )ÚPretrainedConfig)Ú!MODEL_FOR_CAUSAL_LM_MAPPING_NAMES)Úloggingé   )ÚCONFIG_MAPPINGÚ
AutoConfigc                   ó   — e Zd Zy)ÚInstructBlipVideoVisionConfigN©Ú__name__Ú
__module__Ú__qualname__© ó    ú}/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/instructblipvideo/modular_instructblipvideo.pyr   r   )   ó   „ Ør   r   c                   ó   — e Zd Zy)ÚInstructBlipVideoQFormerConfigNr   r   r   r   r   r   -   r   r   r   c                   ó\   ‡ — e Zd ZdZdZeeedœZ	 	 	 	 	 d	ˆ fd„	Z	e
dededefd„«       Zˆ xZS )
ÚInstructBlipVideoConfiga®
  
    [`InstructBlipVideoConfig`] is the configuration class to store the configuration of a
    [`InstructBlipVideoForConditionalGeneration`]. It is used to instantiate a Instructblipvideo model according to the specified
    arguments, defining the vision model, Q-Former model and language model configs. Instantiating a configuration with
    the defaults will yield a similar configuration to that of the Instructblipvideo
    [Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Args:
        vision_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize [`InstructBlipVideoVisionConfig`].
        qformer_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize [`InstructBlipVideoQFormerConfig`].
        text_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize any [`PretrainedConfig`].
        num_query_tokens (`int`, *optional*, defaults to 32):
            The number of query tokens passed through the Transformer.

        video_token_index (`int`, *optional*):
            Token index of special video token.
        kwargs (*optional*):
            Dictionary of keyword arguments.

    Example:

    ```python
    >>> from transformers import (
    ...     InstructBlipVideoVisionConfig,
    ...     InstructBlipVideoQFormerConfig,
    ...     OPTConfig,
    ...     InstructBlipVideoConfig,
    ...     InstructBlipVideoForConditionalGeneration,
    ... )

    >>> # Initializing a InstructBlipVideoConfig with Salesforce/instruct-blip-flan-t5 style configuration
    >>> configuration = InstructBlipVideoConfig()

    >>> # Initializing a InstructBlipVideoForConditionalGeneration (with random weights) from the Salesforce/instruct-blip-flan-t5 style configuration
    >>> model = InstructBlipVideoForConditionalGeneration(configuration)

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

    >>> # We can also initialize a InstructBlipVideoConfig from a InstructBlipVideoVisionConfig, InstructBlipVideoQFormerConfig and any PretrainedConfig

    >>> # Initializing Instructblipvideo vision, Instructblipvideo Q-Former and language model configurations
    >>> vision_config = InstructBlipVideoVisionConfig()
    >>> qformer_config = InstructBlipVideoQFormerConfig()
    >>> text_config = OPTConfig()

    >>> config = InstructBlipVideoConfig.from_text_vision_configs(vision_config, qformer_config, text_config)
    ```Úinstructblipvideo)Útext_configÚqformer_configÚvision_configc                 óú  •— t        ‰| �  di |¤Ž |€i }t        j                  d«       |€i }t        j                  d«       |€i }t        j                  d«       t	        di |¤Ž| _        t        di |¤Ž| _        d|v r|d   nd}t        |   di |¤Ž| _	        || _
        || _        | j
                  j                  | j                  _        | j                  j                  t        v | _        d| _        d| _        y )	NzZvision_config is None. initializing the InstructBlipVideoVisionConfig with default values.z\qformer_config is None. Initializing the InstructBlipVideoQFormerConfig with default values.zTtext_config is None. Initializing the text config with default values (`OPTConfig`).Ú
model_typeÚoptg      ð?g{®Gáz”?r   )ÚsuperÚ__init__ÚloggerÚinfor   r$   r   r#   r   r"   Únum_query_tokensÚvideo_token_indexÚhidden_sizeÚencoder_hidden_sizer&   r   Úuse_decoder_only_language_modelÚinitializer_factorÚinitializer_range)	Úselfr$   r#   r"   r,   r-   ÚkwargsÚtext_model_typeÚ	__class__s	           €r   r)   z InstructBlipVideoConfig.__init__p   sú   ø€ ô 	‰ÑÑ"˜6Ò"àÐ ØˆMÜ�K‰KÐtÔuàÐ!ØˆNÜ�K‰KÐvÔwàÐØˆKÜ�K‰KÐnÔoä:ÑK¸]ÑKˆÔÜ<ÑN¸~ÑNˆÔØ7CÀ{Ñ7R˜+ lÒ3ÐX]ˆÜ)¨/Ñ:ÑI¸[ÑIˆÔà 0ˆÔØ!2ˆÔØ26×2DÑ2D×2PÑ2Pˆ×ÑÔ/Ø/3×/?Ñ/?×/JÑ/JÔNoÐ/oˆÔ,Ø"%ˆÔØ!%ˆÕr   r$   r#   r"   c                 ón   —  | d|j                  «       |j                  «       |j                  «       dœ|¤ŽS )a  
        Instantiate a [`InstructBlipVideoConfig`] (or a derived class) from a InstructBlipVideo vision model, Q-Former and
        language model configurations.

        Returns:
            [`InstructBlipVideoConfig`]: An instance of a configuration object
        )r$   r#   r"   r   )Úto_dict)Úclsr$   r#   r"   r4   s        r   Ú from_vision_qformer_text_configsz8InstructBlipVideoConfig.from_vision_qformer_text_configs“   sD   € ñ  ð 
Ø'×/Ñ/Ó1Ø)×1Ñ1Ó3Ø#×+Ñ+Ó-ñ
ð ñ	
ð 	
r   )NNNé    N)r   r   r   Ú__doc__r&   r   r   r   Úsub_configsr)   Úclassmethodr   r:   Ú__classcell__)r6   s   @r   r    r    1   sg   ø„ ñ5ðn %€Jà!Ø8Ø6ñ€Kð ØØØØõ!&ðF ð
à4ð
ð 7ð
ð &ò	
ó ô
r   r    c                   ó   — e Zd Zy)Ú4InstructBlipVideoForConditionalGenerationModelOutputNr   r   r   r   rA   rA   «   s   „ àr   rA   c                   ó2  — e Zd Z	 	 	 	 	 	 	 	 	 	 	 ddej                  dej                  deej                     deej                     deej                     deej                     deej                     d	ee   d
ee   deej                     dee   dedee   dee	e
f   fd„Z ej                  «       	 	 	 	 	 ddej                  deej                     deej                     deej                     deej                     dedej                  fd„«       Zy)Ú)InstructBlipVideoForConditionalGenerationNÚpixel_valuesÚqformer_input_idsÚqformer_attention_maskÚ	input_idsÚattention_maskÚdecoder_input_idsÚdecoder_attention_maskÚoutput_attentionsÚoutput_hidden_statesÚlabelsÚreturn_dictÚinterpolate_pos_encodingÚ	use_cacheÚreturnc                 ó~	  — |�|n| j                   j                  }|j                  \  }}}}}|j                  ||z  |||«      }| j	                  |||	||¬«      }|d   }t        j                  |j                  «       dd t
        j                  |j                  ¬«      }| j                  j                  |j                  d   dd«      }t        j                  |j                  «       dd t
        j                  |j                  ¬«      }|€t        j                  |«      }|j                  |d¬«      }|j                  |d¬«      }t        j                  ||gd¬«      }| j                  |||||||	|¬«      }|d   dd…d|j                  d«      …dd…f   }| j!                  |«      }|j                  || j                   j"                  |z  d«      }t        j                  |j                  «       dd t
        j                  |j                  ¬«      } | j$                  j'                  «       |«      }|€t        j                  |«      }t)        | j                   d	d«      �d|| j                   j*                  k(  j-                  d«      j/                  |«      }|j1                  «       j3                  |j                  «      ||<   nyt4        j7                  d
«       t        j                  ||j3                  |j                  «      gd¬«      }t        j                  ||j3                  |j                  «      gd¬«      }| j                   j8                  �r| j%                  ||||	||¬«      }|r|j:                  n|d   }d} |
��|
j3                  |j                  «      }
|dd…|
j                  d«       d…dd…f   }|ddd…dd…f   j=                  «       }!|
ddd…f   j=                  «       j3                  |j                  «      }"t?        d¬«      }# |#|!jA                  d| j                   jB                  jD                  «      |"jA                  d«      «      } n@| j%                  ||||||	||
|¬«	      }|r|jF                  n|d   } |r|j:                  n|d   }|s||||f}$| �| f|$z   S |$S tI        | ||||¬«      S )a0
  
        ```python
        >>> from transformers import InstructBlipVideoProcessor, InstructBlipVideoForConditionalGeneration
        >>> import torch
        >>> from huggingface_hub import hf_hub_download
        >>> import av
        >>> import numpy as np

        >>> def read_video_pyav(container, indices):
        ...     '''
        ...     Decode the video with PyAV decoder.
        ...     Args:
        ...         container (`av.container.input.InputContainer`): PyAV container.
        ...         indices (`List[int]`): List of frame indices to decode.
        ...     Returns:
        ...         result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
        ...     '''
        ...     frames = []
        ...     container.seek(0)
        ...     start_index = indices[0]
        ...     end_index = indices[-1]
        ...     for i, frame in enumerate(container.decode(video=0)):
        ...         if i > end_index:
        ...             break
        ...         if i >= start_index and i in indices:
        ...             frames.append(frame)
        ...     return np.stack([x.to_ndarray(format="rgb24") for x in frames])

        >>> model = InstructBlipVideoForConditionalGeneration.from_pretrained("Salesforce/instructblip-vicuna-7b", device_map="auto")
        >>> processor = InstructBlipVideoProcessor.from_pretrained("Salesforce/instructblip-vicuna-7b")

        >>> file_path = hf_hub_download(
        ...       repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
        ... )
        >>> container = av.open(file_path)

        >>> # sample uniformly 4 frames from the videWhy is this video funny?o
        >>> total_frames = container.streams.video[0].frames
        >>> indices = np.arange(0, total_frames, total_frames / 4).astype(int)
        >>> clip = read_video_pyav(container, indices)

        >>> prompt = "What is happening in the video?"
        >>> inputs = processor(text=prompt, images=clip, return_tensors="pt").to(model.device)

        >>> outputs = model.generate(
        ...     **inputs,
        ...     do_sample=False,
        ...     num_beams=5,
        ...     max_length=256,
        ...     repetition_penalty=1.5,
        ...     length_penalty=1.0,
        ... )
        >>> generated_text = processor.batch_decode(outputs, skip_special_tokens=True)[0].strip()
        >>> print(generated_text)
        "A person is eating a bowl of pasta, and they are using a fork to eat it. The person is sitting at a table, and the plate of pasta is on the table in front"
        ```N)rD   rK   rL   rN   rO   r   éÿÿÿÿ©ÚdtypeÚdevice©Údimé   )rG   rH   Úquery_embedsÚencoder_hidden_statesÚencoder_attention_maskrK   rL   rN   r-   áK  Expanding inputs for video tokens in InstructBLIPVideo should be done in processing. Please follow instruction here (https://gist.github.com/zucchini-nlp/65f22892b054dc0d68228af56fbeaac2) to update your InstructBLIPVideo model. Using processors without these attributes in the config is deprecated and will throw an error in v4.47.)Úinputs_embedsrH   rK   rL   rN   rP   .Úmean)Ú	reduction)	r^   rH   rI   rJ   rK   rL   rN   rM   rP   )ÚlossÚlogitsÚvision_outputsÚqformer_outputsÚlanguage_model_outputs)%ÚconfigÚuse_return_dictÚshapeÚreshapeÚvision_modelÚtorchÚonesÚsizeÚlongrV   Úquery_tokensÚexpandÚ	ones_likeÚrepeat_interleaveÚcatÚqformerÚlanguage_projectionr,   Úlanguage_modelÚget_input_embeddingsÚgetattrr-   Ú	unsqueezeÚ	expand_asÚflattenÚtor*   Úwarning_oncer0   rb   Ú
contiguousr   Úviewr"   Ú
vocab_sizera   rA   )%r3   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   Ú
batch_sizeÚframesÚchannelÚheightÚwidthrc   Úimage_embedsÚimage_attention_maskro   Úquery_attention_maskÚquery_outputsÚquery_outputÚlanguage_model_inputsÚlanguage_model_attention_maskr^   Úspecial_image_maskÚoutputsrb   ra   Úshift_logitsÚshift_labelsÚloss_fctÚoutputs%                                        r   Úforwardz1InstructBlipVideoForConditionalGeneration.forward±   sÈ  € ðP &1Ð%<‘kÀ$Ç+Á+×B]ÑB]ˆð 6B×5GÑ5GÑ2ˆ
�F˜G V¨UØ#×+Ñ+¨J¸Ñ,?ÀÈ&ÐRWÓXˆà×*Ñ*Ø%Ø/Ø!5Ø#Ø%=ð +ó 
ˆð & aÑ(ˆô  %Ÿz™z¨,×*;Ñ*;Ó*=¸c¸rÐ*BÌ%Ï*É*Ð]i×]pÑ]pÔqÐð ×(Ñ(×/Ñ/°×0BÑ0BÀ1Ñ0EÀrÈ2ÓNˆÜ$Ÿz™z¨,×*;Ñ*;Ó*=¸c¸rÐ*BÌ%Ï*É*Ð]i×]pÑ]pÔqÐà!Ð)Ü%*§_¡_Ð5FÓ%GÐ"à-×?Ñ?ÀÈAÐ?ÓNÐØ!7×!IÑ!IÈ&ÐVWÐ!IÓ!XÐÜ!&§¡Ð,@ÐBXÐ+YÐ_`Ô!aÐØŸ™Ø'Ø1Ø%Ø".Ø#7Ø/Ø!5Ø#ð %ó 	
ˆð % QÑ'ªÐ+A¨\×->Ñ->¸qÓ-AÐ+AÂ1Ð(DÑEˆð !%× 8Ñ 8¸Ó FÐð !6× =Ñ =¸jÈ$Ï+É+×JfÑJfÐioÑJoÐqsÓ tÐÜ(-¯
©
Ø!×&Ñ&Ó(¨¨"Ð-´U·Z±ZÐH]×HdÑHdô)
Ð%ð C˜×+Ñ+×@Ñ@ÓBÀ9ÓMˆØÐ!Ü"Ÿ_™_¨YÓ7ˆNô �4—;‘;Ð 3°TÓ:ÐFØ"+¨t¯{©{×/LÑ/LÑ"L×!WÑ!WÐXZÓ![×!eÑ!eÐfsÓ!tÐØ0E×0MÑ0MÓ0O×0RÑ0RÐS`×SgÑSgÓ0hˆMÐ,Ò-ä×Ñðzôô
 "ŸI™IÐ'<¸m×>NÑ>NÐOd×OkÑOkÓ>lÐ&mÐstÔuˆMÜ"ŸY™YØ.°×0AÑ0AÐB_×BfÑBfÓ0gÐhÐnoôˆNð �;‰;×6Ó6Ø×)Ñ)Ø+Ø-Ø"3Ø%9Ø'Ø#ð *ó ˆGñ (3�W—^’^¸À¹
ˆFØˆDàÑ!ØŸ™ 6§=¡=Ó1�Ø¢ F§K¡K°£N ?Ñ#4²aÐ 7Ñ8�à% c¨3¨B¨3² kÑ2×=Ñ=Ó?�Ø% c¨1©2 g™×9Ñ9Ó;×>Ñ>¸v¿}¹}ÓM�ô ,°fÔ=�á × 1Ñ 1°"°d·k±k×6MÑ6M×6XÑ6XÓ YÐ[g×[lÑ[lÐmoÓ[pÓq‘à×)Ñ)Ø+Ø-Ø"3Ø'=Ø"3Ø%9Ø'ØØ#ð *ó 
ˆGñ $/�7—<’<°G¸A±JˆDÙ'2�W—^’^¸À¹
ˆFáØ˜n¨m¸WÐEˆFØ)-Ð)9�T�G˜fÑ$ÐE¸vÐEäCØØØ)Ø)Ø#*ô
ð 	
r   c                 óR	  — t        | d«      r| j                  «        |j                  \  }}	}
}}|j                  ||	z  |
||«      }| j	                  |d|¬«      j
                  }t        j                  |j                  «       dd t        j                  |j                  ¬«      }| j                  j                  |j                  d   dd«      }t        j                  |j                  «       dd t        j                  |j                  ¬«      }|€t        j                  |«      }|j                  |	d¬«      }|j                  |	d¬«      }t        j                  ||gd	¬«      }| j!                  |||||d¬
«      }|j
                  dd…d|j                  d	«      …dd…f   }| j#                  |«      }|j                  || j$                  j&                  |	z  d«      }t        j                  |j                  «       dd t        j                  |j                  ¬«      }|€¯| j$                  j(                  j*                  g}t-        | j$                  dd«      �4| j$                  j.                  g| j$                  j&                  z  dz  |z   }t        j0                  |gt        j                  |j                  ¬«      }|j3                  |d	«      }|€t        j                  |«      } | j5                  «       |«      }t-        | j$                  dd«      �d|| j$                  j.                  k(  j7                  d«      j9                  |«      }|j;                  «       j=                  |j                  «      ||<   næt>        jA                  d«       t        j                  ||j=                  |j                  «      gd	¬«      }t        j                  ||j=                  |j                  «      gd	¬«      }| jB                  j$                  jD                  sM|jG                  dd«      |j                  d	   z   d	z
  |d<   |jG                  dd«      |j                  d	   z   |d<   ||dœ}| jB                  j$                  jD                  s||d<    | jB                  jH                  di |¤|¤Ž}|S )a  
        Overrides `generate` function to be able to use the model as a conditional generator.

        Args:
            pixel_values (`torch.FloatTensor` of shape (batch_size, num_channels, height, width) or
                (batch_size, num_frames, num_channels, height, width)): Input images or videos to be processed.
            qformer_input_ids (`torch.LongTensor` of shape (batch_size, sequence_length), *optional*):
                The sequence used as a prompt to be fed to the Q-Former module.
            qformer_attention_mask (`torch.LongTensor` of shape (batch_size, sequence_length), *optional*):
                Mask to avoid performing attention on padding token indices.
            input_ids (`torch.LongTensor` of shape (batch_size, sequence_length), *optional*):
                The sequence used as a prompt for the generation.
            attention_mask (`torch.LongTensor` of shape (batch_size, sequence_length), *optional*):
                Mask to avoid performing attention on padding token indices.
            interpolate_pos_encoding (`bool`, *optional*, defaults to `False`):
                Whether to interpolate the positional encoding of the image embeddings.

        Returns:
            captions (list): A list of strings of length batch_size * num_captions.
        Úhf_device_mapT)rN   rO   NrS   rT   r   rW   rY   )rG   rH   rZ   r[   r\   rN   r-   é   r]   Ú
max_lengthé   Ú
min_length)r^   rH   rG   r   )%ÚhasattrÚ_preprocess_acceleraterh   ri   rj   Úlast_hidden_staterk   rl   rm   rn   rV   ro   rp   rq   rr   rs   rt   ru   rf   r,   r"   Úbos_token_idrx   r-   ÚtensorÚrepeatrw   ry   rz   r{   r|   r*   r}   rv   Úis_encoder_decoderÚgetÚgenerate)r3   rD   rE   rF   rG   rH   rO   Úgenerate_kwargsr�   r‚   rƒ   r„   r…   r†   r‡   ro   rˆ   r‰   rŠ   r‹   Úlanguage_attention_maskÚstart_tokensr^   r�   ÚinputsrŽ   s                             r   r¢   z2InstructBlipVideoForConditionalGeneration.generateq  sb  € ô> �4˜Ô)à×'Ñ'Ô)ð 6B×5GÑ5GÑ2ˆ
�F˜G V¨UØ#×+Ñ+¨J¸Ñ,?ÀÈ&ÐRWÓXˆà×(Ñ(ØØØ%=ð )ó 
÷ Ñ
ð	 	ô
  %Ÿz™z¨,×*;Ñ*;Ó*=¸c¸rÐ*BÌ%Ï*É*Ð]i×]pÑ]pÔqÐà×(Ñ(×/Ñ/°×0BÑ0BÀ1Ñ0EÀrÈ2ÓNˆÜ$Ÿz™z¨,×*;Ñ*;Ó*=¸c¸rÐ*BÌ%Ï*É*Ð]i×]pÑ]pÔqÐØ!Ð)Ü%*§_¡_Ð5FÓ%GÐ"à-×?Ñ?ÀÈAÐ?ÓNÐØ!7×!IÑ!IÈ&ÐVWÐ!IÓ!XÐÜ!&§¡Ð,@ÐBXÐ+YÐ_`Ô!aÐØŸ™Ø'Ø1Ø%Ø".Ø#7Øð %ó 
ˆð %×6Ñ6²qÐ:P¸L×<MÑ<MÈaÓ<PÐ:PÒRSÐ7SÑTˆà $× 8Ñ 8¸Ó FÐð !6× =Ñ =¸jÈ$Ï+É+×JfÑJfÐioÑJoÐqsÓ tÐÜ"'§*¡*Ø!×&Ñ&Ó(¨¨"Ð-´U·Z±ZÐH]×HdÑHdô#
Ðð ÐØ ŸK™K×3Ñ3×@Ñ@ÐAˆLÜ�t—{‘{Ð$7¸Ó>ÐJØ $§¡× =Ñ =Ð>ÀÇÁ×A]ÑA]Ñ]Ð`aÑaÐdpÑp�ÜŸ™ l ^¼5¿:¹:Èl×NaÑNaÔbˆIØ!×(Ñ(¨°QÓ7ˆIàÐ!Ü"Ÿ_™_¨YÓ7ˆNà3˜×1Ñ1Ó3°IÓ>ˆô �4—;‘;Ð 3°TÓ:ÐFØ"+¨t¯{©{×/LÑ/LÑ"L×!WÑ!WÐXZÓ![×!eÑ!eÐfsÓ!tÐØ0E×0MÑ0MÓ0O×0RÑ0RÐS`×SgÑSgÓ0hˆMÐ,Ò-ä×Ñðzôô
 "ŸI™IÐ'<¸m×>NÑ>NÐOd×OkÑOkÓ>lÐ&mÐstÔuˆMÜ"ŸY™YØ(¨.×*;Ñ*;Ð<S×<ZÑ<ZÓ*[Ð\ÐbcôˆNð ×&Ñ&×-Ñ-×@Ò@à#×'Ñ'¨°bÓ9Ð<Q×<WÑ<WÐXYÑ<ZÑZÐ]^Ñ^ð   Ñ-ð 1@×0CÑ0CÀLÐRSÓ0TÐWl×WrÑWrÐstÑWuÑ0u� Ñ-à#0ÀNÑSˆØ×"Ñ"×)Ñ)×<Ò<Ø"+ˆF�;Ñà.�$×%Ñ%×.Ñ.ÑK°ÐK¸?ÑKˆàˆr   )NNNNNNNNNFN)NNNNF)r   r   r   rk   ÚFloatTensorr   Ú
LongTensorÚboolr   r   rA   r“   Úno_gradr¢   r   r   r   rC   rC   °   sà  „ ð
 >BØ15Ø59Ø8<Ø=AØ,0Ø/3Ø-1Ø&*Ø).Ø$(ñ~
à×'Ñ'ð~
ð !×,Ñ,ð~
ð !)¨×)9Ñ)9Ñ :ð	~
ð
 ˜E×-Ñ-Ñ.ð~
ð ! ×!1Ñ!1Ñ2ð~
ð $ E×$4Ñ$4Ñ5ð~
ð !)¨×)9Ñ)9Ñ :ð~
ð $ D™>ð~
ð ' t™nð~
ð ˜×)Ñ)Ñ*ð~
ð ˜d‘^ð~
ð #'ð~
ð ˜D‘>ð~
ð 
ˆuÐJÐJÑ	Kó~
ð@ €U‡]�]ƒ_ð 9=Ø=AØ04Ø59Ø).ñqà×'Ñ'ðqð $ E×$4Ñ$4Ñ5ðqð !)¨×)9Ñ)9Ñ :ð	qð
 ˜E×,Ñ,Ñ-ðqð ! ×!1Ñ!1Ñ2ðqð #'ðqð 
×	Ñ	òqó ñqr   rC   )!Údataclassesr   Útypingr   r   r   rk   Útorch.utils.checkpointÚtorch.nnr   Ú;transformers.models.instructblip.configuration_instructblipr   r	   Ú6transformers.models.instructblip.modeling_instructblipr
   r   Úconfiguration_utilsr   Úmodels.auto.modeling_autor   Úutilsr   Úautor   r   Ú
get_loggerr   r*   r   r   r    rA   rC   r   r   r   ú<module>r¶      sš   ðõ  "ß )Ñ )ã Û Ý %÷÷õ
 4Ý JÝ ß -ð 
ˆ×	Ñ	˜HÓ	%€ô	Ð$<ô 	ô	Ð%>ô 	ôw
Ð.ô w
ðt ô	Ð;jó 	ó ð	ôsÐ0Tõ sr   