-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add a model cache to avoid running out of storage #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done in the shell, impressive.
Given this isn't based on size of cache, instead a number, do we have an estimate of how many GB 4 could be - it seems a little on the low side?
Will you have a seperate method to append to the CACHE_FILE, we will want to make sure this file doesn't contain duplicate models too.
sync.sh
Outdated
echo "Deleting $removed_lines from cache" | ||
fi | ||
|
||
# Ensure only the last 5 items are retained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, "5" should be N given its base don env var.
If the model is already in the file the grep command removes it and then we append the model name to the bottom of the file. That way the file is always ordered from least to most recently used. When we remove lines off the top an delete those directories those are the least recently used models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magdyksaleh LGTM. Please feel free to land when you're ready.
No description provided.