from typing import List, Optional, Union

from ...image_utils import ImageInput
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType







class __snake_case    (						lowerCamelCase_		):






   """simple docstring"""




   lowerCAmelCase_														=							["""image_processor""", """tokenizer"""]
   lowerCAmelCase_														=							"""BlipImageProcessor"""
   lowerCAmelCase_														=							"""AutoTokenizer"""




   def __init__(   self      :    str	,     _lowercase      :    Any	,     _lowercase      :    str				):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__      							=				False
     super().__init__(_A	,     _A				)
     SCREAMING_SNAKE_CASE__      							=				self.image_processor




   def __call__(   self      :    Dict	,     _lowercase      :    ImageInput = None	,     _lowercase      :    Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None	,     _lowercase      :    bool = True	,     _lowercase      :    Union[bool, str, PaddingStrategy] = False	,     _lowercase      :    Union[bool, str, TruncationStrategy] = None	,     _lowercase      :    Optional[int] = None	,     _lowercase      :    int = 0	,     _lowercase      :    Optional[int] = None	,     _lowercase      :    Optional[bool] = None	,     _lowercase      :    bool = False	,     _lowercase      :    bool = False	,     _lowercase      :    bool = False	,     _lowercase      :    bool = False	,     _lowercase      :    bool = False	,     _lowercase      :    bool = True	,     _lowercase      :    Optional[Union[str, TensorType]] = None	,     **_lowercase      :    int	,     ):



     """simple docstring"""






     if images is None and text is None:
       raise ValueError("""You have to specify either images or text."""				)

     # Get only text
     if images is None:
       SCREAMING_SNAKE_CASE__      							=				self.tokenizer
       SCREAMING_SNAKE_CASE__      							=				self.tokenizer(
           text=_A	,     add_special_tokens=_A	,     padding=_A	,     truncation=_A	,     max_length=_A	,     stride=_A	,     pad_to_multiple_of=_A	,     return_attention_mask=_A	,     return_overflowing_tokens=_A	,     return_special_tokens_mask=_A	,     return_offsets_mapping=_A	,     return_token_type_ids=_A	,     return_length=_A	,     verbose=_A	,     return_tensors=_A	,     **_A	,     )
       return text_encoding

     # add pixel_values
     SCREAMING_SNAKE_CASE__      							=				self.image_processor(_A	,     return_tensors=_A				)

     if text is not None:
       SCREAMING_SNAKE_CASE__      							=				self.tokenizer(
           text=_A	,     add_special_tokens=_A	,     padding=_A	,     truncation=_A	,     max_length=_A	,     stride=_A	,     pad_to_multiple_of=_A	,     return_attention_mask=_A	,     return_overflowing_tokens=_A	,     return_special_tokens_mask=_A	,     return_offsets_mapping=_A	,     return_token_type_ids=_A	,     return_length=_A	,     verbose=_A	,     return_tensors=_A	,     **_A	,     )
     else:
       SCREAMING_SNAKE_CASE__      							=				None

     if text_encoding is not None:
       encoding_image_processor.update(_A				)

     return encoding_image_processor




   def      __a						(   self      :    Optional[Any]	,     *_lowercase      :    Any	,     **_lowercase      :    Tuple				):



     """simple docstring"""






     return self.tokenizer.batch_decode(*_A	,     **_A				)




   def      __a						(   self      :    Tuple	,     *_lowercase      :    int	,     **_lowercase      :    str				):



     """simple docstring"""






     return self.tokenizer.decode(*_A	,     **_A				)




   @property
   # Copied from transformers.models.blip.processing_blip.BlipProcessor.model_input_names
   def      __a						(   self      :    str				):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__      							=				self.tokenizer.model_input_names
     SCREAMING_SNAKE_CASE__      							=				self.image_processor.model_input_names
     return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names				)				)

from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels
from .squad import SquadExample, SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features
from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor
from .xnli import xnli_output_modes, xnli_processors, xnli_tasks_num_labels
