Skip to content

Fix/cache embeddings filesystem - #722

Merged
drazvan merged 2 commits into
developfrom
fix/cache-embeddings-filesystem
Sep 3, 2024
Merged

Fix/cache embeddings filesystem#722
drazvan merged 2 commits into
developfrom
fix/cache-embeddings-filesystem

Conversation

@Pouyanpi

@Pouyanpi Pouyanpi commented Sep 2, 2024

Copy link
Copy Markdown
Collaborator

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
@Pouyanpi
Pouyanpi requested a review from drazvan September 2, 2024 14:07

@drazvan drazvan left a comment

Copy link
Copy Markdown
Collaborator

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
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