-
Notifications
You must be signed in to change notification settings - Fork 20
Description
With numpy 1.26.4 and python 3.11, things work fine.
With numpy 2.1.3 and python 3.11, I get a crash:
Successfully installed numpy-2.1.3
(hf) [jlquinn@cccxc520 fms-dgt-internal]$ python
Python 3.11.0 (main, Mar 1 2023, 18:26:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from ftlangdetect import detect
detect('hi there')
Traceback (most recent call last):
File "", line 1, in
File "/dccstor/jlquinn01/miniforge3/envs/hf/lib/python3.11/site-packages/ftlangdetect/detect.py", line 45, in detect
labels, scores = model.predict(text)
^^^^^^^^^^^^^^^^^^^
File "/dccstor/jlquinn01/miniforge3/envs/hf/lib/python3.11/site-packages/fasttext/FastText.py", line 239, in predict
return labels, np.array(probs, copy=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Unable to avoid copy while creating an array as requested.
If usingnp.array(obj, copy=False)replace it withnp.asarray(obj)to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.