cpatonn's picture
Upload folder using huggingface_hub
7900294 verified
import os, json
# 1) load your existing index
index_path = "model.safetensors.index.json"
with open(index_path, "r") as f:
idx = json.load(f)
# 2) find all the shards
shards = sorted(f for f in os.listdir(".")
if f.startswith("model-") and f.endswith(".safetensors"))
# 3) sum their sizes
total_size = sum(os.path.getsize(s) for s in shards)
print(f"Found {len(shards)} shards, total_size = {total_size} bytes")