





from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
class        SCREAMING_SNAKE_CASE     (lowerCAmelCase__   ):
   _UpperCamelCase					:	Dict				      = ["image_processor", "tokenizer"]
   _UpperCamelCase					:	List[str]				      = "AutoImageProcessor"
   _UpperCamelCase					:	int				      = "AutoTokenizer"


   def __init__(					self    :       Optional[int]    ,  a    :       Dict    ,  a    :       Tuple )->     int:





       """simple docstring"""







       super().__init__(_SCREAMING_SNAKE_CASE    ,  _SCREAMING_SNAKE_CASE )
       lowercase__			    =						self.image_processor


   def __call__(					self    :       int    ,  a    :       List[Any]=None    ,  a    :       Union[str, Any]=None    ,  a    :       List[Any]=None    ,  **a    :       Union[str, Any] )->     Tuple:





       """simple docstring"""







       if text is None and images is None:
           raise ValueError('You have to specify either text or images. Both cannot be none.' )

       if text is not None:
           lowercase__			    =						self.tokenizer(_SCREAMING_SNAKE_CASE    ,  return_tensors=_SCREAMING_SNAKE_CASE    ,  **_SCREAMING_SNAKE_CASE )

       if images is not None:
           lowercase__			    =						self.image_processor(_SCREAMING_SNAKE_CASE    ,  return_tensors=_SCREAMING_SNAKE_CASE    ,  **_SCREAMING_SNAKE_CASE )

       if text is not None and images is not None:
           lowercase__			    =						image_features.pixel_values
           return encoding
       elif text is not None:
           return encoding
       else:
           return BatchEncoding(data=dict(**_SCREAMING_SNAKE_CASE )    ,  tensor_type=_SCREAMING_SNAKE_CASE )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Any    ,  *a    :       str    ,  **a    :       Union[str, Any] )->     Optional[int]:





       """simple docstring"""







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


   def  SCREAMING_SNAKE_CASE_							(					self    :       str    ,  *a    :       Any    ,  **a    :       Any )->     Optional[int]:





       """simple docstring"""







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


   @property
   def  SCREAMING_SNAKE_CASE_							(					self    :       str )->     Union[str, Any]:





       """simple docstring"""







       return ["input_ids", "attention_mask", "pixel_values"]









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


lowercase_					     =	{
    """configuration_squeezebert""": [
        """SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SqueezeBertConfig""",
        """SqueezeBertOnnxConfig""",
    ],
    """tokenization_squeezebert""": ["""SqueezeBertTokenizer"""],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_					     =	["""SqueezeBertTokenizerFast"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_					     =	[
          """SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """SqueezeBertForMaskedLM""",
          """SqueezeBertForMultipleChoice""",
          """SqueezeBertForQuestionAnswering""",
          """SqueezeBertForSequenceClassification""",
          """SqueezeBertForTokenClassification""",
          """SqueezeBertModel""",
          """SqueezeBertModule""",
          """SqueezeBertPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_squeezebert import (
          SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
          SqueezeBertConfig,
          SqueezeBertOnnxConfig,
      )
      from .tokenization_squeezebert import SqueezeBertTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_squeezebert_fast import SqueezeBertTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_squeezebert import (
                SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                SqueezeBertForMaskedLM,
                SqueezeBertForMultipleChoice,
                SqueezeBertForQuestionAnswering,
                SqueezeBertForSequenceClassification,
                SqueezeBertForTokenClassification,
                SqueezeBertModel,
                SqueezeBertModule,
                SqueezeBertPreTrainedModel,
            )

else:
      import sys

      lowercase_					     =	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


