





# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ..models.whisper import WhisperForConditionalGeneration, WhisperProcessor
from .base import PipelineTool





class 						_A(					snake_case__   ):


				"""simple docstring"""


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

				UpperCamelCase    :  Optional[Any]					    =	['''audio''']
				UpperCamelCase    :  Optional[Any]					    =	['''text''']



				def 					UpperCAmelCase_		(			self     ,					_A     ):
									return self.pre_processor(_A     ,					return_tensors='pt'     ).input_features



				def 					UpperCAmelCase_		(			self     ,					_A     ):
									return self.model.generate(inputs=_A     )





				def 					UpperCAmelCase_		(			self     ,					_A     ):
									return self.pre_processor.batch_decode(_A     ,					skip_special_tokens=_A     )[0]











from __future__ import annotations







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a  )      ->      float:
					if days_between_payments <= 0:
										raise ValueError('days_between_payments must be > 0'  )
					if daily_interest_rate < 0:
										raise ValueError('daily_interest_rate must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )
					return principal * daily_interest_rate * days_between_payments







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a					,						)      ->      float:
					if number_of_compounding_periods <= 0:
										raise ValueError('number_of_compounding_periods must be > 0'  )
					if nominal_annual_interest_rate_percentage < 0:
										raise ValueError('nominal_annual_interest_rate_percentage must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )

					return principal * (
					    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
					    - 1
					)







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a					,						)      ->      float:
					if number_of_years <= 0:
										raise ValueError('number_of_years must be > 0'  )
					if nominal_annual_percentage_rate < 0:
										raise ValueError('nominal_annual_percentage_rate must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )

					return compound_interest(
					    a					,						nominal_annual_percentage_rate / 3_65					,						number_of_years * 3_65  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()




