chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[BUG] Fixes OpenCLIP Embedding Function device issue

Open aakashks opened this issue 10 months ago • 1 comments

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 device in an attribute
    • adds .to(self._device) to the model inputs (in _encode_image() and _encode_text() methods)
  • New functionality
    • None

Test plan

How are these changes tested?

  • [ ] Tests pass locally with pytest for python, yarn test for js, cargo test for 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.

aakashks avatar Dec 29 '24 14:12 aakashks