Bugs and errors
Possible bugs and solutions
Was trying to use this model and found an error in stanza library -- site-packages/stanza/models/pos/model.py file.
86 line or so has code -- self.add_unsaved_module('pretrained_emb', nn.Embedding.from_pretrained(torch.from_numpy(emb_matrix), freeze=True))
But it looks like emb_matrix is already a tensor, so, after changing code to
if type(emb_matrix) == torch.Tensor:
self.add_unsaved_module('pretrained_emb', nn.Embedding.from_pretrained(emb_matrix, freeze=True))
else:
self.add_unsaved_module('pretrained_emb', nn.Embedding.from_pretrained(torch.from_numpy(emb_matrix), freeze=True))
everything started to work.
Maybe, the problem lies in outdated example or in pretrained model. Not sure atm.
versions:
stanza 1.9.2
numpy 2.1.2