Skip to content

Commit 78f3aaf

Browse files
author
Your Name
committed
minor revert unnecessary change
1 parent 2a4d8b0 commit 78f3aaf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/llm_qat/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,11 @@ def train():
267267
metrics = get_metrics_with_perplexity(metrics)
268268
print_rank_0(f"Evaluation results: \n{metrics}")
269269

270-
print_rank_0("Saving the model...")
271-
trainer.save_state()
272-
kwargs = {"export_student": True} if training_args.distill else {}
273-
trainer.save_model(training_args.output_dir, **kwargs)
270+
if training_args.do_train or quant_args.quant_cfg is not None:
271+
print_rank_0("Saving the model...")
272+
trainer.save_state()
273+
kwargs = {"export_student": True} if training_args.distill else {}
274+
trainer.save_model(training_args.output_dir, **kwargs)
274275

275276

276277
if __name__ == "__main__":

0 commit comments

Comments
 (0)