



"""simple docstring"""
from ...processing_utils import ProcessorMixin


class    SCREAMING_SNAKE_CASE__ (							_UpperCAmelCase   ):
    lowercase__      =   '''WhisperFeatureExtractor'''
    lowercase__      =   '''WhisperTokenizer'''

    def __init__(				self			:				List[Any] ,  lowerCAmelCase_			:				int ,  lowerCAmelCase_			:				Dict):







      """simple docstring"""







      super().__init__(A_ ,  A_)
      lowercase_								= self.feature_extractor
      lowercase_								= False

    def 					_UpperCAmelCase	(				self			:				Any ,  lowerCAmelCase_			:				Union[str, Any]=None ,  lowerCAmelCase_			:				Optional[int]=None ,  lowerCAmelCase_			:				str=True):







      """simple docstring"""







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

    def __call__(				self			:				Optional[int] ,  *lowerCAmelCase_			:				List[Any] ,  **lowerCAmelCase_			:				List[str]):







      """simple docstring"""







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

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

      if text is None:
        return inputs

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

    def 					_UpperCAmelCase	(				self			:				str ,  *lowerCAmelCase_			:				List[str] ,  **lowerCAmelCase_			:				Any):







      """simple docstring"""







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

    def 					_UpperCAmelCase	(				self			:				Tuple ,  *lowerCAmelCase_			:				str ,  **lowerCAmelCase_			:				Optional[int]):







      """simple docstring"""







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




    def 					_UpperCAmelCase	(				self			:				Optional[int] ,  lowerCAmelCase_			:				str ,  lowerCAmelCase_			:				Union[str, Any]="np"):







      """simple docstring"""







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






"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase						:		Optional[Any]			= {"configuration_wavlm": ["WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "WavLMConfig"]}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase						:		str			= [
           "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						:		Optional[Any]			= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

