






"""simple docstring"""







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





class   UpperCamelCase_ (       a_  ):
  _A       :					Optional[int]				=	'openai/whisper-base'
  _A       :					Any				=	(
      'This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the '
      'transcribed text.'
  )
  _A       :					int				=	'transcriber'
  _A       :					Union[str, Any]				=	WhisperProcessor
  _A       :					Dict				=	WhisperForConditionalGeneration

  _A       :					List[str]				=	['audio']
  _A       :					Dict				=	['text']



  def 		UpperCamelCase_				(      self ,		snake_case__				)			->			int:



         """simple docstring"""





         return self.pre_processor(snake_case__ ,		return_tensors="""pt"""				).input_features



  def 		UpperCamelCase_				(      self ,		snake_case__				)			->			int:



         """simple docstring"""





         return self.model.generate(inputs=snake_case__				)



  def 		UpperCamelCase_				(      self ,		snake_case__				)			->			Optional[Any]:



         """simple docstring"""





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








"""simple docstring"""







import random
from typing import Any






def       _lowerCAmelCase       (      lowerCAmelCase		):







       '''simple docstring'''
       for _ in range(len(lowerCAmelCase		)		):
              UpperCAmelCase	    =			random.randint(0	,      len(lowerCAmelCase		) - 1		)
              UpperCAmelCase	    =			random.randint(0	,      len(lowerCAmelCase		) - 1		)
              UpperCAmelCase    ,       UpperCAmelCase	    =			data[b], data[a]
       return data


if __name__ == "__main__":
 lowerCAmelCase_	:    Tuple            =      [0, 1, 2, 3, 4, 5, 6, 7]
 lowerCAmelCase_	:    List[str]            =      ['''python''', '''says''', '''hello''', '''!''']
 print('''Fisher-Yates Shuffle:''')
 print('''List''', integers, strings)
 print('''FY Shuffle''', fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))
