
    fThU                     p    S r SSKJr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.
    )List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/auris/envauris/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#   r0   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_kwargsr4   r   r   r   )_merge_kwargsr   r)   init_kwargsr(   update)	r1   imagesr4   audiovideosr5   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r1   argsr5   s      r#   rE   !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)   decoderF   s      r#   rJ   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)r1   tokenizer_input_namesimage_processor_input_namess      r#   rM   &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_classr0   r   r   r
   r   r   r   r	   rB   rE   rJ   propertyrM   r!   __classcell__)r2   s   @r#   r&   r&   ,   s     $[1J7BO5 _c I0$y/4HYCZZ[ 34 
4<6 X Xr"   r&   N)rT   typingr   r   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"   