Ë
    T^(h±  ã                   ól   — d Z ddlmZmZmZmZ ddlmZmZm	Z	 ddl
mZ ddlmZmZ  G d„ de«      ZdgZy	)
z
Processor class for Nougat.
é    )ÚDictÚListÚOptionalÚUnion)ÚPreTokenizedInputÚ	TextInputÚTruncationStrategyé   )ÚProcessorMixin)ÚPaddingStrategyÚ
TensorTypec            A       ó,  ‡ — e Zd ZdZddgZdZdZˆ fd„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d-dee	   dee	   d	e
eef   d
ddee	   dee	   dee	   dee	   deeef   dee	   deeeee   f      deeeee   f      ded   deeedf      deeeeee   ee   f      deeeee   ee   f   deeeeee   ee   f      de	dee	eef   dee	eef   dee   dede	d ee   d!eeeef      d"ee	   d#ee	   d$e	d%e	d&e	d'e	d(e	f@d)„Zd*„ Zd+„ Zd,„ Zˆ xZS ).ÚNougatProcessoran  
    Constructs a Nougat processor which wraps a Nougat image processor and a Nougat tokenizer into a single processor.

    [`NougatProcessor`] offers all the functionalities of [`NougatImageProcessor`] and [`NougatTokenizerFast`]. See the
    [`~NougatProcessor.__call__`] and [`~NougatProcessor.decode`] for more information.

    Args:
        image_processor ([`NougatImageProcessor`]):
            An instance of [`NougatImageProcessor`]. The image processor is a required input.
        tokenizer ([`NougatTokenizerFast`]):
            An instance of [`NougatTokenizerFast`]. The tokenizer is a required input.
    Úimage_processorÚ	tokenizerÚAutoImageProcessorÚAutoTokenizerc                 óH   •— t         ‰| �  ||«       | j                  | _        y )N)ÚsuperÚ__init__r   Úcurrent_processor)Úselfr   r   Ú	__class__s      €új/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/nougat/processing_nougat.pyr   zNougatProcessor.__init__-   s    ø€ Ü‰Ñ˜¨)Ô4Ø!%×!5Ñ!5ˆÕó    Údo_crop_marginÚ	do_resizeÚsizeÚresampleÚPILImageResamplingÚdo_thumbnailÚdo_align_long_axisÚdo_padÚ
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanÚ	image_stdÚdata_formatÚChannelDimensionÚinput_data_formatÚ	text_pairÚtext_targetÚtext_pair_targetÚadd_special_tokensÚpaddingÚ
truncationÚ
max_lengthÚstrideÚis_split_into_wordsÚpad_to_multiple_ofÚreturn_tensorsÚreturn_token_type_idsÚreturn_attention_maskÚreturn_overflowing_tokensÚreturn_special_tokens_maskÚreturn_offsets_mappingÚreturn_lengthÚverbosec#                 óÖ   — |€|€t        d«      ‚|�!| j                  ||||||||	|
|||||||¬«      }#|�$| j                  ||||||||||||||||| |!|"¬«      }$|€#S |€$S $d   #d<   |#S )NzBYou need to specify either an `images` or `text` input to process.)r   r   r   r   r!   r"   r#   r$   r%   r&   r'   r(   r6   r)   r+   )r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   Ú	input_idsÚlabels)Ú
ValueErrorr   r   )%r   ÚimagesÚtextr   r   r   r   r!   r"   r#   r$   r%   r&   r'   r(   r)   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   ÚinputsÚ	encodingss%                                        r   Ú__call__zNougatProcessor.__call__1   sä   € ðN ˆ>˜d˜lÜÐaÓbÐbàÐØ×)Ñ)ØØ-Ø#ØØ!Ø)Ø#5ØØ%Ø-Ø)Ø%Ø#Ø-Ø'Ø"3ð! *ó ˆFð$ ÐØŸ™ØØ#Ø'Ø!1Ø#5ØØ%Ø%ØØ$7Ø#5Ø-Ø&;Ø&;Ø*CØ+EØ'=Ø+Øð' 'ó ˆIð, ˆ<ØˆMØˆ^ØÐà(¨Ñ5ˆF�8ÑØˆMr   c                 ó:   —  | j                   j                  |i |¤ŽS )z¿
        This method forwards all its arguments to NougatTokenizer's [`~PreTrainedTokenizer.batch_decode`]. Please refer
        to the docstring of this method for more information.
        )r   Úbatch_decode©r   ÚargsÚkwargss      r   rH   zNougatProcessor.batch_decode�   s    € ð
 +ˆt�~‰~×*Ñ*¨DÐ;°FÑ;Ð;r   c                 ó:   —  | j                   j                  |i |¤ŽS )z¹
        This method forwards all its arguments to NougatTokenizer's [`~PreTrainedTokenizer.decode`]. Please refer to
        the docstring of this method for more information.
        )r   ÚdecoderI   s      r   rM   zNougatProcessor.decode”   s    € ð
 %ˆt�~‰~×$Ñ$ dÐ5¨fÑ5Ð5r   c                 ó:   —  | j                   j                  |i |¤ŽS )zÊ
        This method forwards all its arguments to NougatTokenizer's [`~PreTrainedTokenizer.post_process_generation`].
        Please refer to the docstring of this method for more information.
        )r   Úpost_process_generationrI   s      r   rO   z'NougatProcessor.post_process_generation›   s    € ð
 6ˆt�~‰~×5Ñ5°tÐF¸vÑFÐFr   )"NNNNNNNNNNNNNNÚchannels_firstNNNNTFNNr   FNNNNFFFFT)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
