[dev 🤫] Basic bucket API - not meant to be merged#3673
Draft
[dev 🤫] Basic bucket API - not meant to be merged#3673
Conversation
|
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. |
Contributor
Author
|
Demo of a first version of the CLI: bucket_demo.mp4 |
…ve --force-upload --force-download
Contributor
Author
|
Current CLI usage.
Usage:
hf bucket --help
# Create a bucket
hf bucket create user/my-bucket
hf bucket create user/my-bucket --private
hf bucket create user/my-bucket --exist-ok
# Delete a bucket
hf bucket delete user/my-bucket
hf bucket delete user/my-bucket --yes
hf bucket delete user/my-bucket --missing-ok
# List files in a bucket
hf bucket ls hf://buckets/user/my-bucket
hf bucket ls hf://buckets/user/my-bucket/models
# List files with human-readable sizes
hf bucket ls hf://buckets/user/my-bucket -h
# List files in tree format
hf bucket ls hf://buckets/user/my-bucket --tree
# Sync files between local and bucket
hf bucket sync ./data hf://buckets/user/my-bucket
hf bucket sync hf://buckets/user/my-bucket ./data
# Delete destination files not in source
hf bucket sync ./data hf://buckets/user/my-bucket --delete
# Ignore modification times, compare only sizes
hf bucket sync ./data hf://buckets/user/my-bucket --ignore-times
# Ignore sizes, compare only modification times
hf bucket sync ./data hf://buckets/user/my-bucket --ignore-sizes
# With filters
hf bucket sync hf://buckets/user/my-bucket ./data --include "*.safetensors" --exclude "*.tmp"
hf bucket sync ./data hf://buckets/user/my-bucket --filter-from filters.txt
# Only update existing files (skip new files)
hf bucket sync ./data hf://buckets/user/my-bucket --existing
# Only create new files (skip existing files)
hf bucket sync ./data hf://buckets/user/my-bucket --ignore-existing
# Safe review workflow
hf bucket sync ./data hf://buckets/user/my-bucket --plan sync-plan.jsonl
hf bucket sync --apply sync-plan.jsonl
# Verbose output with detailed logging
hf bucket sync ./data hf://buckets/user/my-bucket --verbose
# Quiet mode with minimal output
hf bucket sync ./data hf://buckets/user/my-bucket --quiet |
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.
Currently only for debug/tests purposes. Mimics server API. In practice we would refactor some logic, move parts to a
_bucket.pymodule, create a high-level interface, build a CLI, etc. Not in the scope for this PR.Related to (private) PR in moon-landing https://github.com/huggingface-internal/moon-landing/pull/16332
Disclaimer: CLI implementation is AI-generated and not reviewed. Nothing is set in stone yet.
How to use
julien-cdev accountbucket.pyand runpython bucket.pyResult