xuan-luo's picture
download
raw
693 Bytes
#!/usr/bin/env python3
"""Upload this package only after asserting the designated bucket is private."""
from pathlib import Path
from huggingface_hub import HfApi
root=Path(__file__).resolve().parents[1]
api=HfApi(); bucket='xuan-luo/kvpath-optimization'
from huggingface_hub.errors import BucketNotFoundError
try:
api.bucket_info(bucket)
except BucketNotFoundError:
api.create_bucket(bucket,private=True)
assert api.bucket_info(bucket).private is True, 'Bucket must be private before uploading'
api.sync_bucket(str(root),f'hf://buckets/{bucket}/KDA-optimization',delete=False)
assert api.bucket_info(bucket).private is True
print(f'https://huggingface.co/buckets/{bucket} (private)')

Xet Storage Details

Size:
693 Bytes
·
Xet hash:
9cd6d30e29c231638d846993d13e2fc21f48eae92140bb483bdf81a05e041e96

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.