From 7846354941ba5e2bb717b056aace93a591d07651 Mon Sep 17 00:00:00 2001 From: jzhou316 <31744226+jzhou316@users.noreply.github.com> Date: Thu, 21 Feb 2019 15:49:09 -0500 Subject: [PATCH] Update inference.py Should be three outputs to unpack from the function self.dictionary.sentences2ids(...) --- src/runners/inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runners/inference.py b/src/runners/inference.py index 0fd2cfa..068ef6b 100644 --- a/src/runners/inference.py +++ b/src/runners/inference.py @@ -99,7 +99,7 @@ def batch_inference(self, sent_batch, desired_lengths): self.model.eval() batch_size = len(sent_batch) - ids, lengths = self.dictionary.sentences2ids( + ids, lengths, _ = self.dictionary.sentences2ids( sent_batch, sos=False, eos=True) ids_batch = self.device(Variable(torch.LongTensor(ids), volatile=True)) hidden = self.device(self.model.encoder.initial_hidden(batch_size))