[Fix] Fix CLI option for results persistence (#1920)

* fix

* fix

* fix
This commit is contained in:
Myhs_phz 2025-03-07 18:24:30 +08:00 committed by GitHub
parent 277d7946f5
commit 570c30cf1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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,