
    <hO                     l    S r SSKJr  SSKJrJrJr  SSKJrJ	r	J
r
   " S S\SS	9r " S
 S\5      rS/rg)z"
Processor class for BridgeTower.
    )Union   )ProcessingKwargsProcessorMixinUnpack)BatchEncodingPreTokenizedInput	TextInputc            	       6    \ rS rSrSSSSSSSSS.SSS.S.rSrg	)
BridgeTowerProcessorKwargs   TFr   )add_special_tokenspaddingstridereturn_overflowing_tokensreturn_special_tokens_maskreturn_offsets_mappingreturn_lengthverbose)do_normalizedo_center_crop)text_kwargsimages_kwargs N)__name__
__module____qualname____firstlineno__	_defaults__static_attributes__r       n/var/www/html/shao/venv/lib/python3.13/site-packages/transformers/models/bridgetower/processing_bridgetower.pyr   r      s5     #').*/&+"	
 !"
Ir!   r   F)totalc                      ^  \ rS rSrSrSS/rSrSrU 4S jr   SS\	\
\\\
   \\   4   S	\\   S
\4S jjrS rS r\S 5       rSrU =r$ )BridgeTowerProcessor,   a}  
Constructs a BridgeTower processor which wraps a Roberta tokenizer and BridgeTower image processor into a single
processor.

[`BridgeTowerProcessor`] offers all the functionalities of [`BridgeTowerImageProcessor`] and
[`RobertaTokenizerFast`]. See the docstring of [`~BridgeTowerProcessor.__call__`] and
[`~BridgeTowerProcessor.decode`] for more information.

Args:
    image_processor (`BridgeTowerImageProcessor`):
        An instance of [`BridgeTowerImageProcessor`]. The image processor is a required input.
    tokenizer (`RobertaTokenizerFast`):
        An instance of ['RobertaTokenizerFast`]. The tokenizer is a required input.
image_processor	tokenizerBridgeTowerImageProcessor)RobertaTokenizerRobertaTokenizerFastc                 $   > [         TU ]  X5        g N)super__init__)selfr'   r(   	__class__s      r"   r/   BridgeTowerProcessor.__init__@   s    4r!   textkwargsreturnc                     U R                   " [        4SU R                  R                  0UD6nU R                  " SSU0US   D6nU R                  " U40 US   D6nUR                  U5        U$ )z
This method uses [`BridgeTowerImageProcessor.__call__`] method to prepare image(s) for the model, and
[`RobertaTokenizerFast.__call__`] to prepare text for the model.

Please refer to the docstring of the above two methods for more information.
tokenizer_init_kwargsr3   r   r   r   )_merge_kwargsr   r(   init_kwargsr'   update)	r0   imagesr3   audiovideosr4   output_kwargsencodingencoding_image_processors	            r"   __call__BridgeTowerProcessor.__call__C   s~     **&
"&.."<"<
 

 >>LtL}]/KL#'#7#7#a-P_B`#a 01r!   c                 :    U R                   R                  " U0 UD6$ )z
This method forwards all its arguments to RobertaTokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please
refer to the docstring of this method for more information.
)r(   batch_decoder0   argsr4   s      r"   rD   !BridgeTowerProcessor.batch_decode]   s    
 ~~**D;F;;r!   c                 :    U R                   R                  " U0 UD6$ )z
This method forwards all its arguments to RobertaTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer
to the docstring of this method for more information.
)r(   decoderE   s      r"   rI   BridgeTowerProcessor.decoded   s    
 ~~$$d5f55r!   c                     U R                   R                  nU R                  R                  n[        [        R                  X-   5      5      $ r-   )r(   model_input_namesr'   listdictfromkeys)r0   tokenizer_input_namesimage_processor_input_namess      r"   rL   &BridgeTowerProcessor.model_input_namesk   s<     $ @ @&*&:&:&L&L#DMM"7"UVWWr!   r   )NNN)r   r   r   r   __doc__
attributesimage_processor_classtokenizer_classr/   r   r
   r	   rM   r   r   r   rA   rD   rI   propertyrL   r    __classcell__)r1   s   @r"   r%   r%   ,   s     $[1J7BO5 _c I0$y/4HYCZZ[ 34 
4<6 X Xr!   r%   N)rS   typingr   processing_utilsr   r   r   tokenization_utils_baser   r	   r
   r   r%   __all__r   r!   r"   <module>r]      sE     H H R R!1 &CX> CXL "
"r!   