ó
    ˆŽ¡j*  ã                   óB   • S SK Jr  S SKJr  \ " S S\5      5       rS/rg)é   )ÚProcessorMixin)Úauto_docstringc                   óh   ^ • \ rS rSrSrS
SU 4S jjjr\S\\   4S j5       r	S\
S\S\4S jrS	rU =r$ )ÚStep3p7Processoré   aA  Processor for Step-3.7-Flash.

Uses :class:`ProcessorMixin.__call__` for the standard image-token expansion
flow: the image processor splits each image into global + local patch crops,
then :meth:`replace_image_token` builds the per-image replacement string
that ``get_text_with_replacements`` substitutes into the text.
Úreturnc                 ó�  >• SU l         Ub  UR                  U R                   5      OS U l        UR                  UR                  -  nUR
                  S   U-  S-  U l        UR                  U-  S-  U l        U R                   U R                  -  U l	        U R                   U R                  -  U l
        [        TU ]0  " SXUS.UD6  g )Nz
<im_patch>Úheighté   )Úimage_processorÚ	tokenizerÚchat_template© )Úimage_tokenÚconvert_tokens_to_idsÚimage_token_idÚvision_patch_sizeÚdownsampler_strideÚsizeÚnum_image_feature_sizeÚ
patch_sizeÚnum_patch_feature_sizeÚimage_feature_placeholderÚpatch_feature_placeholderÚsuperÚ__init__)Úselfr   r   r   ÚkwargsÚstrideÚ	__class__s         €Ú¼C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\transformers/models/step3p7/processing_step3p7.pyr   ÚStep3p7Processor.__init__#   sÄ   ø€ Ø'ˆÔØS\ÑSh˜i×=Ñ=¸d×>NÑ>NÔOÐnrˆÔØ ×2Ñ2°_×5WÑ5WÑWˆØ'6×';Ñ';¸HÑ'EÈÑ'OÐTUÑ&UˆÔ#Ø'6×'AÑ'AÀVÑ'KÐPQÑ&QˆÔ#Ø)-×)9Ñ)9¸D×<WÑ<WÑ)WˆÔ&Ø)-×)9Ñ)9¸D×<WÑ<WÑ)WˆÔ&Ü‰ÒÐu¨Ð]jÑuÐntÓuó    c                 ó   • S/$ )NÚpatch_newline_masksr   )r   s    r!   Úunused_input_namesÚ#Step3p7Processor.unused_input_names-   s   € à%Ð&Ð&r#   Úimage_inputsÚ	image_idxc                 óð   • US   U   nUR                  S5      nUb  XR   OSnSn[        U5       H/  nUSU R                   S3-  nU(       d  M  Xh   (       d  M*  US-  nM1     USU R                   S	3-  nU$ )
zOReturn the expanded token string for image *image_idx* (patches + global view).Únum_local_patchesr%   NÚ z<patch_start>z<patch_end>z<patch_newline>z
<im_start>z<im_end>)ÚgetÚranger   r   )	r   r(   r)   r   Únum_patchesr%   Úpatch_newline_maskÚreplÚis	            r!   Úreplace_image_tokenÚ$Step3p7Processor.replace_image_token1   sŸ   € à"Ð#6Ñ7¸	ÑBˆØ*×.Ñ.Ð/DÓEÐØ?RÑ?^Ð0Ò;ÐdhÐØˆÜ�{Ö#ˆAØ�m D×$BÑ$BÐ#CÀ;ÐOÑOˆDß!Ð!Ð&8×&;Ñ&;ØÐ)Ñ)’ñ $ð 	�*˜T×;Ñ;Ð<¸HÐEÑEˆØˆr#   )r   r   r   r   r   r   )NN)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚpropertyÚlistÚstrr&   ÚdictÚintr3   Ú__static_attributes__Ú__classcell__)r    s   @r!   r   r      sS   ø† ñ÷vñ vð ð' D¨¡Ió 'ó ð'ð°ð Àð ÐSV÷ ò r#   r   N)Úprocessing_utilsr   Úutilsr   r   Ú__all__r   r#   r!   Ú<module>rD      s3   ðõ* /Ý #ð ô"�~ó "ó ð"ðJ Ð
�r#   