+
    œ°³j-  ã                   ó´   € R t ^RIHt ^RIHt ^RIHtHtHtH	t	H
t
 ^RIHtHt ^RIHt  ! R R]	RR	7      t ! R
 R]RR	7      t] ! R R]4      4       tR.tR# )z 
Processor class for Chameleon.
)ÚBatchFeature)Ú
ImageInput)ÚMultiModalDataÚProcessingKwargsÚProcessorMixinÚ
TextKwargsÚUnpack)ÚPreTokenizedInputÚ	TextInput)Úauto_docstringc                   ó0   a € ] tR t^t o RtV 3R ltRtV tR# )ÚChameleonTextKwargsam  
return_for_text_completion (`bool`, *optional*, defaults to `False`):
    Whether the processed text is intended for text completion tasks. When `True`, the processor does not
    append the separator token (`sep_token`) to the end of the prompt, which is typically used for chat
    mode. When `False`, the separator token is appended for proper chat formatting.
c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )é   Úreturn_for_text_completion)Úbool)ÚformatÚ__classdict__s   "€Ús/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/chameleon/processing_chameleon.pyÚ__annotate__Ú ChameleonTextKwargs.__annotate__   s   ø‡ ‚ ñ !%Ñ$ò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ € ñ÷ ƒ r   r   F)Útotalc                   óH   a € ] tR t^*t o RRRRRRR/RRR//tV 3R	 ltR
tV tR# )ÚChameleonProcessorKwargsÚtext_kwargsÚpaddingFr   Úreturn_mm_token_type_idsÚcommon_kwargsÚreturn_tensorsÚptc                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   r%   )r   )r   r   s   "€r   r   Ú%ChameleonProcessorKwargs.__annotate__*   s   ø‡ ‚ Ù$Ñ$ò r   r   N)r   r   r   r   Ú	_defaultsr   r   r    r!   s   @r   r$   r$   *   s;   ø‡ € ð 	Ø�uØ(¨%Ø&¨ð
ð
 	Ø˜dð
ð	€I÷ ƒ r   r$   c                   ó¤   a a€ ] tR t^8t o]tRV3R lV 3R lllt]V3R lR l4       t]	RV3R lV 3R lll4       t
V3R lR ltRR	 ltR
tVtV ;t# )ÚChameleonProcessorc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Úimage_seq_lengthÚimage_token)ÚintÚstr)r   r   s   "€r   r   ÚChameleonProcessor.__annotate__<   s    ø€ ÷ Xñ XÁSð XÑ^añ Xr   c                ó  <€ \         SV `  W4       W0n        \        VR4      '       d   VP                  MTV n        VP                  V P                  4      V n        \        VR4      '       d   VP                  MRV n        \        VR4      '       d   VP                  MRV n
        VP                  V P                  4      V n        VP                  V P                  4      V n        VP                  V P                  4      V n        R# )zÙ
image_seq_length (`int`, *optional*, defaults to 1024):
    Sequence length of one image embedding.
image_token (`str`, *optional*, defaults to `"<image>"`):
    The special token used to indicate image in the text.
