Skip to content

Lazy-load CLIP language encoder - #301

Open
ruziniuuuuu wants to merge 1 commit into
ARISE-Initiative:masterfrom
ruziniuuuuu:fix/lazy-language-encoder
Open

Lazy-load CLIP language encoder#301
ruziniuuuuu wants to merge 1 commit into
ARISE-Initiative:masterfrom
ruziniuuuuu:fix/lazy-language-encoder

Conversation

@ruziniuuuuu

Copy link
Copy Markdown

Summary

  • defer CLIP model and tokenizer construction until a non-null language embedding is requested
  • cache the initialized encoder for later calls
  • remove unused transformer imports

This keeps non-language dataset imports and training offline and avoids an unnecessary 1.7 GB download.

Closes #300.

Test

pytest -q tests/test_lang_utils.py

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.

Lazy-load CLIP language encoder for non-language datasets

1 participant