chroma icon indicating copy to clipboard operation
chroma copied to clipboard

fixes: slow listing of collections, pass an optional embedding_function

Open blob42 opened this issue 2 years ago • 1 comments

  • avoids unecessary fallback to the default embedding function

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • pass an optional embedding_function to list_collections to avoid the slow fallback to default embeddings.

Test plan

  • Before this fix, listing collections is slow even when using other embedding functions like OpenAI's one.
  • With this fix, if the embedding function is passed, listing collections is instant.

blob42 avatar Apr 28 '23 09:04 blob42

Is it bad practice to store the API Key (for an embedding function) in the database?

naynaly10 avatar Apr 29 '23 17:04 naynaly10

@jeffchuber Do you think this can be reviewed/merged ? it would greatly improve the speed of listing collections and does not break the original signature.

blob42 avatar May 09 '23 10:05 blob42

@HammadB was this addressed in another way?

jeffchuber avatar May 10 '23 14:05 jeffchuber

We need to rethink this from first principles. One stop-gap may be to change list_collections send back a list of strings.

jeffchuber avatar May 11 '23 17:05 jeffchuber