





'''simple docstring'''







import warnings

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


class        __a   (lowerCAmelCase__  ):
							__a       : str          =							['image_processor', 'tokenizer']
							__a       : int          =							'VideoMAEImageProcessor'
							__a       : Optional[Any]          =							('CLIPTokenizer', 'CLIPTokenizerFast')

							def __init__(				self				:  int							,  __magic_name__				:  List[str]=None							,  __magic_name__				:  List[str]=None							,  **__magic_name__				:  Optional[int] )       ->							Tuple:







													"""simple docstring"""
													UpperCAmelCase_      :   Dict      =	None
													if "feature_extractor" in kwargs:
																			warnings.warn(
																			    '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
																			    ''' instead.'''							,  lowercase__							,  )
																			UpperCAmelCase_      :   List[Any]      =	kwargs.pop('''feature_extractor''' )

													UpperCAmelCase_      :   Tuple      =	image_processor if image_processor is not None else feature_extractor
													if image_processor is None:
																			raise ValueError('''You need to specify an `image_processor`.''' )
													if tokenizer is None:
																			raise ValueError('''You need to specify a `tokenizer`.''' )

													super().__init__(lowercase__							,  lowercase__ )
													UpperCAmelCase_      :   str      =	self.image_processor

							def __call__(				self				:  Any							,  __magic_name__				:  Optional[Any]=None							,  __magic_name__				:  List[Any]=None							,  __magic_name__				:  Optional[int]=None							,  **__magic_name__				:  Any )       ->							Any:







													"""simple docstring"""

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

													if text is not None:
																			UpperCAmelCase_      :   Union[str, Any]      =	self.tokenizer(lowercase__							,  return_tensors=lowercase__							,  **lowercase__ )

													if videos is not None:
																			UpperCAmelCase_      :   int      =	self.image_processor(lowercase__							,  return_tensors=lowercase__							,  **lowercase__ )

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

							def      UpperCAmelCase__						(				self				:  Optional[Any]							,  *__magic_name__				:  str							,  **__magic_name__				:  Tuple )       ->							Optional[int]:







													"""simple docstring"""
													return self.tokenizer.batch_decode(*lowercase__							,  **lowercase__ )

							def      UpperCAmelCase__						(				self				:  int							,  *__magic_name__				:  List[str]							,  **__magic_name__				:  str )       ->							Tuple:







													"""simple docstring"""
													return self.tokenizer.decode(*lowercase__							,  **lowercase__ )

							@property
							def      UpperCAmelCase__						(				self				:  Optional[Any] )       ->							Optional[int]:







													"""simple docstring"""
													return ["input_ids", "attention_mask", "position_ids", "pixel_values"]

							@property
							def      UpperCAmelCase__						(				self				:  Tuple )       ->							int:







													"""simple docstring"""
													warnings.warn(
													    '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''							,  lowercase__							,  )
													return self.image_processor_class



							@property
							def      UpperCAmelCase__						(				self				:  Tuple )       ->							Any:







													"""simple docstring"""
													warnings.warn(
													    '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''							,  lowercase__							,  )
													return self.image_processor













from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


snake_case_   :	Dict							      ={'''configuration_t5''': ['''T5_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''T5Config''', '''T5OnnxConfig''']}

try:
					if not is_sentencepiece_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	Optional[Any]							      =['''T5Tokenizer''']

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	Any							      =['''T5TokenizerFast''']

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	Optional[int]							      =[
					    '''T5_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''T5EncoderModel''',
					    '''T5ForConditionalGeneration''',
					    '''T5Model''',
					    '''T5PreTrainedModel''',
					    '''load_tf_weights_in_t5''',
					    '''T5ForQuestionAnswering''',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	Optional[Any]							      =[
					    '''TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TFT5EncoderModel''',
					    '''TFT5ForConditionalGeneration''',
					    '''TFT5Model''',
					    '''TFT5PreTrainedModel''',
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	Tuple							      =[
					    '''FlaxT5EncoderModel''',
					    '''FlaxT5ForConditionalGeneration''',
					    '''FlaxT5Model''',
					    '''FlaxT5PreTrainedModel''',
					]


if TYPE_CHECKING:
					from .configuration_ta import T5_PRETRAINED_CONFIG_ARCHIVE_MAP, TaConfig, TaOnnxConfig

					try:
										if not is_sentencepiece_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_ta import TaTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_ta_fast import TaTokenizerFast

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_ta import (
										    T5_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TaEncoderModel,
										    TaForConditionalGeneration,
										    TaForQuestionAnswering,
										    TaModel,
										    TaPreTrainedModel,
										    load_tf_weights_in_ta,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_ta import (
										    TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFTaEncoderModel,
										    TFTaForConditionalGeneration,
										    TFTaModel,
										    TFTaPreTrainedModel,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_ta import (
										    FlaxTaEncoderModel,
										    FlaxTaForConditionalGeneration,
										    FlaxTaModel,
										    FlaxTaPreTrainedModel,
										)


else:
					import sys

					snake_case_   :	List[Any]							      =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

