



"""simple docstring"""
from ...processing_utils import ProcessorMixin
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     a__									='''WhisperFeatureExtractor'''
     a__									='''WhisperTokenizer'''





     def __init__(					self       ,	A       ,	A		)							->					Optional[Any]:
         super().__init__(A       ,	A		)
         _UpperCAmelCase							:  Optional[Any]											=    self.feature_extractor
         _UpperCAmelCase							:  List[Any]											=    False





     def  __lowerCAmelCase	(					self       ,	A=None       ,	A=None       ,	A=True		)							->					Optional[int]:
         return self.tokenizer.get_decoder_prompt_ids(task=A       ,	language=A       ,	no_timestamps=A		)





     def __call__(					self       ,	*A       ,	**A		)							->					Union[str, Any]:
         # For backward compatibility
         if self._in_target_context_manager:
             return self.current_processor(*A       ,	**A		)

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

         if text is None:
             return inputs

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





     def  __lowerCAmelCase	(					self       ,	*A       ,	**A		)							->					Any:
         return self.tokenizer.batch_decode(*A       ,	**A		)





     def  __lowerCAmelCase	(					self       ,	*A       ,	**A		)							->					Dict:
         return self.tokenizer.decode(*A       ,	**A		)





     def  __lowerCAmelCase	(					self       ,	A       ,	A="np"		)							->					Optional[int]:
         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


_lowerCAmelCase    :int     =					{'configuration_vit_msn': ['VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ViTMSNConfig']}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase    :Any     =					[
      'VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST',
      'ViTMSNModel',
      'ViTMSNForImageClassification',
      'ViTMSNPreTrainedModel',
  ]

if TYPE_CHECKING:
  from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_vit_msn import (
        VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST,
        ViTMSNForImageClassification,
        ViTMSNModel,
        ViTMSNPreTrainedModel,
    )

else:
  import sys

  _lowerCAmelCase    :int     =					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


