From 35fe30272b3764651e707e53ec107b1fc7f0ac88 Mon Sep 17 00:00:00 2001 From: mehrad Date: Fri, 1 Mar 2019 15:08:31 -0800 Subject: [PATCH] satisfy travis --- models/multitask_question_answering_network.py | 2 +- text/torchtext/datasets/generic.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/models/multitask_question_answering_network.py b/models/multitask_question_answering_network.py index 2ff3ad0e..7a93160d 100644 --- a/models/multitask_question_answering_network.py +++ b/models/multitask_question_answering_network.py @@ -169,7 +169,7 @@ class MultitaskQuestionAnsweringNetwork(nn.Module): batch_size = targets.size(0) reference_lengths = [l-1 for l in answer_lengths] translation_len = max(reference_lengths) - translation_lengths = torch.Tensor([translation_len] * batch_size, device=self.device) + translation_lengths = torch.tensor([translation_len] * batch_size, device=self.device) bleu_loss_smoothed = expectedMultiBleu.bleu(probs, targets, translation_lengths, reference_lengths, max_order=max_order, smooth=True) loss = -1 * bleu_loss_smoothed[0] diff --git a/text/torchtext/datasets/generic.py b/text/torchtext/datasets/generic.py index 630a423b..79fea371 100644 --- a/text/torchtext/datasets/generic.py +++ b/text/torchtext/datasets/generic.py @@ -613,6 +613,7 @@ class WikiSQL(CQA, data.Dataset): lower=False, numerical=True, eos_token=field.eos_token, init_token=field.init_token) fields.append(('wikisql_id', FIELD)) + cached_path = kwargs.pop('cached_path') cache_name = os.path.join(cached_path, os.path.dirname(path).strip("/"), '.cache', 'query_as_question' if query_as_question else 'query_as_context', os.path.basename(path), str(subsample)) skip_cache_bool = kwargs.pop('skip_cache_bool') if os.path.exists(cache_name) and not skip_cache_bool: