hugolb commited on
Commit
36469a6
1 Parent(s): 3b65451

Add files 3

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -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(device)
37
 
38
  # Make predictions
39
  output = model(reloaded_img_tensor)
 
33
  # Prediction function
34
  def predict(image):
35
  # Load the input file
36
+ reloaded_img_tensor = torch.load(image, map_location=device).to(device) # Ensure tensor is loaded on the correct device
37
 
38
  # Make predictions
39
  output = model(reloaded_img_tensor)