from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding

class    _UpperCAmelCase							(		_lowerCamelCase     ):
      a						       =							['''image_processor''', '''tokenizer''']
      a						       =							'''AutoImageProcessor'''
      a						       =							'''AutoTokenizer'''
      def __init__(		self      ,       a__      ,       a__       ):
         super().__init__(a__      ,       a__       )
         A_     :				List[Any]			      =	self.image_processor
      def __call__(		self      ,       a__=None      ,       a__=None      ,       a__=None      ,       **a__       ):

         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:
            A_     :				Dict			      =	self.tokenizer(a__      ,       return_tensors=a__      ,       **a__       )

         if images is not None:
            A_     :				Any			      =	self.image_processor(a__      ,       return_tensors=a__      ,       **a__       )

         if text is not None and images is not None:
            A_     :				Optional[Any]			      =	image_features.pixel_values
            return encoding
         elif text is not None:
            return encoding
         else:
            return BatchEncoding(data=dict(**a__       )      ,       tensor_type=a__       )
      def 		_lowerCamelCase      (		self      ,       *a__      ,       **a__       ):
         return self.tokenizer.batch_decode(*a__      ,       **a__       )
      def 		_lowerCamelCase      (		self      ,       *a__      ,       **a__       ):
         return self.tokenizer.decode(*a__      ,       **a__       )






      @property
      def 		_lowerCamelCase      (		self       ):
         return ["input_ids", "attention_mask", "pixel_values"]













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCAmelCase 				=     {
    """configuration_nllb_moe""": [
        """NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """NllbMoeConfig""",
    ]
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _lowerCAmelCase 				=     [
          """NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """NllbMoeForConditionalGeneration""",
          """NllbMoeModel""",
          """NllbMoePreTrainedModel""",
          """NllbMoeTop2Router""",
          """NllbMoeSparseMLP""",
      ]


if TYPE_CHECKING:
      from .configuration_nllb_moe import (
          NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
          NllbMoeConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_nllb_moe import (
                NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
                NllbMoeForConditionalGeneration,
                NllbMoeModel,
                NllbMoePreTrainedModel,
                NllbMoeSparseMLP,
                NllbMoeTopaRouter,
            )


else:
      import sys

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






