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

Add a model cache to avoid running out of storage #201

Merged
merged 7 commits into from
Jan 23, 2024

Conversation

magdyksaleh
Copy link
Collaborator

No description provided.

Copy link
Contributor

@brightsparc brightsparc left a 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
Copy link
Contributor

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.

@magdyksaleh
Copy link
Collaborator Author

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.

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.

Copy link
Contributor

@tgaddair tgaddair left a 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.

@magdyksaleh magdyksaleh merged commit f05f3cb into main Jan 23, 2024
@magdyksaleh magdyksaleh deleted the weight-cache-cleanup branch January 23, 2024 19:31
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.

None yet

3 participants