Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from sklearn.preprocessing import MinMaxScaler
|
|
| 7 |
import tensorflow as tf
|
| 8 |
from tensorflow.keras import layers, models, regularizers
|
| 9 |
import os
|
|
|
|
| 10 |
|
| 11 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
| 12 |
|
|
@@ -26,6 +27,7 @@ CLASS_RISK = {
|
|
| 26 |
}
|
| 27 |
COLORS = ['#2ecc71','#3498db','#e74c3c','#f39c12','#9b59b6']
|
| 28 |
|
|
|
|
| 29 |
def build_model():
|
| 30 |
m = models.Sequential([
|
| 31 |
layers.Input(shape=(187, 1)),
|
|
@@ -49,6 +51,7 @@ def build_model():
|
|
| 49 |
|
| 50 |
model = build_model()
|
| 51 |
|
|
|
|
| 52 |
def predict_ecg(text_input):
|
| 53 |
try:
|
| 54 |
cleaned = text_input.replace(",", " ").replace("\n", " ").replace("\t", " ")
|
|
|
|
| 7 |
import tensorflow as tf
|
| 8 |
from tensorflow.keras import layers, models, regularizers
|
| 9 |
import os
|
| 10 |
+
import spaces
|
| 11 |
|
| 12 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
| 13 |
|
|
|
|
| 27 |
}
|
| 28 |
COLORS = ['#2ecc71','#3498db','#e74c3c','#f39c12','#9b59b6']
|
| 29 |
|
| 30 |
+
@spaces.GPU
|
| 31 |
def build_model():
|
| 32 |
m = models.Sequential([
|
| 33 |
layers.Input(shape=(187, 1)),
|
|
|
|
| 51 |
|
| 52 |
model = build_model()
|
| 53 |
|
| 54 |
+
@spaces.GPU
|
| 55 |
def predict_ecg(text_input):
|
| 56 |
try:
|
| 57 |
cleaned = text_input.replace(",", " ").replace("\n", " ").replace("\t", " ")
|