Skip to content

Commit 93b7d3c

Browse files
committed
[Feature] Support repeat analysis
1 parent 0524d49 commit 93b7d3c

3 files changed

Lines changed: 1107 additions & 0 deletions

File tree

opencompass/cli/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from opencompass.utils import (HeartBeatManager, LarkReporter, get_logger,
1717
pretty_print_config, read_from_station,
1818
save_to_station)
19+
from opencompass.utils.repeat_analysis import analyze_repeat_predictions
1920
from opencompass.utils.run import (fill_eval_cfg, fill_infer_cfg,
2021
get_config_from_arg)
2122

@@ -151,6 +152,10 @@ def parse_args():
151152
help='dump the length of model responses',
152153
action='store_true',
153154
default=False)
155+
parser.add_argument('--analysis-repeat',
156+
help='Analyze repeated predictions in viz stage.',
157+
action='store_true',
158+
default=False)
154159
parser.add_argument(
155160
'--dump-extract-rate',
156161
help='Whether to dump the evaluation details, including the '
@@ -500,6 +505,13 @@ def main():
500505
summarizer = build_from_cfg(summarizer_cfg)
501506
summarizer.summarize(time_str=cfg_time_str)
502507

508+
if args.analysis_repeat:
509+
output_path = analyze_repeat_predictions(
510+
cfg,
511+
time_str=cfg_time_str,
512+
show_progress=True,
513+
print_summary=True)
514+
logger.info(f'write repeat analysis to {osp.abspath(output_path)}')
503515

504516

505517
if __name__ == '__main__':

0 commit comments

Comments
 (0)