updated running devices status
#1
by
ivankuzne
- opened
app.py
CHANGED
|
@@ -48,7 +48,10 @@ model = DenseNet121_CheXpert(num_labels=14, pretrained=None)
|
|
| 48 |
model.load_state_dict(state, strict=False)
|
| 49 |
model.to(device)
|
| 50 |
model.eval()
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def predict(image, threshold):
|
| 54 |
"""Generate predictions and Grad-CAM visualizations"""
|
|
|
|
| 48 |
model.load_state_dict(state, strict=False)
|
| 49 |
model.to(device)
|
| 50 |
model.eval()
|
| 51 |
+
if device.type=='cuda':
|
| 52 |
+
print(f"Model loaded successfully on GPU {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
| 53 |
+
else:
|
| 54 |
+
print(f"Model loaded successfully on CPU")
|
| 55 |
|
| 56 |
def predict(image, threshold):
|
| 57 |
"""Generate predictions and Grad-CAM visualizations"""
|