From 0ad7dc253d4680234cc64ff62ee00f515fb989e5 Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Fri, 3 Nov 2023 11:59:11 +0100 Subject: [PATCH] fix trainer --- optimum/intel/openvino/trainer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/optimum/intel/openvino/trainer.py b/optimum/intel/openvino/trainer.py index d7e1659bb5..065931c4e0 100644 --- a/optimum/intel/openvino/trainer.py +++ b/optimum/intel/openvino/trainer.py @@ -355,6 +355,9 @@ def _inner_training_loop( if model is not self.model: self.model_wrapped = model + if delay_optimizer_creation: + self.create_optimizer_and_scheduler(num_training_steps=max_steps) + # Check if saved optimizer or scheduler states exist self._load_optimizer_and_scheduler(resume_from_checkpoint)