-
Notifications
You must be signed in to change notification settings - Fork 456
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
[CLI] Command line to delete files on a repo #2235
Comments
Hi @Wauplin :) Is that something I could take as a first contribution ? I see we have two related functions in the |
Hi @OlivierKessler01, thanks for proposing your help on this issue :) Agree with you it makes sense to create a single command. I would maybe call it # delete all
huggingface-cli repo-files <repo_id> delete *
# delete single file
huggingface-cli repo-files <repo_id> delete file.txt
# delete single folder
huggingface-cli repo-files <repo_id> delete folder/
# delete multiple
huggingface-cli repo-files <repo_id> delete file.txt folder/ file2.txt
# delete multiple patterns
huggingface-cli repo-files <repo_id> delete file.txt *.json folder/*.parquet
# delete from different revision / repo-type
huggingface-cli repo-files <repo_id> delete file.txt --revision=... --repo-type=dataset What do you think? EDIT: updated the snippet above with new format based on offline discussion with @julien-c |
Hi @Wauplin thank you for the thorough answer :) I'll be working on this next week. |
Thanks! Let me know if you have any question 🤗 |
Thanks for the PR @OlivierKessler01! I'm notified on every new PR/issue so it's fine. I took some time off, hence the delay to review it :) I just reviewed your PR, you can find my comments there. |
At the moment it's not possible to delete remote files from the command line except using the
huggingface-cli upload (...) --delete="*"
command. But this one requires to upload while deleting.Other feature request: CLI command to move files inside a repo.
We have everything needed in
HfApi
, it's just a matter of implementing the CLI.Requested by @ArthurZucker "feature request for clumsy people" 😄
The text was updated successfully, but these errors were encountered: