Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ model.eval()
|
|
| 42 |
# Preprocessing function
|
| 43 |
def preprocess_ecg(data):
|
| 44 |
"""Convert input ECG data to PyTorch tensor and prepare for inference."""
|
| 45 |
-
ecg = np.array(data
|
| 46 |
ecg = torch.from_numpy(ecg).unsqueeze(0).unsqueeze(0) # Shape: (1, 1, seq_length)
|
| 47 |
return ecg
|
| 48 |
|
|
|
|
| 42 |
# Preprocessing function
|
| 43 |
def preprocess_ecg(data):
|
| 44 |
"""Convert input ECG data to PyTorch tensor and prepare for inference."""
|
| 45 |
+
ecg = np.array(data.split(','), dtype=np.float32)
|
| 46 |
ecg = torch.from_numpy(ecg).unsqueeze(0).unsqueeze(0) # Shape: (1, 1, seq_length)
|
| 47 |
return ecg
|
| 48 |
|