
    fTh                     l    S r SSKJrJrJrJr  SSKJrJrJ	r	  SSK
Jr  SSKJrJr   " S S\5      rS/rg	)
z
Processor class for Nougat.
    )DictListOptionalUnion)PreTokenizedInput	TextInputTruncationStrategy   )ProcessorMixin)PaddingStrategy
TensorTypec            A       F  ^  \ rS rSrSrSS/rSrSrU 4S jr                                  S/S\	\
   S	\	\
   S
\	\\\4      SSS\	\
   S\	\
   S\	\
   S\	\
   S\	\\\4      S\	\
   S\	\\\\   4      S\	\\\\   4      S\	S   S\	\\S4      S\	\\\\\   \\   4      S\\\\\   \\   4   S\	\\\\\   \\   4      S\
S\\
\\4   S\\
\\4   S\	\   S\S \
S!\	\   S"\	\\\4      S#\	\
   S$\	\
   S%\
S&\
S'\
S(\
S)\
4@S* jjrS+ rS, rS- rS.rU =r$ )0NougatProcessor   aJ  
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                 F   > [         TU ]  X5        U R                  U l        g )N)super__init__r   current_processor)selfr   r   	__class__s      d/var/www/auris/envauris/lib/python3.13/site-packages/transformers/models/nougat/processing_nougat.pyr   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#                     Uc  Uc  [        S5      eUb  U R                  UUUUUUUU	U
UUUUUUUS9n#Ub!  U R                  UUUUUUUUUUUUUUUUU U!U"S9n$Uc  W#$ Uc  W$$ W$S   W#S'   U#$ )NzBYou need to specify either an `images` or `text` input to process.)r   r   r    r!   r#   r$   r%   r&   r'   r(   r)   r*   r8   r+   r-   )r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   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/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   inputs	encodingss%                                        r   __call__NougatProcessor.__call__1   s    N >dlabb))-#!)#5%-)%#-'"3! * F$ #'!1#5%%$7#5-&;&;*C+E'=+' ' I, <M^(5F8Mr   c                 :    U R                   R                  " U0 UD6$ )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   rK   NougatProcessor.batch_decode   s    
 ~~**D;F;;r   c                 :    U R                   R                  " U0 UD6$ )z
This method forwards all its arguments to NougatTokenizer's [`~PreTrainedTokenizer.decode`]. Please refer to
the docstring of this method for more information.
)r   decoderL   s      r   rQ   NougatProcessor.decode   s    
 ~~$$d5f55r   c                 :    U R                   R                  " U0 UD6$ )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_generationrL   s      r   rT   'NougatProcessor.post_process_generation   s    
 ~~55tFvFFr   )r   )"NNNNNNNNNNNNNNchannels_firstNNNNTFNNr   FNNNNFFFFT)__name__
__module____qualname____firstlineno____doc__
attributesimage_processor_classtokenizer_classr   r   boolr   strintr   floatr   r   r   r   r	   r   rH   rK   rQ   rT   __static_attributes____classcell__)r   s   @r   r   r      s    $[1J0%O6 )-$()-)-'+-1!%%)6:'+:>9=4DFJmqei #'5:;?$($),0;?0404*/+0',#KZ !	Z
 D>Z tCH~&Z 'Z tnZ %TNZ Z TNZ !sEz!23Z tnZ U5$u+#567Z E%e"456Z  01!Z" $E#/A*A$BC#Z$ E)->YQUVgQh"hij%Z& 9&7i$O`Jaab'Z( #).YFWAXXY
)Z. !/Z0 tS/121Z2 $%7783Z4 SM5Z6 7Z8 "9Z: %SM;Z< !sJ!78=Z>  (~?Z@  (~AZB $(CZD %)EZF !%GZH IZJ KZx<6G Gr   r   N)r[   typingr   r   r   r   $transformers.tokenization_utils_baser   r   r	   processing_utilsr   utilsr   r   r   __all__ r   r   <module>rk      s9    / . a a . 0EGn EGP 
r   