INNER CODE UNIT · Python
main
FareedKhan-dev/kimi-k3-in-c · tools/budget.py:101
def main():
root = sys.argv[1] if len(sys.argv) > 1 else os.environ.get("K3_MODEL_DIR", "")
if not root:
print("usage: budget.py <model_dir>")
print(" or set K3_MODEL_DIR")
return 2
files = sorted(glob.glob(os.path.join(root, "*.safetensors")))
if not files:
print("no .safetensors shards in %s" % root)
print("Point this at the directory holding the released checkpoint. A partial")
print("download is fine: the totals below will simply cover the shards present.")
return 1
print("reading %d shard headers from %s\n" % (len(files), root))
by_class = collections.Counter()
cnt_class = collections.Counter()
by_dtype = collections.Counter()