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

Fix/cache embeddings filesystem #722

Merged
merged 2 commits into from
Sep 3, 2024
Merged

Conversation

Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Sep 2, 2024

This PR prevents unnecessary initialization of the cache when it is not enabled, thus avoiding .cache/embeddings creation.

It partially resolves #655

This commit changes the order of cache initialization in the
'cache_embeddings' decorator. Now the cache is initialized after
checking if it's enabled. This prevents unnecessary initialization
of the cache when it's not enabled, thus avoiding potential
errors like .cache/embeddings dir creation
This commit adds two tests for the cache_embeddings decorator in the
EmbeddingsCache class. The first test checks that the cache directory is
created when the cache is enabled. The second test checks that the cache
directory is not created when the cache is disabled. These tests help
ensure that the cache_embeddings decorator behaves as expected.
@Pouyanpi Pouyanpi self-assigned this Sep 2, 2024
Copy link
Collaborator

@drazvan drazvan left a comment

Choose a reason for hiding this comment

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

Nice. Thanks for the tests 👍.

@drazvan drazvan merged commit e07c6c3 into develop Sep 3, 2024
4 checks passed
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.

Disable .cache and .cache/embeddings folder creation
2 participants