-
Notifications
You must be signed in to change notification settings - Fork 658
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
feat: add --sort
arg to delete-cache
to sort by size
#2815
Conversation
x-linking #1065 |
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.
Hi @AlpinDale thank you for this very clean PR! I appreciate the code quality and having tests already implemented 🤗 I've left a high-level comment about the CLI interface. I'd prefer something like this:
huggingface-cli delete-cache --sort=size
Let me know what you think !
Thanks for the review, @Wauplin. I've added the requested changes, including the alphabetical, lastUpdated, lastUsed sorting options. Please take a look again. |
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.
Thank you @AlpinDale ! Didn't expect that much but it makes the PR really great! :) I've left some minor comments to address.
Thanks for the re-review, I'll address your comments tonight! |
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.
Thank you @AlpinDale for your contribution, this is a nice feature to have!
I addressed @Wauplin's comments so the PR should be in good shape to be merged 🤗
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Thanks for getting this to the finish line! 🔥
I totally forgot about this PR, sorry! Thank you for finishing it up. 😅 |
Merging! |
This PR adds the
--sort
flag to thedelete-cache
command.This should allow users to sort the repos by size, including all revisions. The default mode is in descending order, but this behaviour can be changed by passing theascending
argument to the flag.The flag takes 4 arguments:
size
,alphabetical
,lastUpdated
, andlastUsed
. Thesize
is currently in descending order.