yucelgumus61 commited on
Commit
8c7d82a
·
verified ·
1 Parent(s): acb1b3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -7,7 +7,7 @@ from model import ExampleModel
7
  model_path = "animal_7.pth"
8
  labels = ["bird", "cat", "dog", "horse"]
9
  num_classes = len(labels)
10
- device = torch.device("cuda:0" if torch.cuda.is_available() else "mps")
11
 
12
 
13
  # Preprocess
 
7
  model_path = "animal_7.pth"
8
  labels = ["bird", "cat", "dog", "horse"]
9
  num_classes = len(labels)
10
+ device = torch.device("cuda:0" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu")
11
 
12
 
13
  # Preprocess