


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



class 	lowerCamelCase__			(      _a      ):
   __lowerCamelCase			      =  ["""image_processor""", """tokenizer"""]
   __lowerCamelCase			      =  """AutoImageProcessor"""
   __lowerCamelCase			      =  """AutoTokenizer"""




   def __init__(   self						:						str    ,    __a						:						Union[str, Any]    ,    __a						:						str							):




         '''simple docstring'''







         super().__init__(__a    ,    __a							)
         lowerCamelCase__:						Optional[Any]							   = self.image_processor




   def __call__(   self						:						Optional[Any]    ,    __a						:						int=None    ,    __a						:						List[str]=None    ,    __a						:						Any=None    ,    **__a						:						Optional[int]							):




         '''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:
               lowerCamelCase__:						int							   = self.tokenizer(__a    ,    return_tensors=__a    ,    **__a							)

         if images is not None:
               lowerCamelCase__:						List[str]							   = self.image_processor(__a    ,    return_tensors=__a    ,    **__a							)

         if text is not None and images is not None:
               lowerCamelCase__:						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						:						Tuple    ,    *__a						:						Optional[int]    ,    **__a						:						Optional[Any]							):




         '''simple docstring'''







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




   def 							lowerCamelCase_   (   self						:						Dict    ,    *__a						:						Any    ,    **__a						:						Optional[int]							):




         '''simple docstring'''







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




   @property
   def 							lowerCamelCase_   (   self						:						Optional[int]							):




         '''simple docstring'''







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










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A				:       List[str]      =  {
    'configuration_time_series_transformer': [
        'TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'TimeSeriesTransformerConfig',
    ],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A				:       str      =  [
	    'TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'TimeSeriesTransformerForPrediction',
	    'TimeSeriesTransformerModel',
	    'TimeSeriesTransformerPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_time_series_transformer import (
	    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    TimeSeriesTransformerConfig,
	)

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_time_series_transformer import (
		    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TimeSeriesTransformerForPrediction,
		    TimeSeriesTransformerModel,
		    TimeSeriesTransformerPreTrainedModel,
		)

else:
	import sys

	A				:       str      =  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





