Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,12 +34,11 @@ def download_models():
|
|
| 34 |
stroke_model = load_model("cnn_stroke_model.keras")
|
| 35 |
|
| 36 |
|
| 37 |
-
pain_model = resnet18(weights=None)
|
| 38 |
-
pain_model.fc = nn.Linear(pain_model.fc.in_features, 1)
|
| 39 |
-
pain_model.load_state_dict(torch.load("pain_model.pth", map_location=torch.device("cpu")))
|
| 40 |
-
pain_model.eval()
|
| 41 |
|
| 42 |
-
st.write("✅ Models loaded.")
|
| 43 |
|
| 44 |
return stroke_model, pain_model
|
| 45 |
|
|
|
|
| 34 |
stroke_model = load_model("cnn_stroke_model.keras")
|
| 35 |
|
| 36 |
|
| 37 |
+
pain_model = resnet18(weights=None)
|
| 38 |
+
pain_model.fc = nn.Linear(pain_model.fc.in_features, 1)
|
| 39 |
+
pain_model.load_state_dict(torch.load("pain_model.pth", map_location=torch.device("cpu")))
|
| 40 |
+
pain_model.eval()
|
| 41 |
|
|
|
|
| 42 |
|
| 43 |
return stroke_model, pain_model
|
| 44 |
|