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

Web AI embedder fixes #929

Merged
merged 3 commits into from
Aug 7, 2023
Merged

Web AI embedder fixes #929

merged 3 commits into from
Aug 7, 2023

Conversation

visheratin
Copy link
Contributor

@visheratin visheratin commented Aug 4, 2023

Description of changes

After the recent changes in the Web AI structure, the embedder function became invalid because of different imports and because the browser version of the library is only ESM, as mentioned here.

To fix the issue, I updated the import paths and changed the require statements to import for the browser version of the function.

Important note:

When using the embedded in the browser, you should import chromadb/dist/module because the browser version of Web AI is ESM-only.
For Node.js, you can use regular chromadb import because Node.js version of the library is CJS.

Additionally, because Web AI since recently supports multimodal embeddings, I added building multimodal embeddings using CLIP-base.

Test plan

I tested the changes locally for both browser and Node.js. The built chromadb package if someone wants to test it in their projects, is available here.

Documentation Changes

There likely will be needed changes regarding the multimodal functionality.

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readbility, Modularity, Intuitiveness)

@visheratin visheratin mentioned this pull request Aug 4, 2023
Copy link
Contributor

@jeffchuber jeffchuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great work!! thank you for getting to the bottom of this 🎉

@jeffchuber jeffchuber merged commit 221bdfa into chroma-core:main Aug 7, 2023
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.

2 participants