






"""simple docstring"""






import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Optional[int]   			=					"""MCTCTFeatureExtractor"""
	SCREAMING_SNAKE_CASE_:							Optional[int]   			=					"""AutoTokenizer"""


	def __init__(      self  ,					__a  ,					__a						):


					"""simple docstring"""

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


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


					"""simple docstring"""

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

					if "raw_speech" in kwargs:
									warnings.warn('Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.'						)
									A__							 =       kwargs.pop('raw_speech'						)
					else:
									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"""

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

					A__							 =       kwargs.pop('input_features'  ,					__a						)
					A__							 =       kwargs.pop('labels'  ,					__a						)
					if len(__a						) > 0:
									A__							 =       args[0]
									A__							 =       args[1:]

					if input_features is not None:
									A__							 =       self.feature_extractor.pad(__a  ,					*__a  ,					**__a						)
					if labels is not None:
									A__							 =       self.tokenizer.pad(__a  ,					**__a						)

					if labels is None:
									return input_features
					elif input_features is None:
									return labels
					else:
									A__							 =       labels['input_ids']
									return input_features


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


					"""simple docstring"""

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






	@contextmanager
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					warnings.warn(
					    '`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '
					    'labels by using the argument `text` of the regular `__call__` method (either in the same call as '
					    'your audio inputs, or in a separate call.'						)
					A__							 =       True
					A__							 =       self.tokenizer
					yield
					A__							 =       self.feature_extractor
					A__							 =       False










"""simple docstring"""






from ..utils import DummyObject, requires_backends





class       snake_case_       (    metaclass=_lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							List[str]   			=					["""note_seq"""]


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


					"""simple docstring"""

					requires_backends(self  ,					['note_seq']						)


	@classmethod
	def       _UpperCAmelCase						(      cls  ,					*__a  ,					**__a						):


					"""simple docstring"""

					requires_backends(cls  ,					['note_seq']						)






	@classmethod
	def       _UpperCAmelCase						(      cls  ,					*__a  ,					**__a						):


					"""simple docstring"""

					requires_backends(cls  ,					['note_seq']						)


