


'''simple docstring'''
from ...processing_utils import ProcessorMixin
class      lowercase			(							A__      ):

		"""simple docstring"""

		_a									=       'WhisperFeatureExtractor'
		_a									=       'WhisperTokenizer'




		def __init__(	self					,     UpperCamelCase_					,     UpperCamelCase_							):

							'''simple docstring'''


							super().__init__(UpperCamelCase_					,     UpperCamelCase_							)
							UpperCamelCase__     :str							      =				self.feature_extractor
							UpperCamelCase__     :str							      =				False




		def 					lowerCAmelCase__       (	self					,     UpperCamelCase_=None					,     UpperCamelCase_=None					,     UpperCamelCase_=True							):

							'''simple docstring'''


							return self.tokenizer.get_decoder_prompt_ids(task=UpperCamelCase_					,     language=UpperCamelCase_					,     no_timestamps=UpperCamelCase_							)




		def __call__(	self					,     *UpperCamelCase_					,     **UpperCamelCase_							):

							'''simple docstring'''


							if self._in_target_context_manager:
												return self.current_processor(*UpperCamelCase_					,     **UpperCamelCase_							)

							UpperCamelCase__     :str							      =				kwargs.pop('''audio'''					,     UpperCamelCase_							)
							UpperCamelCase__     :List[str]							      =				kwargs.pop('''sampling_rate'''					,     UpperCamelCase_							)
							UpperCamelCase__     :List[Any]							      =				kwargs.pop('''text'''					,     UpperCamelCase_							)
							if len(UpperCamelCase_							) > 0:
												UpperCamelCase__     :Dict							      =				args[0]
												UpperCamelCase__     :Any							      =				args[1:]

							if audio is None and text is None:
												raise ValueError('''You need to specify either an `audio` or `text` input to process.'''							)

							if audio is not None:
												UpperCamelCase__     :Any							      =				self.feature_extractor(UpperCamelCase_					,     *UpperCamelCase_					,     sampling_rate=UpperCamelCase_					,     **UpperCamelCase_							)
							if text is not None:
												UpperCamelCase__     :Optional[Any]							      =				self.tokenizer(UpperCamelCase_					,     **UpperCamelCase_							)

							if text is None:
												return inputs

							elif audio is None:
												return encodings
							else:
												UpperCamelCase__     :int							      =				encodings['''input_ids''']
												return inputs




		def 					lowerCAmelCase__       (	self					,     *UpperCamelCase_					,     **UpperCamelCase_							):

							'''simple docstring'''


							return self.tokenizer.batch_decode(*UpperCamelCase_					,     **UpperCamelCase_							)




		def 					lowerCAmelCase__       (	self					,     *UpperCamelCase_					,     **UpperCamelCase_							):

							'''simple docstring'''


							return self.tokenizer.decode(*UpperCamelCase_					,     **UpperCamelCase_							)




		def 					lowerCAmelCase__       (	self					,     UpperCamelCase_					,     UpperCamelCase_="np"							):

							'''simple docstring'''


							return self.tokenizer.get_prompt_ids(UpperCamelCase_					,     return_tensors=UpperCamelCase_							)



'''simple docstring'''
import json
import sys


def     a   (    __a				,      __a     )						->			str:



					'''simple docstring'''






					with open(__a				,      encoding='''utf-8'''     ) as f:
										UpperCamelCase__     :List[str]							      =				json.load(__a     )

					UpperCamelCase__     :int							      =				['''<details>''', '''<summary>Show updated benchmarks!</summary>''', ''' ''']

					for benchmark_name in sorted(__a     ):
										UpperCamelCase__     :Optional[Any]							      =				results[benchmark_name]

										UpperCamelCase__     :int							      =				benchmark_name.split('''/'''     )[-1]
										output_md.append(f'''### Benchmark: {benchmark_file_name}'''     )

										UpperCamelCase__     :List[str]							      =				'''| metric |'''
										UpperCamelCase__     :str							      =				'''|--------|'''
										UpperCamelCase__     :Union[str, Any]							      =				'''| new / old (diff) |'''
										for metric_name in sorted(__a     ):
															UpperCamelCase__     :List[Any]							      =				benchmark_res[metric_name]
															UpperCamelCase__     :Optional[int]							      =				metric_vals['''new''']
															UpperCamelCase__     :Any							      =				metric_vals.get('''old'''				,      __a     )
															UpperCamelCase__     :Optional[int]							      =				metric_vals.get('''diff'''				,      __a     )

															UpperCamelCase__     :List[str]							      =				f''' {new_val:f}''' if isinstance(__a				,      (int, float)     ) else '''None'''

															if old_val is not None:
																				val_str += f''' / {old_val:f}''' if isinstance(__a				,      (int, float)     ) else "None"
															if dif_val is not None:
																				val_str += f''' ({dif_val:f})''' if isinstance(__a				,      (int, float)     ) else "None"

															title += " " + metric_name + " |"
															lines += "---|"
															value += val_str + " |"

										output_md += [title, lines, value, " "]

					output_md.append('''</details>'''     )

					with open(__a				,      '''w'''				,      encoding='''utf-8'''     ) as f:
										f.writelines('''\n'''.join(__a     )     )


if __name__ == "__main__":
		__snake_case							   =  sys.argv[1]
		__snake_case							   =  sys.argv[2]

		format_json_to_md(input_json_file, output_md_file)