CharlieAmalet commited on
Commit
7e8f68e
·
verified ·
1 Parent(s): 36f850c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -75,7 +75,8 @@ def depth_edges_mask(depth):
75
  @spaces.GPU(enable_queue=True)
76
  def predict_depth(image):
77
  global model
78
- model.to(DEVICE)
 
79
  depth = model.infer_pil(image)
80
  return depth
81
 
 
75
  @spaces.GPU(enable_queue=True)
76
  def predict_depth(image):
77
  global model
78
+ device = "cuda" if torch.cuda.is_available() else "cpu"
79
+ model.to(device)
80
  depth = model.infer_pil(image)
81
  return depth
82