From d776d9f600c127a0a3e28c85960cf0ea615e8f63 Mon Sep 17 00:00:00 2001 From: Bryan Marcus McCann Date: Thu, 16 Aug 2018 19:51:40 +0000 Subject: [PATCH] fixing build for predict --- predict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/predict.py b/predict.py index 927e6ac0..52d6824e 100644 --- a/predict.py +++ b/predict.py @@ -104,13 +104,13 @@ def run(args, field, val_sets, model): if not os.path.exists(prediction_file_name): with open(prediction_file_name, 'a') as prediction_file: predictions = [] + wikisql_ids = [] for batch_idx, batch in enumerate(it): _, p = model(batch) p = field.reverse(p) for i, pp in enumerate(p): if 'sql' in task: wikisql_id = int(batch.wikisql_id[i]) - wikisql_ids = wikisql_ids if wikisql_ids is not None else [] wikisql_ids.append(wikisql_id) prediction_file.write(pp + '\n') predictions.append(pp)