Skip to content

Commit a9d4d93

Browse files
committed
minor
Signed-off-by: realAsma <[email protected]>
1 parent 339b7e6 commit a9d4d93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modelopt/torch/quantization/plugins/transformers_trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def _restore_modelopt_state_with_weights(self):
191191
modelopt_state = torch.load(self._modelopt_state_path, weights_only=False)
192192
modelopt_weights = modelopt_state.pop("modelopt_state_weights", None)
193193
restore_from_modelopt_state(self.model, modelopt_state)
194-
set_quantizer_state_dict(self.model, modelopt_weights)
194+
if modelopt_weights is not None:
195+
set_quantizer_state_dict(self.model, modelopt_weights)
195196
print_rank_0("Restored modelopt state with weights.")
196197

197198
def _quantize_model(self):

0 commit comments

Comments
 (0)