





"""simple docstring"""
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding






class    _UpperCAmelCase  (      lowercase_					):
					UpperCamelCase						=				['''image_processor''', '''tokenizer''']
					UpperCamelCase						=				'''EfficientNetImageProcessor'''
					UpperCamelCase						=				('''BertTokenizer''', '''BertTokenizerFast''')


					def __init__(   self     :Optional[int]	,			__UpperCamelCase     :str	,			__UpperCamelCase     :Any						):
												super().__init__(__UpperCamelCase	,			__UpperCamelCase						)


					def __call__(   self     :str	,			__UpperCamelCase     :Optional[int]=None	,			__UpperCamelCase     :List[Any]=None	,			__UpperCamelCase     :Tuple="max_length"	,			__UpperCamelCase     :List[str]=64	,			__UpperCamelCase     :str=None	,			**__UpperCamelCase     :Optional[int]						):
												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						=    self.tokenizer(
																			    __UpperCamelCase	,			padding=__UpperCamelCase	,			max_length=__UpperCamelCase	,			return_tensors=__UpperCamelCase	,			**__UpperCamelCase						)

												if images is not None:
																			A						=    self.image_processor(__UpperCamelCase	,			return_tensors=__UpperCamelCase	,			**__UpperCamelCase						)

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


					def       lowerCamelCase			(   self     :Any	,			*__UpperCamelCase     :Tuple	,			**__UpperCamelCase     :List[Any]						):
												return self.tokenizer.batch_decode(*__UpperCamelCase	,			**__UpperCamelCase						)


					def       lowerCamelCase			(   self     :Optional[Any]	,			*__UpperCamelCase     :Dict	,			**__UpperCamelCase     :int						):
												return self.tokenizer.decode(*__UpperCamelCase	,			**__UpperCamelCase						)


					@property
					def       lowerCamelCase			(   self     :Tuple						):
												A						=    self.tokenizer.model_input_names
												A						=    self.image_processor.model_input_names
												return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names						)						)









"""simple docstring"""
from typing import TYPE_CHECKING

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


_snake_case	:						Any					=					{
    'configuration_unispeech_sat': ['UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'UniSpeechSatConfig'],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_snake_case	:						str					=					[
		    'UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'UniSpeechSatForAudioFrameClassification',
		    'UniSpeechSatForCTC',
		    'UniSpeechSatForPreTraining',
		    'UniSpeechSatForSequenceClassification',
		    'UniSpeechSatForXVector',
		    'UniSpeechSatModel',
		    'UniSpeechSatPreTrainedModel',
		]

if TYPE_CHECKING:
		from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_unispeech_sat import (
				    UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    UniSpeechSatForAudioFrameClassification,
				    UniSpeechSatForCTC,
				    UniSpeechSatForPreTraining,
				    UniSpeechSatForSequenceClassification,
				    UniSpeechSatForXVector,
				    UniSpeechSatModel,
				    UniSpeechSatPreTrainedModel,
				)

else:
		import sys

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


