





"""simple docstring"""



from ...processing_utils import ProcessorMixin






class 		__snake_case (		SCREAMING_SNAKE_CASE__					):





 """simple docstring"""


 _lowerCamelCase				=					"""WhisperFeatureExtractor"""
 _lowerCamelCase				=					"""WhisperTokenizer"""

 def __init__(   self ,						__lowerCamelCase ,						__lowerCamelCase  ):



     '''simple docstring'''




     super().__init__(__lowerCamelCase ,						__lowerCamelCase  )
     __A   :						Dict									=					self.feature_extractor
     __A   :						Dict									=					False

 def  UpperCamelCase__(   self ,						__lowerCamelCase=None ,						__lowerCamelCase=None ,						__lowerCamelCase=True  ):



     '''simple docstring'''




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

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



     '''simple docstring'''




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

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

     if text is None:
         return inputs

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

 def  UpperCamelCase__(   self ,						*__lowerCamelCase ,						**__lowerCamelCase  ):



     '''simple docstring'''




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

 def  UpperCamelCase__(   self ,						*__lowerCamelCase ,						**__lowerCamelCase  ):



     '''simple docstring'''




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







 def  UpperCamelCase__(   self ,						__lowerCamelCase ,						__lowerCamelCase="np"  ):



     '''simple docstring'''




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











"""simple docstring"""



from typing import TYPE_CHECKING

from ....utils import _LazyModule


a_			=      {"""tokenization_tapex""": ["""TapexTokenizer"""]}


if TYPE_CHECKING:
       from .tokenization_tapex import TapexTokenizer


else:
       import sys

       a_			=      _LazyModule(__name__, globals()["""__file__"""], _import_structure)




