Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Attritube Error due to NumPy2.0. release. #2418

Open
startakovsky opened this issue Jun 25, 2024 · 4 comments · May be fixed by #2419
Open

[Bug]: Attritube Error due to NumPy2.0. release. #2418

startakovsky opened this issue Jun 25, 2024 · 4 comments · May be fixed by #2419
Labels
bug Something isn't working

Comments

@startakovsky
Copy link

What happened?

This issue occurs when import chromadb and having NumPy 2.0 installed.

Related issue: #2407

AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.. Did you mean: 'float16'?
>>> np.float16
<class 'numpy.float16'>

Versions

Chromadb 0.5.2

Relevant log output

No response

@startakovsky startakovsky added the bug Something isn't working label Jun 25, 2024
@Prashantsaini25
Copy link

from llama_index.vector_stores.chroma import ChromaVectorStore still have same issue
AttributeError: np.float_ was removed in the NumPy 2.0 release. Use np.float64 instead.

Traceback:
File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in run_script
exec(code, module.dict)
File "/app/streamlit_app.py", line 10, in
from llama_index.vector_stores.chroma import ChromaVectorStore
File "/usr/local/lib/python3.10/dist-packages/llama_index/vector_stores/chroma/init.py", line 1, in
from llama_index.vector_stores.chroma.base import ChromaVectorStore
File "/usr/local/lib/python3.10/dist-packages/llama_index/vector_stores/chroma/base.py", line 7, in
import chromadb
File "/usr/local/lib/python3.10/dist-packages/chromadb/init.py", line 3, in
from chromadb.api.client import Client as ClientCreator
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/init.py", line 7, in
from chromadb.api.models.Collection import Collection
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/models/Collection.py", line 4, in
from chromadb.api.models.CollectionCommon import CollectionCommon
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/models/CollectionCommon.py", line 14, in
import chromadb.utils.embedding_functions as ef
File "/usr/local/lib/python3.10/dist-packages/chromadb/utils/embedding_functions.py", line 7, in
from chromadb.api.types import (
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/types.py", line 104, in
ImageDType = Union[np.uint, np.int
, np.float_]
File "/usr/local/lib/python3.10/dist-packages/numpy/init.py", line 397, in getattr
raise AttributeError(

llama-index-vector-stores-chroma => 0.1.9
chromadb = 0.5.3

@adlternative
Copy link

adlternative commented Jun 26, 2024

Rollback numpy to 1.26.4 work for me.

chromadb (0.4.24)

 conda install numpy=1.26.4

@tazarov
Copy link
Contributor

tazarov commented Jun 27, 2024

@startakovsky, we've made a deliberate choice of pinning the version of numpy we use to <2.0 in the latest Chroma release (0.5.3).

@Prashantsaini25, we'll have a look at llama-index-vector-stores-chroma and we'll bump Chroma version to 0.5.3 there too. I can see that even LlamaIndex have not yet adopted numpy2 https://github.com/run-llama/llama_index/blob/663e1700f58c2414e549b9f5005abe87a275dd77/llama-index-core/pyproject.toml#L56

@metal3d
Copy link

metal3d commented Jul 2, 2024

It blocks many things so.

I want to use llama_cpp_python and chromadb. Using the Vulkan backend, it seems that numpy 2.x is required. Using up to date numpy version could save our days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants