Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
Signed-off-by: Cheng, Penghui <penghui.cheng@intel.com>
  • Loading branch information
PenghuiCheng committed Jan 17, 2024
1 parent ed873c9 commit bee33e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/neural_compressor/language-modeling/run_clm.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def compute_metrics(eval_preds):
if optim_args.apply_quantization and optim_args.quantization_approach in {"static", "dynamic", "weight_only"}:
model = trainer.model if isinstance(trainer.model, PreTrainedModel) else trainer.model._model
quantizer = INCQuantizer.from_pretrained(model)
if optim_args.quantization_approach != "dynamic":
if optim_args.quantization_approach in ["static", "weight_only"]:
num_calibration_samples = min(len(train_dataset), optim_args.num_calibration_samples)
train_dataset = train_dataset.select(range(num_calibration_samples))
if optim_args.quantization_approach == "static":
Expand Down

0 comments on commit bee33e1

Please sign in to comment.