r2   Ú	boi_tokenz<racm3:break>Ú	eoi_tokenz<eoss>N)ÚsuperÚ__init__r1   Úhasattrr2   Úconvert_tokens_to_idsÚimage_token_idr7   Úimage_start_tokenr8   Úimage_end_tokenÚimage_start_token_idÚimage_end_token_id)ÚselfÚimage_processorÚ	tokenizerr1   r2   Ú	__class__s   &&&&&€r   r:   ÚChameleonProcessor.__init__<   s×   ø€ ô 	‰Ñ˜Ô4à 0ÔÜ4;¸IÀ}×4UÒ4U˜9×0Ò0Ð[fˆÔØ'×=Ñ=¸d×>NÑ>NÓOˆÔä#*¨9°k×#BÒ#BˆI×ÒÈð 	Ôô 7>¸iÈ×6UÒ6U˜y×2Ò2Ð[cˆÔØ'×=Ñ=¸d×>NÑ>NÓOˆÔØ$-×$CÑ$CÀD×DZÑDZÓ$[ˆÔ!Ø"+×"AÑ"AÀ$×BVÑBVÓ"WˆÖr   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# )r   Úreturn)Úlistr3   )r   r   s   "€r   r   r5   Q   s   ø€ ÷ Yñ Y¡¡c¥ñ Yr   c                óH   € V P                   V P                  V P                  .# ©N)r=   r@   rA   )rB   s   &r   Úimage_token_idsÚ"ChameleonProcessor.image_token_idsP   s!   € à×#Ñ# T×%>Ñ%>À×@WÑ@WÐXÐXr   c                ó®   <€ V ^8„  d   QhRS[ R,          RS[S[,          S[S[,          ,          S[S[,          ,          R,          RS[S[,          RS[/# )r   ÚimagesNÚtextÚkwargsrH   )r   r
   r	   rI   r   r$   r   )r   r   s   "€r   r   r5   U   s^   ø€ ÷ ñ á˜TÕ!ðñ Ñ+Õ+©d±9­oÕ=ÁÑEVÕ@WÕWÐZ^Õ^ðñ Ñ1Õ2ð	ñ
 
ñr   c                ó¼   <€ \        V\        4      '       d   V.pV Uu. uF  qD V P                  P                   2NK  	  pp\        SV `  ! RRVRV/VB pV# u upi )a  
Returns:
    [`BatchFeature`]: A [`BatchFeature`] with the following fields:

    - **input_ids** -- List of token ids to be fed to a model. Returned when `text` is not `None`.
    - **attention_mask** -- List of indices specifying which tokens should be attended to by the model (when
      `return_attention_mask=True` or if *"attention_mask"* is in `self.model_input_names` and if `text` is not
      `None`).
    - **pixel_values** -- Pixel values to be fed to a model. Returned when `images` is not `None`.
rO   rP   r   )Ú
isinstancer4   rD   Ú	sep_tokenr9   Ú__call__)rB   rO   rP   rQ   ÚsampleÚmodel_inputsrE   s   &&&,  €r   rU   ÚChameleonProcessor.__call__T   sk   ø€ ô" �dœC× Ò Ø�6ˆDñ EIÓIÁD¸&�(˜4Ÿ>™>×3Ñ3Ð4Ó5ÁDˆÐIÜ‘wÒ'ÑK¨vÐK¸DÐKÀFÑKˆØÐùò Js   Ÿ"Ac                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# )r   Úimage_inputsÚ	image_idxrH   )Údictr3   r4   )r   r   s   "€r   r   r5   m   s#   ø€ ÷ ñ ±ð Áð ÑSVñ r   c                ó„   € V P                   V P                  V P                  ,          ,           V P                  ,           pV# rK   )r>   r2   r1   r?   )rB   rZ   r[   rQ   Úone_img_tokenss   &&&, r   Úreplace_image_tokenÚ&ChameleonProcessor.replace_image_tokenm   s5   € Ø×/Ñ/°4×3CÑ3CÀd×F[ÑF[Õ3[Õ\Ð_c×_sÑ_sÕsˆØÐr   c                ó¼   € / pVeM   V P                   ^,           .\        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.
Únum_image_tokensÚnum_image_patchesr   )r1   ÚlenÚupdater   )rB   Úimage_sizesrQ   Úvision_datarb   rc   s   &&,   r   Ú_get_num_multimodal_tokensÚ-ChameleonProcessor._get_num_multimodal_tokensq   sh   € ð ˆØÒ"à $× 5Ñ 5¸Õ 9Ð:¼SÀÓ=MÕMÐØ!" ¤c¨+Ó&6Õ 6Ðà×ÑÐ 2Ð4DÐFYÐ[lÐmÔnäÑ, Ñ,Ð,r   )r?   rA   r1   r>   r@   r2   r=   )i   z<image>)NNrK   )r   r   r   r   r$   Úvalid_processor_kwargsr:   ÚpropertyrL   r   rU   r_   rh   r   r    Ú__classcell__)rE   r   s   @@r   r/   r/   8   sZ   ù‡ € à5Ð÷Xõ Xð( ÷Yó ðYð ÷ô ó ð÷0ð ÷-ô -r   r/   N)r   Úfeature_extraction_utilsr   Úimage_utilsr   Úprocessing_utilsr   r   r   r   r   Útokenization_utils_baser	   r
   Úutilsr   r   r$   r/   Ú__all__r   r   r   Ú<module>rs      sk   ðñõ 5Ý %÷õ ÷ DÝ #ô%˜*¨Eõ %ôÐ/°uõ ð ôM-˜ó M-ó ðM-ð`  Ð
 ‚r   