
    Ph+                     |    d Z ddlZddlmZ ddlmZmZmZ  G d de      Z G d d	ed
      Z	 G d de      Z
dgZy)z
Processor class for ViLT.
    N)Optional   )ImagesKwargsProcessingKwargsProcessorMixinc                       e Zd ZU ee   ed<   y)ViltImagesKwargssize_divisorN)__name__
__module____qualname__r   int__annotations__     b/var/www/html/saasai/venv/lib/python3.12/site-packages/transformers/models/vilt/processing_vilt.pyr	   r	      s    3-r   r	   c            
       2    e Zd ZU eed<   ddddddddddiZy)ViltProcessorKwargsimages_kwargstext_kwargsTFr   )add_special_tokenspaddingstridereturn_overflowing_tokensreturn_special_tokens_maskreturn_offsets_mappingreturn_lengthverboseN)r   r   r   r	   r   	_defaultsr   r   r   r   r      s/    ##"&).*/&+"	
Ir   r   F)totalc                   X     e Zd ZdZddgZdZdZeZd	 fd	Z	e
d        Ze
d        Z xZS )
ViltProcessorau  
    Constructs a ViLT processor which wraps a BERT tokenizer and ViLT image processor into a single processor.

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

    Args:
        image_processor (`ViltImageProcessor`, *optional*):
            An instance of [`ViltImageProcessor`]. The image processor is a required input.
        tokenizer (`BertTokenizerFast`, *optional*):
            An instance of ['BertTokenizerFast`]. The tokenizer is a required input.
    image_processor	tokenizerViltImageProcessor)BertTokenizerBertTokenizerFastc                     d }d|v r+t        j                  dt               |j                  d      }||n|}t        |   ||       | j                  | _        y )Nfeature_extractorzhThe `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor` instead.)warningswarnFutureWarningpopsuper__init__r#   current_processor)selfr#   r$   kwargsr)   	__class__s        r   r/   zViltProcessor.__init__@   sa     &(MM
 !'

+> ?-<-H/N_)4!%!5!5r   c                 N    t        j                  dt               | j                  S )Nzg`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.)r*   r+   r,   image_processor_classr1   s    r   feature_extractor_classz%ViltProcessor.feature_extractor_classN   s"    u	
 )))r   c                 N    t        j                  dt               | j                  S )Nz[`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.)r*   r+   r,   r#   r6   s    r   r)   zViltProcessor.feature_extractorV   s"    i	
 ###r   )NN)r   r   r   __doc__
attributesr5   tokenizer_classr   valid_processor_kwargsr/   propertyr7   r)   __classcell__)r3   s   @r   r"   r"   -   sR     $[1J0<O06 * * $ $r   r"   )r9   r*   typingr   processing_utilsr   r   r   r	   r   r"   __all__r   r   r   <module>rB      sJ      N N |  *%  /$N /$d 
r   