Spaces:
Sleeping
Sleeping
Abdul Rafay commited on
Commit ·
93d71bf
1
Parent(s): 5b24e3f
fixed model loading
Browse files
main.py
CHANGED
|
@@ -38,7 +38,7 @@ async def predict(file: UploadFile = File(...)):
|
|
| 38 |
# -----------------------
|
| 39 |
device = torch.device("cpu")
|
| 40 |
model = Model().to(device)
|
| 41 |
-
model
|
| 42 |
model.eval()
|
| 43 |
|
| 44 |
image_bytes = await file.read()
|
|
|
|
| 38 |
# -----------------------
|
| 39 |
device = torch.device("cpu")
|
| 40 |
model = Model().to(device)
|
| 41 |
+
model = torch.load(MODEL_PATH, map_location=device)
|
| 42 |
model.eval()
|
| 43 |
|
| 44 |
image_bytes = await file.read()
|