feat: Add model caching to batch_predict endpoint to eliminate redund…#68
Open
sohampirale wants to merge 3 commits intoruxailab:mainfrom
Open
feat: Add model caching to batch_predict endpoint to eliminate redund…#68sohampirale wants to merge 3 commits intoruxailab:mainfrom
sohampirale wants to merge 3 commits intoruxailab:mainfrom
Conversation
Contributor
|
this accully has a negative impact in saving the models as a pkl file. This will cause many vital problems: |
Author
|
Thanks for pointing out the pickle security issues Addressed pickle security concerns by implementing thread-safe in-memory LRU cache. Replaces file-based caching with dictionary-based caching that automatically manages memory usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements model caching in the
predict_new_data_simplefunction to eliminate redundant model training in the batch_predict endpoint, addressing performance issueFixes : #61 .
Changes Made
{calib_id}_model_x.pkland{calib_id}_model_y.pklnaming conventionPerformance Impact
Files Changed
app/services/gaze_tracker.py: Added caching logic topredict_new_data_simplefunctionTesting
Caching tested
Deployment Note
calib_idmay still be retrained in different processes.