Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ class Prediction:
|
|
10 |
prediction: TorchTensor
|
11 |
|
12 |
app = fastapi.FastAPI(docs_url="/")
|
13 |
-
pre_trained_model = torch.load('best_model.pth')
|
14 |
|
15 |
# Get the state dictionary of the pre-trained model
|
16 |
state_dict = pre_trained_model['model_state_dict']
|
|
|
10 |
prediction: TorchTensor
|
11 |
|
12 |
app = fastapi.FastAPI(docs_url="/")
|
13 |
+
pre_trained_model = torch.load('best_model.pth',map_location=torch.device('cpu'))
|
14 |
|
15 |
# Get the state dictionary of the pre-trained model
|
16 |
state_dict = pre_trained_model['model_state_dict']
|