Buckets:

redmingwei's picture
download
raw
915 Bytes
"""清理 bucket 内被取代的中间产物与日志。"""
import os, shutil
from pathlib import Path
removed = []
def rm(p):
p = Path(p)
if p.is_dir():
sz = sum(f.stat().st_size for f in p.rglob('*') if f.is_file())
shutil.rmtree(p)
removed.append((str(p), round(sz / 1e6, 1)))
elif p.is_file():
sz = p.stat().st_size
p.unlink()
removed.append((str(p), round(sz / 1e6, 1)))
# 1) 补齐版计数,已被 counts_ragged.npy 取代并上线
rm('/domains/counts-v3')
# 2) 旧的 hierarchy.json(早已改名 labels.json,是遗留)
rm('/domains/omnibrain-multi/hierarchy.json')
# 3) 日志
for f in sorted(Path('/domains').glob('*.log')):
rm(f)
print('removed:')
for p, sz in removed:
print(f' {p} {sz} MB')
print(f'total {sum(s for _, s in removed):.1f} MB')
print()
print('remaining top-level:')
print(sorted(os.listdir('/domains')))

Xet Storage Details

Size:
915 Bytes
·
Xet hash:
39e56f210047fd5490e6ea9097309e72b17db91201b937e5e129520947ce8075

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