Closed david-waterworth closed 2 years ago
Also this code calls the LanguageModel
delete_softmax
method - but the forward method of LanguageModel
attempts to compute the loss anyway and crashes.
An easy fix seems to be to surround the majority of the forward
with a test for self._softmax_loss is not None
But in general it appears this code doesn't work any more?
Hey @david-waterworth, I think both of your suggestions sound right. Care to make a PR?
This issue is being closed due to lack of activity. If you think it still needs to be addressed, please comment on this thread 👇
I've been adapting the model described by Louis Qin PyTorch ELMo, trained from scratch but I'n having issues creating a
BidirectionalLanguageModelTokenEmbedder
from the pretrained model. ie.fails, it complains that Embeddings require either a size or a vocabulary. I traced it to the way the
BidirectionalLanguageModelTokenEmbedder
attempts to construct a new TextFieldEmbedder from the model params without a vocabularyI think the last line should be