+
    œ°³jJ  ã                   ó¢   € R t ^RIHtHt ^RIHtHtHt ^RIH	t	H
t
 ]
P                  ! ]4      t ! R R]RR7      t]	 ! R R	]4      4       tR	.tR
# )z
Processor class for Llava.
)Úget_image_sizeÚto_numpy_array)ÚMultiModalDataÚProcessingKwargsÚProcessorMixin)Úauto_docstringÚloggingc                   ó*   € ] tR t^tRRRRRRR//tRtR# )ÚLlavaProcessorKwargsÚtext_kwargsÚpaddingFÚreturn_mm_token_type_idsÚreturn_text_replacement_offsets© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	_defaultsÚ__static_attributes__r   ó    Úk/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/llava/processing_llava.pyr
   r
      s   † à˜	 5Ð*DÀeÐMnÐpuÐvð„Ir   r
   F)Útotalc                   óV   a a€ ] tR t^$t o]tRV 3R lltV3R lR ltRR ltRt	Vt
V ;t# )ÚLlavaProcessorc                óê   <€ W0n         Wpn        W@n        \        VR4      '       d   VP                  MTV n        VP                  V P                  RR7      ^ ,          V n        \        S	V `!  WVR7       R# )aV  
patch_size (`int`, *optional*):
    Patch size from the vision tower.
vision_feature_select_strategy (`str`, *optional*):
    The feature selection strategy used to select the vision feature from the vision backbone.
    Should be same as in model's config
image_token (`str`, *optional*, defaults to `"<image>"`):
    Special token used to denote image location.
num_additional_image_tokens (`int`, *optional*, defaults to 0):
    Number of additional tokens added to the image embeddings, such as CLS (+1). If the backbone has no CLS or other
    extra tokens appended, no need to set this arg.
Úimage_tokenF)Úadd_special_tokens)Úchat_templateN)	Ú
patch_sizeÚnum_additional_image_tokensÚvision_feature_select_strategyÚhasattrr   ÚencodeÚimage_token_idÚsuperÚ__init__)
ÚselfÚimage_processorÚ	tokenizerr   r!   r   r   r    ÚkwargsÚ	__class__s
   &&&&&&&&,€r   r&   ÚLlavaProcessor.__init__(   sj   ø€ ð. %ŒØ+FÔ(Ø.LÔ+Ü4;¸IÀ}×4UÒ4U˜9×0Ò0Ð[fˆÔØ'×.Ñ.¨t×/?Ñ/?ÐTYÐ.ÓZÐ[\Õ]ˆÔÜ‰Ñ˜À=ÐÖQr   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# )é   Úimage_inputsÚ	image_idxÚreturn)ÚdictÚintÚstr)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚLlavaProcessor.__annotate__F   s#   ø€ ÷ 3ñ 3±ð 3Áð 3ÑSVñ 3r   c                ó  € VR ,          V,          p\        \        V4      4      w  rVWPP                  ,          W`P                  ,          ,          V P                  ,           pV P                  R8X  d
   V^,          pV P
                  V,          # )Úpixel_valuesÚdefault)r   r   r   r    r!   r   )r'   r/   r0   r*   r:   ÚheightÚwidthÚnum_image_tokenss   &&&,    r   Úreplace_image_tokenÚ"LlavaProcessor.replace_image_tokenF   sr   € Ø# NÕ3°IÕ>ˆÜ&¤~°lÓ'CÓD‰ˆØ"§o¡oÕ5¸%Ç?Á?Õ:RÕSÐVZ×VvÑVvÕvÐØ×.Ñ.°)Ô;Ø Õ!ÐØ×ÑÐ"2Õ2Ð2r   c                ó*  € / pVEe   \         P                  P                  R/ 4      pVP                  V4       VP                  RR4      ;'       g    V P                  P
                  pVR,          VR,          rvW`P                  ,          WpP                  ,          ,          pW€P                  ,          pV P                  R8X  d
   V^,          pV.\        V4      ,          p^.\        V4      ,          p	VP                  RVRV	/4       \        R	/ VB # )
a{  
Computes the number of placeholder tokens needed for multimodal inputs with the given sizes.

Args:
    image_sizes (`list[list[int]]`, *optional*):
        The input sizes formatted as (height, width) per each image.

Returns:
    `MultiModalData`: A `MultiModalData` object holding number of tokens per each of the provided
    input modalities, along with other useful data.
NÚimages_kwargsÚ	crop_sizer<   r=   r;   r>   Únum_image_patchesr   )r
   r   ÚgetÚupdater(   rC   r   r    r!   Úlenr   )
r'   Úimage_sizesr*   Úvision_datarB   rC   Úresized_heightÚresized_widthr>   rD   s
   &&,       r   Ú_get_num_multimodal_tokensÚ)LlavaProcessor._get_num_multimodal_tokensN   sþ   € ð ˆØÓ"Ü0×:Ñ:×>Ñ>¸ÐPRÓSˆMØ× Ñ  Ô(Ø%×)Ñ)¨+°tÓ<×^Ð^À×@TÑ@T×@^Ñ@^ˆIØ,5°hÕ,?ÀÈ7ÕAS˜Mà .·/±/Õ AÀm×WfÑWfÕFfÕgÐØ× @Ñ @Õ@ÐØ×2Ñ2°iÔ?Ø  AÕ%Ð à 0Ð1´C¸Ó4DÕDÐØ!" ¤c¨+Ó&6Õ 6ÐØ×ÑÐ 2Ð4DÐFYÐ[lÐmÔnäÑ, Ñ,Ð,r   )r   r$   r    r   r!   )NNNNNz<image>é    )N)r   r   r   r   r
   Úvalid_processor_kwargsr&   r?   rL   r   Ú__classdictcell__Ú__classcell__)r+   r6   s   @@r   r   r   $   s%   ù‡ € à1Ð÷R÷<3ð 3÷-ô -r   r   N)Ú__doc__Úimage_utilsr   r   Úprocessing_utilsr   r   r   Úutilsr   r   Ú
get_loggerr   Úloggerr
   r   Ú__all__r   r   r   Ú<module>rY      sh   ðñ÷ :÷ñ ÷
 -ð 
×	Ò	˜HÓ	%€ôÐ+°5õ ð ôF-�^ó F-ó ðF-ðR Ð
‚r   