Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from sklearn.preprocessing import StandardScaler
|
|
7 |
import scipy
|
8 |
from scipy import signal
|
9 |
import pickle
|
|
|
10 |
|
11 |
global_data = None
|
12 |
|
@@ -19,7 +20,14 @@ def label_data(ranges):
|
|
19 |
global global_data
|
20 |
for start, end, label in ranges.values:
|
21 |
global_data.loc[start:end, 'label'] = label
|
22 |
-
return global_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
def preprocess_data(data):
|
@@ -133,7 +141,7 @@ with gr.Blocks() as demo:
|
|
133 |
|
134 |
file_input.upload(get_data_preview, inputs=file_input, outputs=data_preview)
|
135 |
label_button = gr.Button("Label Data")
|
136 |
-
label_button.click(label_data, inputs=[ranges_input], outputs=labeled_data_preview)
|
137 |
train_button = gr.Button("Train Model")
|
138 |
train_button.click(train_model, outputs=[training_status, model_file, scaler_file])
|
139 |
|
|
|
7 |
import scipy
|
8 |
from scipy import signal
|
9 |
import pickle
|
10 |
+
import asyncio
|
11 |
|
12 |
global_data = None
|
13 |
|
|
|
20 |
global global_data
|
21 |
for start, end, label in ranges.values:
|
22 |
global_data.loc[start:end, 'label'] = label
|
23 |
+
return global_data.tail()
|
24 |
+
|
25 |
+
|
26 |
+
#def label_data(ranges):
|
27 |
+
#global global_data
|
28 |
+
#for start, end, label in ranges.values:
|
29 |
+
# global_data.loc[start:end, 'label'] = label
|
30 |
+
#return global_data
|
31 |
|
32 |
|
33 |
def preprocess_data(data):
|
|
|
141 |
|
142 |
file_input.upload(get_data_preview, inputs=file_input, outputs=data_preview)
|
143 |
label_button = gr.Button("Label Data")
|
144 |
+
label_button.click(label_data, inputs=[ranges_input], outputs=labeled_data_preview, queue=True)
|
145 |
train_button = gr.Button("Train Model")
|
146 |
train_button.click(train_model, outputs=[training_status, model_file, scaler_file])
|
147 |
|