a
    ½Àhl  ã                   @   sb   d Z ddl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gZd	S )
z
Processor class for Bros.
é    )Ú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eee	e
e e
e	 f eeeeef eeeef ee eee ee ee eeeeeeeeef  ed
œ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)ZBertTokenizerZBertTokenizerFastNc                    s    |d u rt dƒ‚tƒ  |¡ d S )Nz"You need to specify a `tokenizer`.)Ú
ValueErrorÚsuperÚ__init__)Úselfr   Úkwargs©Ú	__class__© úd/var/www/html/assistant/venv/lib/python3.9/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 f |||||||||	|
|||||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%   )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__)N)NTFNNr   NNNFFFFTN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
attributesZtokenizer_classr   r   r	   r   ÚlistÚboolÚstrr   r
   r   Úintr   r   r(   Ú__classcell__r   r   r   r   r      sJ                  ðîr   N)r,   Útypingr   r   Zprocessing_utilsr   Ztokenization_utils_baser   r   r   r	   r
   Úutilsr   r   Ú__all__r   r   r   r   Ú<module>   s   C