


'''simple docstring'''



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


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

					lowerCAmelCase :List[Any]						=   ['''audio''']
					lowerCAmelCase :Optional[int]						=   ['''text''']




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




					def 			snake_case__  ( self							,							_lowerCamelCase):
								return self.model.generate(inputs=_lowerCamelCase)




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



'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__ = 1_0	, UpperCamelCase__ = 2_2   ):
			UpperCAmelCase__					:   List[str]       				=       range(1	, UpperCamelCase__   )
			UpperCAmelCase__					:   int       				=       range(1	, UpperCamelCase__   )
			return sum(
			    1 for power in powers for base in bases if len(str(base**power   )   ) == power   )


if __name__ == "__main__":
		print(f"""{solution(10, 22) = }""")