plasticityai/magnitude

pad_to_length doesn't work when using concatenated Magnitude vectors in call to query()

ParikhKadam opened this issue · 1 comments

Code to reproduce:

from pymagnitude import MagnitudeUtils, Magnitude
size = 384
vecs1 = Magnitude(MagnitudeUtils.download_model('glove/medium/glove.6B.100d'))
vecs2 = Magnitude(MagnitudeUtils.download_model('fasttext/medium/wiki-news-300d-1M-subword'))
vecs = Magnitude(vecs1, vecs2)
sents = [["I", "read", "a", "book"], ["I", "read", "a", "magazine"]]
a = vecs.query(sents, pad_to_length=size, pad_left=False, truncate_left=False)
print(a.shape)

Output:
(2, 4, 400)

I don't need an alternative but I want this to work in my project.. So, please solve it as soon as possible..

Thank you..

Just created a pull request which I think might solve this issue.. Please take a look and update it as soon as possible @AjayP13

#51