






"""simple docstring"""






from ...processing_utils import ProcessorMixin





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							List[str]   			=					"""WhisperFeatureExtractor"""
	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					"""WhisperTokenizer"""


	def __init__(      self  ,					__a  ,					__a						):


					"""simple docstring"""

					super().__init__(__a  ,					__a						)
					A__							 =       self.feature_extractor
					A__							 =       False


	def       _UpperCAmelCase						(      self  ,					__a=None  ,					__a=None  ,					__a=True						):


					"""simple docstring"""

					return self.tokenizer.get_decoder_prompt_ids(task=__a  ,					language=__a  ,					no_timestamps=__a						)


	def __call__(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					if self._in_target_context_manager:
									return self.current_processor(*__a  ,					**__a						)

					A__							 =       kwargs.pop('audio'  ,					__a						)
					A__							 =       kwargs.pop('sampling_rate'  ,					__a						)
					A__							 =       kwargs.pop('text'  ,					__a						)
					if len(__a						) > 0:
									A__							 =       args[0]
									A__							 =       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:
									A__							 =       self.feature_extractor(__a  ,					*__a  ,					sampling_rate=__a  ,					**__a						)
					if text is not None:
									A__							 =       self.tokenizer(__a  ,					**__a						)

					if text is None:
									return inputs

					elif audio is None:
									return encodings
					else:
									A__							 =       encodings['input_ids']
									return inputs


	def       _UpperCAmelCase						(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					return self.tokenizer.batch_decode(*__a  ,					**__a						)


	def       _UpperCAmelCase						(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					return self.tokenizer.decode(*__a  ,					**__a						)






	def       _UpperCAmelCase						(      self  ,					__a  ,					__a="np"						):


					"""simple docstring"""

					return self.tokenizer.get_prompt_ids(__a  ,					return_tensors=__a						)












"""simple docstring"""






from ...processing_utils import ProcessorMixin





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							List[str]   			=					"""WhisperFeatureExtractor"""
	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					"""WhisperTokenizer"""


	def __init__(      self  ,					__a  ,					__a						):


					"""simple docstring"""

					super().__init__(__a  ,					__a						)
					A__							 =       self.feature_extractor
					A__							 =       False


	def       _UpperCAmelCase						(      self  ,					__a=None  ,					__a=None  ,					__a=True						):


					"""simple docstring"""

					return self.tokenizer.get_decoder_prompt_ids(task=__a  ,					language=__a  ,					no_timestamps=__a						)


	def __call__(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					if self._in_target_context_manager:
									return self.current_processor(*__a  ,					**__a						)

					A__							 =       kwargs.pop('audio'  ,					__a						)
					A__							 =       kwargs.pop('sampling_rate'  ,					__a						)
					A__							 =       kwargs.pop('text'  ,					__a						)
					if len(__a						) > 0:
									A__							 =       args[0]
									A__							 =       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:
									A__							 =       self.feature_extractor(__a  ,					*__a  ,					sampling_rate=__a  ,					**__a						)
					if text is not None:
									A__							 =       self.tokenizer(__a  ,					**__a						)

					if text is None:
									return inputs

					elif audio is None:
									return encodings
					else:
									A__							 =       encodings['input_ids']
									return inputs


	def       _UpperCAmelCase						(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					return self.tokenizer.batch_decode(*__a  ,					**__a						)


	def       _UpperCAmelCase						(      self  ,					*__a  ,					**__a						):


					"""simple docstring"""

					return self.tokenizer.decode(*__a  ,					**__a						)






	def       _UpperCAmelCase						(      self  ,					__a  ,					__a="np"						):


					"""simple docstring"""

					return self.tokenizer.get_prompt_ids(__a  ,					return_tensors=__a						)


