Skip to content

Commit 7369463

Browse files
xin3hexinhe3
andauthored
fix bug during HPU inference (#2280)
Signed-off-by: xinhe3 <[email protected]> Co-authored-by: xinhe3 <[email protected]>
1 parent 0e88d28 commit 7369463

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neural_compressor/evaluation/lm_eval/models/huggingface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def config(self):
359359
@property
360360
def model(self):
361361
# returns the model, unwrapping it if using Accelerate
362-
if hasattr(self, "accelerator"):
362+
if hasattr(self, "accelerator") and self._model is not None:
363363
return self.accelerator.unwrap_model(self._model)
364364
else:
365365
return self._model

0 commit comments

Comments
 (0)