Open varkeyvincentindia opened 1 month ago
@varkeyvincentindia, thanks for reporting this. This would appear to be onnxruntime
issue. Can you tell us what version do you have:
pip show onnxruntime
The last time we saw similar issues was when Onnx bumped a minor version at around 1.17
.
Another issue might be CoreML
.
How did you come by this error? Did you upgrade to a new configuration, or is this a green field project?
onnxruntime v1.18.1., coremltools v7.2. Yes, this is a green field project.
@tazarov Any update on the fix ?
same issue. macos with intel chip
same, macos, Intel, from under conda (microconda)
same issue. macos with intel chip
@varkeyvincentindia, @oharlem, @nhanngh I did some further digging and it seems that there are cases where CoreML provider for the Onnx Runtime might not be properly supported. To resolve this you can use CPU provider as follows:
from chromadb.utils.embedding_functions.onnx_mini_lm_l6_v2 import ONNXMiniLM_L6_V2 # this is how you import in Chroma 0.5.0+
# from chromadb.utils.embedding_functions import ONNXMiniLM_L6_V2 # legacy import for Chroma <=0.4.24
ef = ONNXMiniLM_L6_V2(preferred_providers=["CPUExecutionProvider"])
import chromadb
client = chromadb.Client()
collection = client.get_or_create_collection("<collection_name>", embedding_function=ef)
collection.upsert(
documents=[
"This is a document about pineapple",
"This is a document about oranges"
],
ids=["id1", "id2"]
)
The above code will create a collection with the default embedding function with the CPU provider.
What happened?
While trying to run a basic script mentioned below I'm seeing an issue.
import chromadb chroma_client = chromadb.Client()
switch
create_collection
toget_or_create_collection
to avoid creating a new collection every timecollection = chroma_client.get_or_create_collection(name="my_collection")
switch
add
toupsert
to avoid adding the same documents every timecollection.upsert( documents=[ "This is a document about pineapple", "This is a document about oranges" ], ids=["id1", "id2"] )
results = collection.query( query_texts=["This is a query document about florida"], # Chroma will embed this for you n_results=2 # how many results to return )
print(results)
Issue: 2024-07-22 21:04:26.098904 [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running CoreML_2809954737722992935_1 node. Name:'CoreMLExecutionProvider_CoreML_2809954737722992935_1_1' Status Message: Error executing model: Error computing NN outputs.
Versions
chroma-hnswlib 0.7.5, chromadb 0.5.4, MAC OS MOnterey (12.7.5), Python: 3.12.4
Relevant log output