Skip to content

Commit bee33e1

Browse files
committed
Update example
Signed-off-by: Cheng, Penghui <penghui.cheng@intel.com>
1 parent ed873c9 commit bee33e1

File tree

1 file changed

+1
-1
lines changed
  • examples/neural_compressor/language-modeling

1 file changed

+1
-1
lines changed

examples/neural_compressor/language-modeling/run_clm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def compute_metrics(eval_preds):
717717
if optim_args.apply_quantization and optim_args.quantization_approach in {"static", "dynamic", "weight_only"}:
718718
model = trainer.model if isinstance(trainer.model, PreTrainedModel) else trainer.model._model
719719
quantizer = INCQuantizer.from_pretrained(model)
720-
if optim_args.quantization_approach != "dynamic":
720+
if optim_args.quantization_approach in ["static", "weight_only"]:
721721
num_calibration_samples = min(len(train_dataset), optim_args.num_calibration_samples)
722722
train_dataset = train_dataset.select(range(num_calibration_samples))
723723
if optim_args.quantization_approach == "static":

0 commit comments

Comments
 (0)