Spaces:
Sleeping
Sleeping
Add files 3
Browse files
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)
|