hugolb commited on
Commit
1368481
·
1 Parent(s): d02c2df

change files

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import requests
7
 
8
  # Load the pre-trained MobileNetV2 model from torchvision
9
  model = models.mobilenet_v2(pretrained=True)
10
- device = torch.device("mps")
11
  model.to(device)
12
  model.eval() # Set model to evaluation mode
13
 
@@ -33,7 +33,7 @@ def preprocess_image(image):
33
  # Prediction function
34
  def predict(image):
35
  # Load the input file
36
- reloaded_img_tensor = torch.load(image).to(torch.device("mps"))
37
 
38
  # Make predictions
39
  output = model(reloaded_img_tensor)
 
7
 
8
  # Load the pre-trained MobileNetV2 model from torchvision
9
  model = models.mobilenet_v2(pretrained=True)
10
+ device = torch.device("cpu")
11
  model.to(device)
12
  model.eval() # Set model to evaluation mode
13
 
 
33
  # Prediction function
34
  def predict(image):
35
  # Load the input file
36
+ reloaded_img_tensor = torch.load(image).to(torch.device("cpu"))
37
 
38
  # Make predictions
39
  output = model(reloaded_img_tensor)