Skip to content

Commit

Permalink
support xxxevaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghonglie committed Sep 19, 2022
1 parent fe2cd4a commit 4dc2e44
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,17 @@ def main():
dump_metric = dict(type='DumpResults', out_file_path=args.dump)
if isinstance(cfg.test_evaluator, (list, tuple)):
cfg.test_evaluator = list(cfg.test_evaluator).append(dump_metric)
else:
cfg.test_evaluator = [cfg.test_evaluator, dump_metric]
elif isinstance(cfg.test_evaluator, dict):
if 'metric' in cfg.test_evaluator:
if isinstance(cfg.test_evaluator.metric, (list, tuple)):
cfg.test_evaluator.metric = list(
cfg.test_evaluator.metric).append(dump_metric)
else:
cfg.test_evaluator.metric = [
cfg.test_evaluator.metric, dump_metric
]
else:
cfg.test_evaluator = [cfg.test_evaluator, dump_metric]

# build the runner from config
if 'runner_type' not in cfg:
Expand Down

0 comments on commit 4dc2e44

Please sign in to comment.