'''simple docstring'''



# 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 	UpperCamelCase__(       __UpperCamelCase	):
				__magic_name__    :				Any  		=	"openai/whisper-base"
				__magic_name__    :				int  		=	(
				    "This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the "
				    "transcribed text."
				)
				__magic_name__    :				Union[str, Any]  		=	"transcriber"
				__magic_name__    :				Tuple  		=	WhisperProcessor
				__magic_name__    :				Optional[int]  		=	WhisperForConditionalGeneration

				__magic_name__    :				Union[str, Any]  		=	["audio"]
				__magic_name__    :				Dict  		=	["text"]




				def 					a__(		self      :			Tuple				,   lowerCAmelCase      :			Optional[int]				)->					Tuple:

										"""simple docstring"""




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




				def 					a__(		self      :			List[Any]				,   lowerCAmelCase      :			Union[str, Any]				)->					Tuple:

										"""simple docstring"""




										return self.model.generate(inputs=lowerCAmelCase				)





				def 					a__(		self      :			Optional[Any]				,   lowerCAmelCase      :			Optional[int]				)->					Optional[int]:

										"""simple docstring"""




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









'''simple docstring'''



def 				lowerCamelCase__				(	A       :      int				,       A       :      int					):




						'''simple docstring'''






						while a != 0:
												UpperCAmelCase    ,    UpperCAmelCase					    =     b % a, a
						return b




def 				lowerCamelCase__				(	A       :      int				,       A       :      int					):




						'''simple docstring'''






						if gcd(A				,       A					) != 1:
												UpperCAmelCase					    =     f"""mod inverse of {a!r} and {m!r} does not exist"""
												raise ValueError(A					)
						UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     1, 0, a
						UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     0, 1, m
						while va != 0:
												UpperCAmelCase					    =     ua // va
												UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
						return ua % m





