[ 
https://issues.apache.org/jira/browse/NIFI-13628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann resolved NIFI-13628.
-------------------------------------
    Resolution: Fixed

> Using NumPy 2.0 breaks ChromaDB processors
> ------------------------------------------
>
>                 Key: NIFI-13628
>                 URL: https://issues.apache.org/jira/browse/NIFI-13628
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Zsihovszki Krisztina
>            Assignee: Zsihovszki Krisztina
>            Priority: Major
>             Fix For: python-extensions-2.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> PutChroma processor did not start due to the following error:
> {code:java}
> File "/opt/nifi/nifi-current/python/extensions/vectorstores/ChromaUtils.py", 
> line 125, in create_client
> import chromadb
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/chromadb/{}init{}.py",
>  line 3, in <module>
> from chromadb.api.client import Client as ClientCreator
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/chromadb/api/{}init{}.py",
>  line 7, in <module>
> from chromadb.api.models.Collection import Collection
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/chromadb/api/models/Collection.py",
>  line 7, in <module>
> import chromadb.utils.embedding_functions as ef
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/chromadb/utils/embedding_functions.py",
>  line 6, in <module>
> from chromadb.api.types import (
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/chromadb/api/types.py",
>  line 101, in <module>
> ImageDType = Union[np.uint, np.int_, np.float_]
> File 
> "/opt/nifi/nifi-current/./work/python/extensions/PutChroma/2.0.0.x.y.z/numpy/{}init{}.py",
>  line 397, in _getattr_
> raise AttributeError(
> AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use 
> `np.float64` instead.{code}
> The error is related to NumPy 2.0 and chromadb incompatibility: 
> [https://github.com/vanna-ai/vanna/discussions/501]
> The ChromaDB lib requires NumPy version greater than 1.22.5. Since NumPy 2.0 
> was released (Jun 2024), sometimes PutChroma processors pick NumPy 2.0 
> version and fail due to the "np.float_" issue.
> This issue can not be always reproduced. In most of the cases the 
> numpy-1.26.4 is used (which version is fixed for ParseDocument.py) but there 
> are cases when the 2.0 version is used.
> The recommended solution for NumPy 2.0 incompatibility is to force using 
> NumPy 1.26.4.
>  
> Note: I haven't found this issue fixed in any available chromadb lib version 
> yet. https://github.com/chroma-core/chroma/releases



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to