From 570c30cf1b38341694215daf812984b4a92961cc Mon Sep 17 00:00:00 2001 From: Myhs_phz Date: Fri, 7 Mar 2025 18:24:30 +0800 Subject: [PATCH] [Fix] Fix CLI option for results persistence (#1920) * fix * fix * fix --- opencompass/cli/main.py | 8 +++++--- opencompass/utils/result_station.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opencompass/cli/main.py b/opencompass/cli/main.py index 4eaa5b9b..a5937033 100644 --- a/opencompass/cli/main.py +++ b/opencompass/cli/main.py @@ -263,9 +263,11 @@ def main(): else: dir_time_str = args.reuse logger.info(f'Reusing experiements from {dir_time_str}') - elif args.mode in ['eval', 'viz']: - raise ValueError('You must specify -r or --reuse when running in eval ' - 'or viz mode!') + elif args.mode in ['eval', 'viz'] and not args.read_from_station: + raise ValueError( + 'You must specify -r or --reuse, or you have to specify ' + '--read-from-station and --station-path when running in eval ' + 'or viz mode!') # update "actual" work_dir cfg['work_dir'] = osp.join(cfg.work_dir, dir_time_str) diff --git a/opencompass/utils/result_station.py b/opencompass/utils/result_station.py index 7ad6b9eb..f1cedd00 100644 --- a/opencompass/utils/result_station.py +++ b/opencompass/utils/result_station.py @@ -210,7 +210,7 @@ def save_to_station(cfg, args): i for i in cfg['judge_models'] if 'judged-by--' + model_abbr_from_cfg(i) == model_abbr_from_cfg(model_pair[1]) - ] + ][0] this_cfg = { 'models': model_cfg,