SanderGi commited on
Commit
f718747
·
1 Parent(s): c2e60bb
Files changed (1) hide show
  1. app/inference.py +2 -1
app/inference.py CHANGED
@@ -23,7 +23,8 @@ def clear_cache():
23
  if torch.cuda.is_available():
24
  torch.cuda.empty_cache()
25
  torch.cuda.ipc_collect()
26
- torch.mps.empty_cache()
 
27
 
28
 
29
  def load_model(model_id, device=DEVICE):
 
23
  if torch.cuda.is_available():
24
  torch.cuda.empty_cache()
25
  torch.cuda.ipc_collect()
26
+ if torch.backends.mps.is_available():
27
+ torch.mps.empty_cache()
28
 
29
 
30
  def load_model(model_id, device=DEVICE):