Ë
    S^(hU  ã                   óv   — d Z ddlmZmZ ddlmZmZmZ ddlm	Z	m
Z
mZ  G d„ ded¬	«      Z G d
„ de«      ZdgZy)z"
Processor class for BridgeTower.
é    )ÚListÚUnioné   )ÚProcessingKwargsÚProcessorMixinÚUnpack)ÚBatchEncodingÚPreTokenizedInputÚ	TextInputc            	       ó.   — e Zd ZdddddddddœdddœdœZy)ÚBridgeTowerProcessorKwargsTFr   )Ú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_kwargsN)Ú__name__Ú
__module__Ú__qualname__Ú	_defaults© ó    út/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/bridgetower/processing_bridgetower.pyr   r      s5   „ ð #'ØØØ).Ø*/Ø&+Ø"Øñ	
ð !Ø"ñ
ñ�Ir   r   F)Útotalc                   óŠ   ‡ — e Zd ZdZddgZdZdZˆ fd„Z	 	 	 ddee	e
ee	   ee
   f   dee   d	efd
„Zd„ Zd„ Zed„ «       Zˆ x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Ú	tokenizerÚBridgeTowerImageProcessor)ÚRobertaTokenizerÚRobertaTokenizerFastc                 ó&   •— t         ‰| �  ||«       y ©N)ÚsuperÚ__init__)Úselfr$   r%   Ú	__class__s      €r    r,   zBridgeTowerProcessor.__init__@   s   ø€ Ü‰Ñ˜¨)Õ4r   ÚtextÚkwargsÚreturnc                 óÜ   —  | j                   t        fd| j                  j                  i|¤Ž} | j                  dd|i|d   ¤Ž} | j                  |fi |d   ¤Ž}|j                  |«       |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.
        Útokenizer_init_kwargsr/   r   r   r   )Ú_merge_kwargsr   r%   Úinit_kwargsr$   Úupdate)	r-   Úimagesr/   ÚaudioÚvideosr0   Úoutput_kwargsÚencodingÚencoding_image_processors	            r    Ú__call__zBridgeTowerProcessor.__call__C   s„   € ð +˜×*Ñ*Ü&ñ
à"&§.¡.×"<Ñ"<ð
ð ñ
ˆð
 "�4—>‘>ÑL tÐL¨}¸]Ñ/KÑLˆà#7 4×#7Ñ#7¸Ñ#aÀ-ÐP_ÑB`Ñ#aÐ Ø�‰Ð0Ô1àˆr   c                 ó:   —  | j                   j                  |i |¤ŽS )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©r-   Úargsr0   s      r    r?   z!BridgeTowerProcessor.batch_decode]   s    € ð
 +ˆt�~‰~×*Ñ*¨DÐ;°FÑ;Ð;r   c                 ó:   —  | j                   j                  |i |¤ŽS )z¾
        This method forwards all its arguments to RobertaTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer
        to the docstring of this method for more information.
        )r%   Údecoder@   s      r    rC   zBridgeTowerProcessor.decoded   s    € ð
 %ˆt�~‰~×$Ñ$ dÐ5¨fÑ5Ð5r   c                 óœ   — | j                   j                  }| j                  j                  }t        t        j                  ||z   «      «      S r*   )r%   Úmodel_input_namesr$   ÚlistÚdictÚfromkeys)r-   Útokenizer_input_namesÚimage_processor_input_namess      r    rE   z&BridgeTowerProcessor.model_input_namesk   s?   € à $§¡× @Ñ @ÐØ&*×&:Ñ&:×&LÑ&LÐ#Ü”D—M‘MÐ"7Ð:UÑ"UÓVÓWÐWr   )NNN)r   r   r   Ú__doc__Ú
attributesÚimage_processor_classÚtokenizer_classr,   r   r   r
   r   r   r   r	   r=   r?   rC   ÚpropertyrE   Ú__classcell__)r.   s   @r    r#   r#   ,   s“   ø„ ñð $ [Ð1€JØ7ÐØB€Oô5ð _cØØñð �IÐ0°$°y±/À4ÐHYÑCZÐZÑ[ðð Ð3Ñ4ðð 
óò4<ò6ð ñXó ôXr   r#   N)rK   Útypingr   r   Úprocessing_utilsr   r   r   Útokenization_utils_baser	   r
   r   r   r#   Ú__all__r   r   r    ú<module>rU      sE   ðñ÷ ç HÑ Hß RÑ RôÐ!1¸õ ô&CX˜>ô CXðL "Ð
"�r   