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

[bugfix] Fix persisted chromadb vectorstore #1444

Merged

Conversation

timothyasp
Copy link
Contributor

If a persist_directory param was set, chromadb would throw a warning that ""No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction". and would error with a Illegal instruction: 4 error.

This is on a MBP M1 13.2.1, python 3.9.

I'm not entirely sure why that error happened, but when using get_or_create_collection instead of list_collection on our end, the error and warning goes away and chroma works as expected.

Added bonus this is cleaner and likely more efficient. list_collections builds a new Collection instance for each collect, then Chroma would just use the name field to tell if the collection existed.

If a `persist_directory` param was set, chromadb would throw a warning
that ""No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction".
and would error with a `Illegal instruction: 4` error. MBP M1 13.2.1, python 3.9.

I'm not entirely sure why that error happened, but when using `get_or_create_collection`
instead of `list_collection` on our end, the error and warning goes away and
chroma works as expected.

Added bonus this is cleaner and likely more efficient.  `list_collections`
builds a new `Collection` instance for each collect, then `Chroma` would just use the `name` field
to tell if the collection existed.
@hwchase17
Copy link
Contributor

@timothyasp theres been lots of dev on chroma side - is this error still happening with recent versions?

@Taytay
Copy link

Taytay commented Mar 9, 2023

I'm seeing this right now with chromadb==0.3.11 and langchain==0.0.105
So yes, I think it's still happening. And I'm using the persist_directory parameter.

@timothyasp
Copy link
Contributor Author

timothyasp commented Mar 9, 2023 via email

@KMontag42
Copy link

@hwchase17 any chance we can get this merged into a patch release?

@lambda-science
Copy link

tried the fix
looks good to me
looking forward for a merge in a new release please, this issue is annoying

@timothyasp
Copy link
Contributor Author

@hwchase17 can we get this merged? It seems to be impacting a lot of people

@lambda-science
Copy link

In the meantime I forked the original repos and applied the patch (to be up to date with latest commit).
You can switch your langchain by langchain@git+https://github.com/lambda-science/langchain.git in a simple requirements.txt.
Not optimal at all for now, but it does the job

@hwchase17
Copy link
Contributor

merging in! sorry for delay!

@hwchase17 hwchase17 merged commit 01a5719 into langchain-ai:master Mar 10, 2023
@jpiabrantes
Copy link

@hwchase17 I am still getting this error on version 0.0.146

@MelchiSalins
Copy link

@hwchase17 Can confirm this is still an issue in 0.0.161

@DungMinhDao
Copy link

@hwchase17 This issue is still there in 0.0.171

@Rish111
Copy link

Rish111 commented Jun 6, 2023

Do we know if this error has been resolved I am getting an error message as follows: "You must provide embeddings or a function to compute them". How do I patch my current vectorstore chromadb file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants