From aff12c69510a730476cfa7c8cad7c38afdc47d11 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Thu, 7 May 2026 02:08:09 +0000 Subject: [PATCH] Fix forward_loop: pass as callable, not via create_forward_loop --- quantize_modelopt.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quantize_modelopt.py b/quantize_modelopt.py index 55b3271..d3c5de1 100644 --- a/quantize_modelopt.py +++ b/quantize_modelopt.py @@ -115,9 +115,10 @@ def main(): calib_seq=args.calib_seq, ) - # Create forward loop from dataloader (modelopt helper) - from modelopt.torch.utils.dataset_utils import create_forward_loop - forward_loop = create_forward_loop(calib_dataloader) + # Build forward loop for calibration + def forward_loop(model): + for batch in calib_dataloader: + model(**batch) # Quantize quant_cfg = QUANT_CONFIGS[args.qformat]