o
    Zh                     @   sf   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g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)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__ W/var/www/auris/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   r/   c   r.   zBrosProcessor.decodec                 C   s   | j j}tt|S N)r   model_input_nameslistdictfromkeys)r   Ztokenizer_input_namesr   r   r   r1   j   s   zBrosProcessor.model_input_namesr0   )NTFNNr   NNNFFFFTN)__name__
__module____qualname____doc__
attributesZtokenizer_classr   r   r
   r	   r   boolstrr   r   r   intr   r   r)   r+   r/   propertyr1   __classcell__r   r   r   r   r      sr    	

-r   N)r8   typingr   r   r   Zprocessing_utilsr   Ztokenization_utils_baser   r   r	   r
   r   utilsr   r   __all__r   r   r   r   <module>   s   
V