From 956ea52a5b76865e9f5697985da22abd70ab8abd Mon Sep 17 00:00:00 2001 From: Bryan Marcus McCann Date: Wed, 29 Aug 2018 18:50:42 +0000 Subject: [PATCH] fix cove for backwards compat with old checkpoints --- predict.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/predict.py b/predict.py index 52d6824e..0920ae09 100644 --- a/predict.py +++ b/predict.py @@ -173,9 +173,12 @@ def get_args(): 'transformer_layers', 'rnn_layers', 'transformer_hidden', 'dimension', 'load', 'max_val_context_length', 'val_batch_size', 'transformer_heads', 'max_output_length', 'max_generative_vocab', - 'lower'] + 'lower', 'cove'] for r in retrieve: - setattr(args, r, config[r]) + if r in config: + setattr(args, r, config[r]) + else: + setattr(args, r, None) args.dropout_ratio = 0.0 args.task_to_metric = {'cnn_dailymail': 'avg_rouge',