From 5d6983c4622ece75e7b9f7f05e1114be8f54deb9 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Thu, 23 Sep 2021 15:45:17 -0700 Subject: [PATCH] Batch validate a list of files if model is a text file with model per line --- validate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validate.py b/validate.py index ab5b644f..9b2c0f7e 100755 --- a/validate.py +++ b/validate.py @@ -296,6 +296,11 @@ def main(): model_names = list_models(args.model) model_cfgs = [(n, '') for n in model_names] + if not model_cfgs and os.path.isfile(args.model): + with open(args.model) as f: + model_names = [line.rstrip() for line in f] + model_cfgs = [(n, None) for n in model_names if n] + if len(model_cfgs): results_file = args.results_file or './results-all.csv' _logger.info('Running bulk validation on these pretrained models: {}'.format(', '.join(model_names)))