Spaces:
Build error
Build error
fix app
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def classify_drawing(drawing_image):
|
|
| 18 |
num_classes = 3 # Set the number of classes
|
| 19 |
# Initialize your model class
|
| 20 |
model = ShapeClassifier(num_classes=num_classes)
|
| 21 |
-
model.load_state_dict(torch.load('model.pth'))
|
| 22 |
model.eval() # Set the model to evaluation mode
|
| 23 |
|
| 24 |
# Convert the drawing to a grayscale image
|
|
|
|
| 18 |
num_classes = 3 # Set the number of classes
|
| 19 |
# Initialize your model class
|
| 20 |
model = ShapeClassifier(num_classes=num_classes)
|
| 21 |
+
model.load_state_dict(torch.load('model.pth', map_location=torch.device('cpu')))
|
| 22 |
model.eval() # Set the model to evaluation mode
|
| 23 |
|
| 24 |
# Convert the drawing to a grayscale image
|