From d698a32f0f3fb2588f912071de8a80f8ef39f67a Mon Sep 17 00:00:00 2001 From: Christian Medina <37550954+cmedinasoriano@users.noreply.github.com> Date: Thu, 2 Jul 2026 23:04:52 -0400 Subject: [PATCH] feat: skip already processed shards (resume support) --- quantize_streaming.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantize_streaming.py b/quantize_streaming.py index aaf4882..c7ebf62 100644 --- a/quantize_streaming.py +++ b/quantize_streaming.py @@ -36,6 +36,12 @@ def streaming_quantize(model_path: str, output_path: str): print(f"Found {len(shards)} shards\n") for idx, shard_file in enumerate(shards): + # Skip already processed shards + shard_name = f"model-{idx:05d}-of-{len(shards):05d}.safetensors" + if (output_path / shard_name).exists(): + print(f"[{idx+1}/{len(shards)}] {Path(shard_file).name} (already saved, skipping)") + continue + print(f"[{idx+1}/{len(shards)}] {Path(shard_file).name}") state_dict = load_file(shard_file, device="cuda:0")