avidale / compress-fasttext

Tools for shrinking fastText models (in gensim format)
MIT License
169 stars 13 forks source link

Incompatability with Numpy >1.19.* #23

Closed alihashaam closed 5 months ago

alihashaam commented 6 months ago

While compressing the models, I get following error because of usage of numpy.float in pq_encoder_light.py:

AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

michelecafagna26 commented 6 months ago

Added this pull request https://github.com/avidale/compress-fasttext/pull/24 to fix this issue.

In the meantime you can use this fork: https://github.com/michelecafagna26/compress-fasttext

avidale commented 5 months ago

Finally merged it and updated the package on PyPI. Thanks @alihashaam for raising the issue and @michelecafagna26 for fixing it!