arnavarpit commited on
Commit
61bce67
Β·
verified Β·
1 Parent(s): 430ac0d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +10 -3
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 = np.array([[engine_rpm, lub_oil_pressure, fuel_pressure, coolant_pressure,
81
- lub_oil_temperature, coolant_temperature]])
 
 
 
 
 
 
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..."):