Update deployment/app.py
Browse files- deployment/app.py +8 -10
deployment/app.py
CHANGED
|
@@ -3,11 +3,10 @@ import pandas as pd
|
|
| 3 |
from joblib import load
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
# ---------------------------------------
|
| 9 |
# Load model from Hugging Face Model Hub
|
| 10 |
-
# -------------------------------
|
|
|
|
| 11 |
model_path = hf_hub_download(
|
| 12 |
repo_id="Shalini94/predictive-maintenance-model",
|
| 13 |
filename="best_model.pkl"
|
|
@@ -15,11 +14,13 @@ model_path = hf_hub_download(
|
|
| 15 |
|
| 16 |
model = load(model_path)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
st.subheader("Enter Engine Sensor Values")
|
| 19 |
|
| 20 |
-
# ---------------------------------------
|
| 21 |
-
# User Inputs
|
| 22 |
-
# ---------------------------------------
|
| 23 |
engine_rpm = st.number_input("Engine RPM", value=800)
|
| 24 |
lub_oil_pressure = st.number_input("Lub Oil Pressure", value=3.0)
|
| 25 |
fuel_pressure = st.number_input("Fuel Pressure", value=6.0)
|
|
@@ -27,9 +28,6 @@ coolant_pressure = st.number_input("Coolant Pressure", value=2.0)
|
|
| 27 |
lub_oil_temp = st.number_input("Lub Oil Temperature", value=77.0)
|
| 28 |
coolant_temp = st.number_input("Coolant Temperature", value=80.0)
|
| 29 |
|
| 30 |
-
# ---------------------------------------
|
| 31 |
-
# Prediction Button
|
| 32 |
-
# ---------------------------------------
|
| 33 |
if st.button("Predict Engine Condition"):
|
| 34 |
|
| 35 |
input_df = pd.DataFrame([{
|
|
|
|
| 3 |
from joblib import load
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
|
| 6 |
+
# -------------------------------
|
|
|
|
|
|
|
| 7 |
# Load model from Hugging Face Model Hub
|
| 8 |
+
# -------------------------------
|
| 9 |
+
|
| 10 |
model_path = hf_hub_download(
|
| 11 |
repo_id="Shalini94/predictive-maintenance-model",
|
| 12 |
filename="best_model.pkl"
|
|
|
|
| 14 |
|
| 15 |
model = load(model_path)
|
| 16 |
|
| 17 |
+
# -------------------------------
|
| 18 |
+
# Streamlit UI
|
| 19 |
+
# -------------------------------
|
| 20 |
+
|
| 21 |
+
st.title("Predictive Maintenance Engine Model")
|
| 22 |
st.subheader("Enter Engine Sensor Values")
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
engine_rpm = st.number_input("Engine RPM", value=800)
|
| 25 |
lub_oil_pressure = st.number_input("Lub Oil Pressure", value=3.0)
|
| 26 |
fuel_pressure = st.number_input("Fuel Pressure", value=6.0)
|
|
|
|
| 28 |
lub_oil_temp = st.number_input("Lub Oil Temperature", value=77.0)
|
| 29 |
coolant_temp = st.number_input("Coolant Temperature", value=80.0)
|
| 30 |
|
|
|
|
|
|
|
|
|
|
| 31 |
if st.button("Predict Engine Condition"):
|
| 32 |
|
| 33 |
input_df = pd.DataFrame([{
|