Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import joblib
|
|
| 3 |
import streamlit as st
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
import numpy as np
|
|
|
|
| 6 |
|
| 7 |
st.set_page_config(page_title="Engine Predictive Maintenance", page_icon="π οΈ", layout="wide")
|
| 8 |
st.title("π Engine Predictive Maintenance β Failure Risk Prediction")
|
|
@@ -76,9 +77,15 @@ if st.button("π Predict Maintenance Need", type="primary", use_container_widt
|
|
| 76 |
if model is None:
|
| 77 |
st.error("β Model not loaded. Cannot make predictions.")
|
| 78 |
else:
|
| 79 |
-
# Prepare input data
|
| 80 |
-
X =
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
try:
|
| 84 |
with st.spinner("Analyzing sensor data..."):
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
import numpy as np
|
| 6 |
+
import pandas as pd
|
| 7 |
|
| 8 |
st.set_page_config(page_title="Engine Predictive Maintenance", page_icon="π οΈ", layout="wide")
|
| 9 |
st.title("π Engine Predictive Maintenance β Failure Risk Prediction")
|
|
|
|
| 77 |
if model is None:
|
| 78 |
st.error("β Model not loaded. Cannot make predictions.")
|
| 79 |
else:
|
| 80 |
+
# Prepare input data as DataFrame with column names
|
| 81 |
+
X = pd.DataFrame({
|
| 82 |
+
'engine_rpm': [engine_rpm],
|
| 83 |
+
'lub_oil_pressure': [lub_oil_pressure],
|
| 84 |
+
'fuel_pressure': [fuel_pressure],
|
| 85 |
+
'coolant_pressure': [coolant_pressure],
|
| 86 |
+
'lub_oil_temperature': [lub_oil_temperature],
|
| 87 |
+
'coolant_temperature': [coolant_temperature]
|
| 88 |
+
})
|
| 89 |
|
| 90 |
try:
|
| 91 |
with st.spinner("Analyzing sensor data..."):
|