






"""simple docstring"""





class       __A		:

					def __init__(			self  :      Union[str, Any]					)			->							str:
											__magic_name__:	Any							=       """"""
											__magic_name__:	Dict							=       """"""
											__magic_name__:	List[Any]							=       []

					def   lowerCamelCase__   (			self  :      Union[str, Any]     ,		__snake_case  :      int     ,		__snake_case  :      int					)			->							int:
											if m == -1:
																	return n + 1
											elif n == -1:
																	return m + 1
											elif self.dp[m][n] > -1:
																	return self.dp[m][n]
											else:
																	if self.worda[m] == self.worda[n]:
																							__magic_name__:	Tuple							=       self.__min_dist_top_down_dp(m - 1     ,		n - 1					)
																	else:
																							__magic_name__:	Any							=       self.__min_dist_top_down_dp(__snake_case     ,		n - 1					)
																							__magic_name__:	int							=       self.__min_dist_top_down_dp(m - 1     ,		__snake_case					)
																							__magic_name__:	Optional[Any]							=       self.__min_dist_top_down_dp(m - 1     ,		n - 1					)
																							__magic_name__:	Union[str, Any]							=       1 + min(__snake_case     ,		__snake_case     ,		__snake_case					)

																	return self.dp[m][n]

					def   lowerCamelCase__   (			self  :      Optional[Any]     ,		__snake_case  :      str     ,		__snake_case  :      str					)			->							int:
											__magic_name__:	List[str]							=       worda
											__magic_name__:	str							=       worda
											__magic_name__:	List[Any]							=       [[-1 for _ in range(len(__snake_case					)					)] for _ in range(len(__snake_case					)					)]

											return self.__min_dist_top_down_dp(len(__snake_case					) - 1     ,		len(__snake_case					) - 1					)






					def   lowerCamelCase__   (			self  :      Dict     ,		__snake_case  :      str     ,		__snake_case  :      str					)			->							int:
											__magic_name__:	int							=       worda
											__magic_name__:	int							=       worda
											__magic_name__:	Dict							=       len(__snake_case					)
											__magic_name__:	Union[str, Any]							=       len(__snake_case					)
											__magic_name__:	List[str]							=       [[0 for _ in range(n + 1					)] for _ in range(m + 1					)]

											for i in range(m + 1					):
																	for j in range(n + 1					):
																							if i == 0:  # first string is empty
																													__magic_name__:	Union[str, Any]							=       j
																							elif j == 0:  # second string is empty
																													__magic_name__:	str							=       i
																							elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																													__magic_name__:	Dict							=       self.dp[i - 1][j - 1]
																							else:
																													__magic_name__:	List[Any]							=       self.dp[i][j - 1]
																													__magic_name__:	List[Any]							=       self.dp[i - 1][j]
																													__magic_name__:	Optional[Any]							=       self.dp[i - 1][j - 1]
																													__magic_name__:	List[str]							=       1 + min(__snake_case     ,		__snake_case     ,		__snake_case					)
											return self.dp[m][n]


if __name__ == "__main__":
							__lowerCamelCase							=  EditDistance()

							print('****************** Testing Edit Distance DP Algorithm ******************')
							print()

							__lowerCamelCase							=  input('Enter the first string: ').strip()
							__lowerCamelCase							=  input('Enter the second string: ').strip()

							print()
							print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
							print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
							print()
							print('*************** End of Testing Edit Distance DP Algorithm ***************')











"""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       __A		(   SCREAMING_SNAKE_CASE_			):
					UpperCAmelCase__								=				"openai/whisper-base"
					UpperCAmelCase__								=				(
					    "This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the "
					    "transcribed text."
					)
					UpperCAmelCase__								=				"transcriber"
					UpperCAmelCase__								=				WhisperProcessor
					UpperCAmelCase__								=				WhisperForConditionalGeneration

					UpperCAmelCase__								=				["audio"]
					UpperCAmelCase__								=				["text"]

					def   lowerCamelCase__   (			self  :      Dict     ,		__snake_case  :      List[str]					)			->							Dict:
											return self.pre_processor(__snake_case     ,		return_tensors="""pt"""					).input_features

					def   lowerCamelCase__   (			self  :      int     ,		__snake_case  :      Union[str, Any]					)			->							List[str]:
											return self.model.generate(inputs=__snake_case					)






					def   lowerCamelCase__   (			self  :      Union[str, Any]     ,		__snake_case  :      List[Any]					)			->							Any:
											return self.pre_processor.batch_decode(__snake_case     ,		skip_special_tokens=__snake_case					)[0]



