



from ...processing_utils import ProcessorMixin


class       a							(			__lowerCamelCase				):
		__lowerCAmelCase	:    int											=					"""WhisperFeatureExtractor"""
		__lowerCAmelCase	:    Optional[int]											=					"""WhisperTokenizer"""



		def __init__(     self     :Dict   ,__lowercase     :Dict   ,__lowercase     :Tuple  ):
						super().__init__(__lowercase   ,__lowercase  )
						snake_case__	:      List[str]     		=	self.feature_extractor
						snake_case__	:      Optional[Any]     		=	False



		def 	__lowerCamelCase			(     self     :Any   ,__lowercase     :Any=None   ,__lowercase     :Any=None   ,__lowercase     :int=True  ):
						return self.tokenizer.get_decoder_prompt_ids(task=__lowercase   ,language=__lowercase   ,no_timestamps=__lowercase  )



		def __call__(     self     :List[str]   ,*__lowercase     :int   ,**__lowercase     :Optional[int]  ):
						# For backward compatibility
						if self._in_target_context_manager:
										return self.current_processor(*__lowercase   ,**__lowercase  )

						snake_case__	:      Dict     		=	kwargs.pop('''audio'''   ,__lowercase  )
						snake_case__	:      Tuple     		=	kwargs.pop('''sampling_rate'''   ,__lowercase  )
						snake_case__	:      Union[str, Any]     		=	kwargs.pop('''text'''   ,__lowercase  )
						if len(__lowercase  ) > 0:
										snake_case__	:      Any     		=	args[0]
										snake_case__	:      List[Any]     		=	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:
										snake_case__	:      str     		=	self.feature_extractor(__lowercase   ,*__lowercase   ,sampling_rate=__lowercase   ,**__lowercase  )
						if text is not None:
										snake_case__	:      List[str]     		=	self.tokenizer(__lowercase   ,**__lowercase  )

						if text is None:
										return inputs

						elif audio is None:
										return encodings
						else:
										snake_case__	:      Optional[Any]     		=	encodings['''input_ids''']
										return inputs



		def 	__lowerCamelCase			(     self     :Dict   ,*__lowercase     :str   ,**__lowercase     :int  ):
						return self.tokenizer.batch_decode(*__lowercase   ,**__lowercase  )



		def 	__lowerCamelCase			(     self     :Optional[int]   ,*__lowercase     :str   ,**__lowercase     :Tuple  ):
						return self.tokenizer.decode(*__lowercase   ,**__lowercase  )






		def 	__lowerCamelCase			(     self     :Optional[Any]   ,__lowercase     :str   ,__lowercase     :Optional[Any]="np"  ):
						return self.tokenizer.get_prompt_ids(__lowercase   ,return_tensors=__lowercase  )






from typing import TYPE_CHECKING

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


A__								=						{
    '''configuration_ctrl''': ['''CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''CTRLConfig'''],
    '''tokenization_ctrl''': ['''CTRLTokenizer'''],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A__								=						[
				    '''CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''CTRLForSequenceClassification''',
				    '''CTRLLMHeadModel''',
				    '''CTRLModel''',
				    '''CTRLPreTrainedModel''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A__								=						[
				    '''TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFCTRLForSequenceClassification''',
				    '''TFCTRLLMHeadModel''',
				    '''TFCTRLModel''',
				    '''TFCTRLPreTrainedModel''',
				]


if TYPE_CHECKING:
				from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
				from .tokenization_ctrl import CTRLTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_ctrl import (
								    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
								    CTRLForSequenceClassification,
								    CTRLLMHeadModel,
								    CTRLModel,
								    CTRLPreTrainedModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_ctrl import (
								    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFCTRLForSequenceClassification,
								    TFCTRLLMHeadModel,
								    TFCTRLModel,
								    TFCTRLPreTrainedModel,
								)

else:
				import sys

				A__								=						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

