





import json
import sys

def    __UpperCamelCase	(	a    : Optional[int]					,   a    : Optional[Any]     ) ->Optional[Any]:



 with open(lowerCamelCase_					,   encoding='''utf-8'''     ) as f:
  snake_case				=			json.load(lowerCamelCase_     )

 snake_case				=			["""<details>""", """<summary>Show updated benchmarks!</summary>""", """ """]

 for benchmark_name in sorted(lowerCamelCase_     ):
  snake_case				=			results[benchmark_name]

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

  snake_case				=			"""| metric |"""
  snake_case				=			"""|--------|"""
  snake_case				=			"""| new / old (diff) |"""
  for metric_name in sorted(lowerCamelCase_     ):
   snake_case				=			benchmark_res[metric_name]
   snake_case				=			metric_vals["""new"""]
   snake_case				=			metric_vals.get('''old'''					,   lowerCamelCase_     )
   snake_case				=			metric_vals.get('''diff'''					,   lowerCamelCase_     )

   snake_case				=			f""" {new_val:f}""" if isinstance(lowerCamelCase_					,   (int, float)     ) else """None"""

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

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

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

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

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


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

   format_json_to_md(input_json_file, output_md_file)








'''simple docstring'''







from ...processing_utils import ProcessorMixin
class 			_lowercase						(       __a					):
     _UpperCAmelCase										=					'''WhisperFeatureExtractor'''
     _UpperCAmelCase										=					'''WhisperTokenizer'''







     def __init__( self    ,   A__    ,   A__    ) ->	Optional[Any]:
      super().__init__(A__    ,   A__    )
      snake_case				=			self.feature_extractor
      snake_case				=			False







     def     UpperCamelCase			( self    ,   A__=None    ,   A__=None    ,   A__=True    ) ->	Union[str, Any]:
      return self.tokenizer.get_decoder_prompt_ids(task=A__    ,   language=A__    ,   no_timestamps=A__    )







     def __call__( self    ,   *A__    ,   **A__    ) ->	Dict:
      # For backward compatibility
      if self._in_target_context_manager:
       return self.current_processor(*A__    ,   **A__    )

      snake_case				=			kwargs.pop('''audio'''    ,   A__    )
      snake_case				=			kwargs.pop('''sampling_rate'''    ,   A__    )
      snake_case				=			kwargs.pop('''text'''    ,   A__    )
      if len(A__    ) > 0:
       snake_case				=			args[0]
       snake_case				=			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:
       snake_case				=			self.feature_extractor(A__    ,   *A__    ,   sampling_rate=A__    ,   **A__    )
      if text is not None:
       snake_case				=			self.tokenizer(A__    ,   **A__    )

      if text is None:
       return inputs

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







     def     UpperCamelCase			( self    ,   *A__    ,   **A__    ) ->	Optional[Any]:
      return self.tokenizer.batch_decode(*A__    ,   **A__    )







     def     UpperCamelCase			( self    ,   *A__    ,   **A__    ) ->	str:
      return self.tokenizer.decode(*A__    ,   **A__    )







     def     UpperCamelCase			( self    ,   A__    ,   A__="np"    ) ->	Optional[Any]:
      return self.tokenizer.get_prompt_ids(A__    ,   return_tensors=A__    )

