"""simple docstring"""



from ...processing_utils import ProcessorMixin






class 	__lowerCAmelCase					(      _snake_case):




    '''simple docstring'''






    __magic_name__   :			Dict       		=       """WhisperFeatureExtractor"""
    __magic_name__   :			Dict       		=       """WhisperTokenizer"""





    def __init__(     self				:	Optional[Any]					,				UpperCamelCase__				:	Any					,				UpperCamelCase__				:	List[Any]							):
          super().__init__(__snake_case					,				__snake_case							)
          A__	:      Tuple      =self.feature_extractor
          A__	:      Any      =False





    def 					_UpperCAmelCase		(     self				:	List[Any]					,				UpperCamelCase__				:	List[str]=None					,				UpperCamelCase__				:	List[Any]=None					,				UpperCamelCase__				:	str=True							):
          return self.tokenizer.get_decoder_prompt_ids(task=__snake_case					,				language=__snake_case					,				no_timestamps=__snake_case							)





    def __call__(     self				:	str					,				*UpperCamelCase__				:	int					,				**UpperCamelCase__				:	Dict							):
          # For backward compatibility
          if self._in_target_context_manager:
                return self.current_processor(*__snake_case					,				**__snake_case							)

          A__	:      List[Any]      =kwargs.pop("audio"					,				__snake_case							)
          A__	:      List[Any]      =kwargs.pop("sampling_rate"					,				__snake_case							)
          A__	:      Any      =kwargs.pop("text"					,				__snake_case							)
          if len(__snake_case							) > 0:
                A__	:      Union[str, Any]      =args[0]
                A__	:      List[str]      =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__	:      List[Any]      =self.feature_extractor(__snake_case					,				*__snake_case					,				sampling_rate=__snake_case					,				**__snake_case							)
          if text is not None:
                A__	:      Optional[Any]      =self.tokenizer(__snake_case					,				**__snake_case							)

          if text is None:
                return inputs

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





    def 					_UpperCAmelCase		(     self				:	Union[str, Any]					,				*UpperCamelCase__				:	str					,				**UpperCamelCase__				:	str							):
          return self.tokenizer.batch_decode(*__snake_case					,				**__snake_case							)





    def 					_UpperCAmelCase		(     self				:	Optional[Any]					,				*UpperCamelCase__				:	str					,				**UpperCamelCase__				:	Optional[Any]							):
          return self.tokenizer.decode(*__snake_case					,				**__snake_case							)





    def 					_UpperCAmelCase		(     self				:	Union[str, Any]					,				UpperCamelCase__				:	Any					,				UpperCamelCase__				:	List[str]="np"							):
          return self.tokenizer.get_prompt_ids(__snake_case					,				return_tensors=__snake_case							)









'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase_						:  int				  =						{'configuration_wavlm': ['WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'WavLMConfig']}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Tuple				  =						[
				    'WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'WavLMForAudioFrameClassification',
				    'WavLMForCTC',
				    'WavLMForSequenceClassification',
				    'WavLMForXVector',
				    'WavLMModel',
				    'WavLMPreTrainedModel',
				]

if TYPE_CHECKING:
				from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_wavlm import (
								    WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    WavLMForAudioFrameClassification,
								    WavLMForCTC,
								    WavLMForSequenceClassification,
								    WavLMForXVector,
								    WavLMModel,
								    WavLMPreTrainedModel,
								)

else:
				import sys

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




