Open hughperkins opened 4 years ago
(this is using pytorch 1.4 and python 3.6)
To solve your issue, just modify the code lines in /drqa/reader/vector.py as follows:
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L93
x1_mask = torch.ByteTensor(len(docs), max_length).fill_(1)
-> x1_mask = torch.BoolTensor(len(docs), max_length).fill_(True)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L100
x1_mask[i, :d.size(0)].fill_(0)
-> x1_mask[i, :d.size(0)].fill_(False)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L107
x2_mask = torch.ByteTensor(len(questions), max_length).fill_(1)
-> x2_mask = torch.BoolTensor(len(questions), max_length).fill_(True)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L110
x2_mask[i, :q.size(0)].fill_(0)
-> x2_mask[i, :d.size(0)].fill_(False)
After launching interactive using:
Enter a question using:
Pages and pages of: