MCPcopy Create free account
hub / github.com/InternScience/SciReason / summarize

Method summarize

opencompass/summarizers/default.py:376–403  ·  view source on GitHub ↗
(
        self,
        output_path: str = None,
        time_str: str = datetime.now().strftime('%Y%m%d_%H%M%S'))

Source from the content-addressed store, hash-verified

374 self.logger.info(f'write markdown summary to {osp.abspath(output_md_path)}')
375
376 def summarize(
377 self,
378 output_path: str = None,
379 time_str: str = datetime.now().strftime('%Y%m%d_%H%M%S')): # noqa
380
381 # pick up results
382 raw_results, parsed_results, dataset_metrics, dataset_eval_mode = self._pick_up_results()
383
384 # calculate group metrics
385 raw_results, parsed_results, dataset_metrics, dataset_eval_mode = \
386 self._calculate_group_metrics(raw_results, parsed_results, dataset_metrics, dataset_eval_mode)
387
388 # format table
389 table = self._format_table(parsed_results, dataset_metrics, dataset_eval_mode, required_dataset_abbrs=self.dataset_abbrs)
390
391 # format raw txt
392 raw_txts = self._format_raw_txt(raw_results)
393
394 # output to screen
395 print(tabulate.tabulate(table, headers='firstrow', floatfmt='.2f'))
396
397 # output to .text / .csv files
398 self._output_to_file(output_path, time_str, table, raw_txts)
399
400 if self.lark_reporter:
401 content = f'{getpass.getuser()} 的'
402 content += f'详细评测汇总已输出至 {osp.abspath(output_path)}'
403 self.lark_reporter.post(content)

Callers

nothing calls this directly

Calls 6

_pick_up_resultsMethod · 0.95
_format_tableMethod · 0.95
_format_raw_txtMethod · 0.95
_output_to_fileMethod · 0.95
postMethod · 0.80

Tested by

no test coverage detected