From ccc4af33736ce4801a751fb2e9717e8f815aa9d0 Mon Sep 17 00:00:00 2001 From: Mark Neumann Date: Wed, 6 Dec 2017 17:31:57 -0800 Subject: [PATCH] fix decode in encoder decoder (#586) --- allennlp/models/encoder_decoders/simple_seq2seq.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/allennlp/models/encoder_decoders/simple_seq2seq.py b/allennlp/models/encoder_decoders/simple_seq2seq.py index 64fa277e177..28b6383c8c1 100644 --- a/allennlp/models/encoder_decoders/simple_seq2seq.py +++ b/allennlp/models/encoder_decoders/simple_seq2seq.py @@ -280,8 +280,6 @@ def decode(self, output_dict: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor predicted_tokens = [self.vocab.get_token_from_index(x, namespace="target_tokens") for x in indices] all_predicted_tokens.append(predicted_tokens) - if len(all_predicted_tokens) == 1: - all_predicted_tokens = all_predicted_tokens[0] # type: ignore output_dict["predicted_tokens"] = all_predicted_tokens return output_dict