o
    òÜÓha  ã                   @   s`   d Z ddlmZmZmZ ddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ G dd„ deƒZd	S )
z
Processor class for Bros.
é    )ÚListÚOptionalÚUnioné   )ÚProcessorMixin)ÚBatchEncodingÚPaddingStrategyÚPreTokenizedInputÚ	TextInputÚTruncationStrategy)Ú
TensorTypec                "       sö   e Zd ZdZdgZdZd"‡ fdd„	Z																d#d
eee	e
e e
e	 f dedeeeef deeeef dee dedee dee dee dedededededeeeef  def dd„Zdd„ Zdd„ Zed d!„ ƒZ‡  ZS )$ÚBrosProcessora‘  
    Constructs a Bros processor which wraps a BERT tokenizer.

    [`BrosProcessor`] offers all the functionalities of [`BertTokenizerFast`]. See the docstring of
    [`~BrosProcessor.__call__`] and [`~BrosProcessor.decode`] for more information.

    Args:
        tokenizer (`BertTokenizerFast`, *optional*):
            An instance of ['BertTokenizerFast`]. The tokenizer is a required input.
    Ú	tokenizer)ÚBertTokenizerÚBertTokenizerFastNc                    s    |d u rt dƒ‚tƒ  |¡ d S )Nz"You need to specify a `tokenizer`.)Ú
ValueErrorÚsuperÚ__init__)Úselfr   Úkwargs©Ú	__class__© ú^/var/www/html/ai/venv/lib/python3.10/site-packages/transformers/models/bros/processing_bros.pyr   )   s   zBrosProcessor.__init__TFr   ÚtextÚadd_special_tokensÚpaddingÚ
truncationÚ
max_lengthÚstrideÚpad_to_multiple_ofÚreturn_token_type_idsÚreturn_attention_maskÚreturn_overflowing_tokensÚreturn_special_tokens_maskÚreturn_offsets_mappingÚreturn_lengthÚverboseÚreturn_tensorsÚreturnc                 K   s4   | j d|||||||||	|
|||||dœ|¤Ž}|S )z¶
        This method uses [`BertTokenizerFast.__call__`] to prepare text for the model.

        Please refer to the docstring of the above two methods for more information.
        )r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   Nr   )r   )r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r   Úencodingr   r   r   Ú__call__/   s(   ñðzBrosProcessor.__call__c                 O   ó   | j j|i |¤ŽS )zÁ
        This method forwards all its arguments to BertTokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please
        refer to the docstring of this method for more information.
        )r   Úbatch_decode©r   Úargsr   r   r   r   r-   \   ó   zBrosProcessor.batch_decodec                 O   r,   )z»
        This method forwards all its arguments to BertTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer to
        the docstring of this method for more information.
        )r   Údecoder.   r   r   r   r1   c   r0   zBrosProcessor.decodec                 C   s   | j j}tt |¡ƒS ©N)r   Úmodel_input_namesÚlistÚdictÚfromkeys)r   Útokenizer_input_namesr   r   r   r3   j   s   zBrosProcessor.model_input_namesr2   )NTFNNr   NNNFFFFTN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
attributesÚtokenizer_classr   r   r
   r	   r   ÚboolÚstrr   r   r   Úintr   r   r+   r-   r1   Úpropertyr3   Ú__classcell__r   r   r   r   r      sr    ðþýüûúùø	÷
öõôóòñð
î-r   N)r;   Útypingr   r   r   Úprocessing_utilsr   Útokenization_utils_baser   r   r	   r
   r   Úutilsr   r   r   r   r   r   Ú<module>   s   