This PR enhances the EmbeddingService by optimizing memory usage during embedding computations, refactoring core logic, and adding unit tests for robustness.
Key Changes:
Dynamic Memory Management:
Automatically estimate and manage RAM usage by saving embeddings to disk when memory limits are reached.
Refactor EmbeddingService:
Extracted core logic into a dedicated method.
Handled ultra-long reads by saving embeddings immediately and preventing additional sequence loading.
Removed SAVE_AFTER_N_EMBEDDINGS.
Unit Testing:
Added tests for computing embeddings on long, short, and mixed sequences.
Validated dynamic memory management and embedding computation accuracy.
Ensured correct result paths and file existence in the tests.
Description:
This PR enhances the
EmbeddingService
by optimizing memory usage during embedding computations, refactoring core logic, and adding unit tests for robustness.Key Changes:
Dynamic Memory Management:
Refactor
EmbeddingService
:SAVE_AFTER_N_EMBEDDINGS
.Unit Testing:
Issue Reference:
Closes [#98]