Skip to content

Commit f529d43

Browse files
author
Your Name
committed
minor
1 parent 4607dfc commit f529d43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modelopt/torch/quantization/plugins/transformers_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ def _restore_modelopt_state_with_weights(self):
194194

195195
def _quantize_model(self):
196196
"""Quantize the model. Restore the quantization state if it exists."""
197-
num_samples = min(self.quant_args.calib_size, len(self.eval_dataset)) # type: ignore [union-attr]
198197
dataset = self.train_dataset if self.train_dataset is not None else self.eval_dataset
198+
num_samples = min(self.quant_args.calib_size, len(dataset)) # type: ignore [union-attr]
199199
dataset = torch.utils.data.Subset(dataset, list(range(num_samples)))
200200
data_loader = self.get_eval_dataloader(dataset)
201201

0 commit comments

Comments
 (0)