chroma
chroma copied to clipboard
[BUG] Fixes OpenCLIP Embedding Function device issue
Description of changes
to calculate the embedding vector on any other device than cpu
currently doesn't work because token and image input tensors are not transferred to the other device (ie. missing .to(device) calls
Summarize the changes made by this PR.
- Improvements & Bug fixes
- stores
devicein an attribute - adds
.to(self._device)to the model inputs (in_encode_image()and_encode_text()methods)
- stores
- New functionality
- None
Test plan
How are these changes tested?
- [ ] Tests pass locally with
pytestfor python,yarn testfor js,cargo testfor rust
Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?
No changes are required as such.