


from ...processing_utils import ProcessorMixin






class _lowerCamelCase(						_a   ):
       lowercase_ :	List[Any]     =			"""WhisperFeatureExtractor"""
       lowercase_ :	List[str]     =			"""WhisperTokenizer"""
       def __init__(					self,      lowerCamelCase,      lowerCamelCase)       ->   Dict:




           """simple docstring"""

           super().__init__(lowerCamelCase,      lowerCamelCase)
           _lowercase       :							Dict      		=		self.feature_extractor
           _lowercase       :							int      		=		False
       def 			UpperCamelCase     (					self,      lowerCamelCase=None,      lowerCamelCase=None,      lowerCamelCase=True)       ->   List[str]:




           """simple docstring"""

           return self.tokenizer.get_decoder_prompt_ids(task=lowerCamelCase,      language=lowerCamelCase,      no_timestamps=lowerCamelCase)
       def __call__(					self,      *lowerCamelCase,      **lowerCamelCase)       ->   Dict:




           """simple docstring"""

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

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

           if text is None:
               return inputs

           elif audio is None:
               return encodings
           else:
               _lowercase       :							Union[str, Any]      		=		encodings['input_ids']
               return inputs
       def 			UpperCamelCase     (					self,      *lowerCamelCase,      **lowerCamelCase)       ->   Optional[int]:




           """simple docstring"""

           return self.tokenizer.batch_decode(*lowerCamelCase,      **lowerCamelCase)
       def 			UpperCamelCase     (					self,      *lowerCamelCase,      **lowerCamelCase)       ->   Tuple:




           """simple docstring"""

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




       def 			UpperCamelCase     (					self,      lowerCamelCase,      lowerCamelCase="np")       ->   str:




           """simple docstring"""

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










"""simple docstring"""






import warnings

from ...utils import logging
from .image_processing_segformer import SegformerImageProcessor


UpperCAmelCase_   : Any   			= logging.get_logger(__name__)




class 							lowerCAmelCase__				(			UpperCAmelCase__ ):






      '''simple docstring'''

      def __init__(						self     :  Union[str, Any]						,	*lowercase_     :  List[str]						,	**lowercase_     :  List[str]):




          '''simple docstring'''


          warnings.warn(
              '''The class SegformerFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'''
              ''' Please use SegformerImageProcessor instead.'''						,	lowercase_						,	)
          super().__init__(*lowercase_						,	**lowercase_)


