chroma
chroma copied to clipboard
Test embedding functions
Description of changes
This PR adds embedding functions to the test suite. This allows us to test the by-document testing flow, throughout the test suite.
It introduces a simple embedding function based on hashing, which ensures unique hashes per-document. This also allows us to test identical documents being added, and likewise identical embeddings.
Along the way we discovered some numerical stability problems, which we address by an adaptive threshold in the ANN accuracy test.
Test plan
These are the tests.
Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?