



'''simple docstring'''



from ...processing_utils import ProcessorMixin
class 	lowerCamelCase_							(					snake_case_			):
						_lowerCAmelCase     :   Optional[int]	     =				'WhisperFeatureExtractor'
						_lowerCAmelCase     :   Optional[Any]	     =				'WhisperTokenizer'







						def __init__(  self   :      Union[str, Any]				,    lowerCAmelCase__   :      Optional[int]				,    lowerCAmelCase__   :      Optional[Any]				):

													"""simple docstring"""
													super().__init__(lowerCAmelCase__				,    lowerCAmelCase__				)
													SCREAMING_SNAKE_CASE					:      List[Any]     					=			self.feature_extractor
													SCREAMING_SNAKE_CASE					:      Optional[Any]     					=			False







						def 					__lowercase    (  self   :      List[Any]				,    lowerCAmelCase__   :      Any=None				,    lowerCAmelCase__   :      str=None				,    lowerCAmelCase__   :      Any=True				):

													"""simple docstring"""
													return self.tokenizer.get_decoder_prompt_ids(task=lowerCAmelCase__				,    language=lowerCAmelCase__				,    no_timestamps=lowerCAmelCase__				)







						def __call__(  self   :      List[Any]				,    *lowerCAmelCase__   :      List[Any]				,    **lowerCAmelCase__   :      Dict				):

													"""simple docstring"""
													# For backward compatibility
													if self._in_target_context_manager:
																				return self.current_processor(*lowerCAmelCase__				,    **lowerCAmelCase__				)

													SCREAMING_SNAKE_CASE					:      str     					=			kwargs.pop('''audio'''				,    lowerCAmelCase__				)
													SCREAMING_SNAKE_CASE					:      Any     					=			kwargs.pop('''sampling_rate'''				,    lowerCAmelCase__				)
													SCREAMING_SNAKE_CASE					:      Tuple     					=			kwargs.pop('''text'''				,    lowerCAmelCase__				)
													if len(lowerCAmelCase__				) > 0:
																				SCREAMING_SNAKE_CASE					:      List[Any]     					=			args[0]
																				SCREAMING_SNAKE_CASE					:      Optional[int]     					=			args[1:]

													if audio is None and text is None:
																				raise ValueError('''You need to specify either an `audio` or `text` input to process.'''				)

													if audio is not None:
																				SCREAMING_SNAKE_CASE					:      Optional[int]     					=			self.feature_extractor(lowerCAmelCase__				,    *lowerCAmelCase__				,    sampling_rate=lowerCAmelCase__				,    **lowerCAmelCase__				)
													if text is not None:
																				SCREAMING_SNAKE_CASE					:      str     					=			self.tokenizer(lowerCAmelCase__				,    **lowerCAmelCase__				)

													if text is None:
																				return inputs

													elif audio is None:
																				return encodings
													else:
																				SCREAMING_SNAKE_CASE					:      Union[str, Any]     					=			encodings['''input_ids''']
																				return inputs







						def 					__lowercase    (  self   :      List[Any]				,    *lowerCAmelCase__   :      Optional[Any]				,    **lowerCAmelCase__   :      Any				):

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







						def 					__lowercase    (  self   :      Union[str, Any]				,    *lowerCAmelCase__   :      Union[str, Any]				,    **lowerCAmelCase__   :      str				):

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







						def 					__lowercase    (  self   :      List[Any]				,    lowerCAmelCase__   :      str				,    lowerCAmelCase__   :      Any="np"				):

													"""simple docstring"""
													return self.tokenizer.get_prompt_ids(lowerCAmelCase__				,    return_tensors=lowerCAmelCase__				)









'''simple docstring'''



from typing import TYPE_CHECKING

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


lowerCAmelCase_     :       Tuple								=						{
    'configuration_tapas': ['TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TapasConfig'],
    'tokenization_tapas': ['TapasTokenizer'],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_     :       Dict								=						[
							    'TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'TapasForMaskedLM',
							    'TapasForQuestionAnswering',
							    'TapasForSequenceClassification',
							    'TapasModel',
							    'TapasPreTrainedModel',
							    'load_tf_weights_in_tapas',
							]
try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_     :       str								=						[
							    'TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'TFTapasForMaskedLM',
							    'TFTapasForQuestionAnswering',
							    'TFTapasForSequenceClassification',
							    'TFTapasModel',
							    'TFTapasPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig
							from .tokenization_tapas import TapasTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tapas import (
														    TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TapasForMaskedLM,
														    TapasForQuestionAnswering,
														    TapasForSequenceClassification,
														    TapasModel,
														    TapasPreTrainedModel,
														    load_tf_weights_in_tapas,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_tapas import (
														    TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFTapasForMaskedLM,
														    TFTapasForQuestionAnswering,
														    TFTapasForSequenceClassification,
														    TFTapasModel,
														    TFTapasPreTrainedModel,
														)


else:
							import sys

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




