a
    h                     @   sf   d Z ddlmZ ddlmZmZmZ ddlmZm	Z	m
Z
 G dd dedd	ZG d
d deZdgZdS )z"
Processor class for BridgeTower.
    )Union   )ProcessingKwargsProcessorMixinUnpack)BatchEncodingPreTokenizedInput	TextInputc                	   @   s.   e Zd ZdddddddddddddZdS )BridgeTowerProcessorKwargsTFr   )Zadd_special_tokenspaddingZstrideZreturn_overflowing_tokensZreturn_special_tokens_maskZreturn_offsets_mappingZreturn_lengthverbose)Zdo_normalizeZdo_center_crop)text_kwargsimages_kwargsN)__name__
__module____qualname__	_defaults r   r   r/var/www/html/assistant/venv/lib/python3.9/site-packages/transformers/models/bridgetower/processing_bridgetower.pyr
      s   r
   F)totalc                       s\   e Zd ZdZddgZdZdZ fddZdee	e
ee	 ee
 f ee ed	d
dZ  ZS )BridgeTowerProcessora  
    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	tokenizerZBridgeTowerImageProcessor)ZRobertaTokenizerZRobertaTokenizerFastc                    s   t  || d S )N)super__init__)selfr   r   	__class__r   r   r   @   s    zBridgeTowerProcessor.__init__N)textkwargsreturnc           	      K   sV   | j tfd| jji|}| jf d|i|d }| j|fi |d }|| |S )a  
        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.
        Ztokenizer_init_kwargsr   r   r   )Z_merge_kwargsr
   r   Zinit_kwargsr   update)	r   Zimagesr   ZaudioZvideosr   Zoutput_kwargsencodingZencoding_image_processorr   r   r   __call__C   s    
zBridgeTowerProcessor.__call__)NNN)r   r   r   __doc__
attributesZimage_processor_classZtokenizer_classr   r   r	   r   listr   r
   r   r#   __classcell__r   r   r   r   r   ,   s      r   N)r$   typingr   Zprocessing_utilsr   r   r   Ztokenization_utils_baser   r   r	   r
   r   __all__r   r   r   r   <module>   s   2