attributesÚimage_processor_classÚtokenizer_classr   r   Úboolr   ÚstrÚintr   Úfloatr   r   r   r   r	   r   rF   rH   rM   rO   Ú__classcell__)r   s   @r   r   r      s  ø„ ñð $ [Ð1€JØ0ÐØ%€Oô6ð ØØ)-Ø$(Ø#Ø)-Ø'+Ø-1Ø!%Ø%)Ø,0Ø'+Ø:>Ø9=Ø4DØFJØmqØeið Ø#'Ø5:Ø;?Ø$(ØØ$)Ø,0Ø;?Ø04Ø04Ø*/Ø+0Ø',Ø#ØñKZð ! ™ð	Zð
 ˜D‘>ðZð �3˜�8‰nðZð 'ðZð ˜t‘nðZð % T™NðZð ˜‘ðZð ˜T‘NðZð ˜c 5˜jÑ)ðZð ˜t‘nðZð ˜U 5¨$¨u©+Ð#5Ñ6Ñ7ðZð ˜E %¨¨e©Ð"4Ñ5Ñ6ðZð  Ð0Ñ1ð!Zð" $ E¨#Ð/AÐ*AÑ$BÑCð#Zð$ ˜E )Ð->ÀÀYÁÐQUÐVgÑQhÐ"hÑiÑjð%Zð& ˜9Ð&7¸¸i¹È$ÐO`ÑJaÐaÑbð'Zð( #Ø�)Ð.°°Y±ÀÐFWÑAXÐXÑYñ
ð)Zð. !ð/Zð0 �t˜S /Ð1Ñ2ð1Zð2 ˜$ Ð%7Ð7Ñ8ð3Zð4 ˜S‘Mð5Zð6 ð7Zð8 "ð9Zð: % S™Mð;Zð< !  s¨J Ñ!7Ñ8ð=Zð>  (¨™~ð?Zð@  (¨™~ðAZðB $(ðCZðD %)ðEZðF !%ðGZðH ðIZðJ óKZòx<ò6öGr   r   N)rT   Útypingr   r   r   r   Ú$transformers.tokenization_utils_baser   r   r	   Úprocessing_utilsr   Úutilsr   r   r   Ú__all__© r   r   ú<module>rc      s9   ðñ÷ /Ó .ç aÑ aå .ß 0ôEG�nô EGðP Ð
�r   