diff --git a/scripts/quantize_nvfp4.py b/scripts/quantize_nvfp4.py index 4532a73..37a520f 100644 --- a/scripts/quantize_nvfp4.py +++ b/scripts/quantize_nvfp4.py @@ -227,6 +227,12 @@ def run_calibration(model_path, export_dir, calib_save_path, amax_snapshot_path, args = parse_args() sys.argv = saved_argv + # Apply the same post-parse conversions that hf_ptq's __main__ block does + # (these normally run between parse_args() and main() in the original script, + # but since we call main() directly, we have to do them ourselves) + args.dataset = args.dataset.split(",") if isinstance(args.dataset, str) else args.dataset + args.calib_size = [int(num_sample) for num_sample in args.calib_size.split(",")] + # ── Post-calibration hook ── # We monkey-patch export_quantized to add our defensive saves before export. import hf_ptq