I'm following the tutorial on torchtext transformers which is published on 1.9 pytorch. However, because I'm working on a Tegra TX2, I am stuck to using torchtext 0.6.0, and not 0.10.0 (which is what I assume the tutorial uses).
Following the tutorial, the following throws an error:
data = [torch.tensor(vocab(tokenizer(item)), dtype=torch.long) for item in raw_text_iter]
return torch.cat(tuple(filter(lambda t: t.numel() > 0, data)))
The error is:
TypeError: 'Vocab' object is not callable
I understand what the error means, what I don't know, is that is the expected return from Vocab in this case?
Looking at the documentation for TorchText 0.6.0 I see that it has:
stoiitosfreqsvectors
Is the example expecting the vectors from Vocab?
EDIT:
I looked up the 0.10.0 documentation and it doesn't have a __call__.