Update app.py
Browse files
app.py
CHANGED
@@ -22,13 +22,14 @@ machine_failure_predictor = joblib.load('model.joblib')
|
|
22 |
log_file = Path("logs/") / f"data_{uuid.uuid4()}.json"
|
23 |
log_folder = log_file.parent
|
24 |
|
|
|
25 |
scheduler = CommitScheduler(
|
26 |
repo_id="machine-failure-logs",
|
27 |
repo_type="dataset",
|
28 |
folder_path=log_folder,
|
29 |
path_in_repo="data",
|
30 |
every=2
|
31 |
-
)
|
32 |
|
33 |
|
34 |
# Set up UI components for input and output
|
@@ -57,7 +58,7 @@ def predict_machine_failure(air_temperature, process_temperature, rotational_spe
|
|
57 |
}
|
58 |
data_point = pd.DataFrame([sample])
|
59 |
prediction = machine_failure_predictor.predict(data_point).tolist()
|
60 |
-
|
61 |
with scheduler.lock:
|
62 |
with log_file.open("a") as f:
|
63 |
f.write(json.dumps(
|
@@ -72,6 +73,7 @@ def predict_machine_failure(air_temperature, process_temperature, rotational_spe
|
|
72 |
}
|
73 |
))
|
74 |
f.write("\n")
|
|
|
75 |
|
76 |
return prediction[0]
|
77 |
|
|
|
22 |
log_file = Path("logs/") / f"data_{uuid.uuid4()}.json"
|
23 |
log_folder = log_file.parent
|
24 |
|
25 |
+
'''
|
26 |
scheduler = CommitScheduler(
|
27 |
repo_id="machine-failure-logs",
|
28 |
repo_type="dataset",
|
29 |
folder_path=log_folder,
|
30 |
path_in_repo="data",
|
31 |
every=2
|
32 |
+
)'''
|
33 |
|
34 |
|
35 |
# Set up UI components for input and output
|
|
|
58 |
}
|
59 |
data_point = pd.DataFrame([sample])
|
60 |
prediction = machine_failure_predictor.predict(data_point).tolist()
|
61 |
+
'''
|
62 |
with scheduler.lock:
|
63 |
with log_file.open("a") as f:
|
64 |
f.write(json.dumps(
|
|
|
73 |
}
|
74 |
))
|
75 |
f.write("\n")
|
76 |
+
'''
|
77 |
|
78 |
return prediction[0]
|
79 |
|