Spaces:
Sleeping
Sleeping
Update prediction.py
Browse files- prediction.py +1 -1
prediction.py
CHANGED
|
@@ -15,7 +15,7 @@ class Prediction:
|
|
| 15 |
Initialize the Prediction class with a pre-trained model and necessary parameters.
|
| 16 |
"""
|
| 17 |
self.device = torch.device("cpu")
|
| 18 |
-
self.model = torch.jit.load("model.pt")
|
| 19 |
|
| 20 |
self.model.eval()
|
| 21 |
params = read_yaml(PARAMS_FILE_PATH)
|
|
|
|
| 15 |
Initialize the Prediction class with a pre-trained model and necessary parameters.
|
| 16 |
"""
|
| 17 |
self.device = torch.device("cpu")
|
| 18 |
+
self.model = torch.jit.load("model.pt", map_location=self.device)
|
| 19 |
|
| 20 |
self.model.eval()
|
| 21 |
params = read_yaml(PARAMS_FILE_PATH)
|