Skip to content

Commit

Permalink
Update optimum/gptq/quantizer.py
Browse files Browse the repository at this point in the history
Co-authored-by: Ilyas Moutawwakil <[email protected]>
  • Loading branch information
jiqing-feng and IlyasMoutawwakil authored Dec 19, 2024
1 parent c446522 commit c8a6528
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/gptq/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def tmp(_, input, output):
model = self.post_init_model(model)

torch.cuda.empty_cache()
if hasattr(torch, "xpu"):
if hasattr(torch, "xpu") and torch.xpu.is_available():
torch.xpu.empty_cache()
return model

Expand Down

0 comments on commit c8a6528

Please sign in to comment.