

'''simple docstring'''



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



class lowerCamelCase			(  lowercase_						):



			'''simple docstring'''






			__snake_case        =	['image_processor', 'tokenizer']
			__snake_case        =	'AutoImageProcessor'
			__snake_case        =	'AutoTokenizer'


			def __init__(				self	:						Optional[Any]		,      lowerCAmelCase_	:						List[Any]		,      lowerCAmelCase_	:						Optional[Any]			)      ->		Optional[int]:





									'''simple docstring'''
									super().__init__(lowerCAmelCase_		,      lowerCAmelCase_			)
									A__					:       Tuple     =self.image_processor


			def __call__(				self	:						Dict		,      lowerCAmelCase_	:						str=None		,      lowerCAmelCase_	:						Dict=None		,      lowerCAmelCase_	:						str=None		,      **lowerCAmelCase_	:						Union[str, Any]			)      ->		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:
															A__					:       Dict     =self.tokenizer(lowerCAmelCase_		,      return_tensors=lowerCAmelCase_		,      **lowerCAmelCase_			)

									if images is not None:
															A__					:       Union[str, Any]     =self.image_processor(lowerCAmelCase_		,      return_tensors=lowerCAmelCase_		,      **lowerCAmelCase_			)

									if text is not None and images is not None:
															A__					:       Union[str, Any]     =image_features.pixel_values
															return encoding
									elif text is not None:
															return encoding
									else:
															return BatchEncoding(data=dict(**lowerCAmelCase_			)		,      tensor_type=lowerCAmelCase_			)


			def lowercase__						(				self	:						Union[str, Any]		,      *lowerCAmelCase_	:						Optional[Any]		,      **lowerCAmelCase_	:						Optional[Any]			)      ->		Optional[Any]:





									'''simple docstring'''
									return self.tokenizer.batch_decode(*lowerCAmelCase_		,      **lowerCAmelCase_			)


			def lowercase__						(				self	:						str		,      *lowerCAmelCase_	:						Optional[int]		,      **lowerCAmelCase_	:						List[str]			)      ->		Dict:





									'''simple docstring'''
									return self.tokenizer.decode(*lowerCAmelCase_		,      **lowerCAmelCase_			)



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





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




'''simple docstring'''



from typing import TYPE_CHECKING

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


__snake_case			:     Any										=      {
    'configuration_audio_spectrogram_transformer': [
        'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'ASTConfig',
    ]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__snake_case			:     Optional[int]										=      [
		    'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'ASTForAudioClassification',
		    'ASTModel',
		    'ASTPreTrainedModel',
		]

try:
		if not is_speech_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__snake_case			:     List[Any]										=      ['ASTFeatureExtractor']

if TYPE_CHECKING:
		from .configuration_audio_spectrogram_transformer import (
		    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    ASTConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_audio_spectrogram_transformer import (
				    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ASTForAudioClassification,
				    ASTModel,
				    ASTPreTrainedModel,
				)

		try:
				if not is_speech_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
		import sys

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

