





"""simple docstring"""





from ..models.whisper import WhisperForConditionalGeneration, WhisperProcessor
from .base import PipelineTool




class 							snake_case							(			__UpperCAmelCase ):

      '''simple docstring'''



      _A     :       str         =       "openai/whisper-base"
      _A     :       List[str]         =       (
          "This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the "
          "transcribed text."
      )
      _A     :       str         =       "transcriber"
      _A     :       Optional[Any]         =       WhisperProcessor
      _A     :       str         =       WhisperForConditionalGeneration

      _A     :       Optional[int]         =       ["audio"]
      _A     :       List[Any]         =       ["text"]

      def       A_					(							self       :      Union[str, Any]						,				__lowercase       :      List[str] ):


        '''simple docstring'''




        return self.pre_processor(UpperCamelCase__						,				return_tensors='''pt''' ).input_features

      def       A_					(							self       :      Tuple						,				__lowercase       :      Tuple ):


        '''simple docstring'''




        return self.model.generate(inputs=UpperCamelCase__ )







      def       A_					(							self       :      Union[str, Any]						,				__lowercase       :      List[str] ):


        '''simple docstring'''




        return self.pre_processor.batch_decode(UpperCamelCase__						,				skip_special_tokens=UpperCamelCase__ )[0]






"""simple docstring"""





def       lowerCamelCase_       (   UpperCAmelCase_  ,			UpperCAmelCase_  )						->bool:





  """simple docstring"""


  return numa ^ numa < 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()