Spaces:
Sleeping
Sleeping
Update deployment files (app.py, Dockerfile, requirements.txt, .streamlit)
Browse files- Dockerfile +4 -1
- app.py +4 -10
Dockerfile
CHANGED
|
@@ -7,9 +7,12 @@ WORKDIR /app
|
|
| 7 |
#copy all the files from the current directory on the host to the container's /app directory
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
-
#Install python dependencies listed in requirements.
|
| 11 |
RUN pip install -r requirements.txt
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
RUN useradd -m -u 1000 user
|
| 14 |
USER user
|
| 15 |
ENV HOME=/home/user \
|
|
|
|
| 7 |
#copy all the files from the current directory on the host to the container's /app directory
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
+
# Install python dependencies listed in requirements.txt
|
| 11 |
RUN pip install -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy Streamlit configuration
|
| 14 |
+
COPY .streamlit /root/.streamlit
|
| 15 |
+
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
USER user
|
| 18 |
ENV HOME=/home/user \
|
app.py
CHANGED
|
@@ -47,8 +47,8 @@ engine_rpm = st.slider("Engine RPM", 0, 2500, 750)
|
|
| 47 |
lub_oil_pressure = st.slider("Lub Oil Pressure (bar/kPa)", 0.0, 10.0, 3.0, 0.1)
|
| 48 |
fuel_pressure = st.slider("Fuel Pressure (bar/kPa)", 0.0, 25.0, 7.0, 0.1)
|
| 49 |
coolant_pressure = st.slider("Coolant Pressure (bar/kPa)", 0.0, 10.0, 2.5, 0.1)
|
| 50 |
-
lub_oil_temp = st.slider("Lub Oil Temperature (
|
| 51 |
-
coolant_temp = st.slider("Coolant Temperature (
|
| 52 |
|
| 53 |
# Create a DataFrame for prediction
|
| 54 |
input_data = pd.DataFrame(
|
|
@@ -72,18 +72,12 @@ if st.button("Predict Engine Condition", help="Click to predict if maintenance i
|
|
| 72 |
|
| 73 |
st.subheader("Prediction Results:")
|
| 74 |
if prediction == 1:
|
| 75 |
-
st.error(
|
| 76 |
-
f"**Prediction: Engine requires maintenance!** (
|
| 77 |
-
{prediction_proba:.2f} probability of being faulty)"
|
| 78 |
-
)
|
| 79 |
st.markdown(
|
| 80 |
"*Proactive intervention is recommended based on sensor readings.*"
|
| 81 |
)
|
| 82 |
else:
|
| 83 |
-
st.success(
|
| 84 |
-
f"**Prediction: Engine is operating normally.** (
|
| 85 |
-
{prediction_proba:.2f} probability of being faulty)"
|
| 86 |
-
)
|
| 87 |
st.markdown(
|
| 88 |
"*Continue regular monitoring. No immediate maintenance is indicated.*"
|
| 89 |
)
|
|
|
|
| 47 |
lub_oil_pressure = st.slider("Lub Oil Pressure (bar/kPa)", 0.0, 10.0, 3.0, 0.1)
|
| 48 |
fuel_pressure = st.slider("Fuel Pressure (bar/kPa)", 0.0, 25.0, 7.0, 0.1)
|
| 49 |
coolant_pressure = st.slider("Coolant Pressure (bar/kPa)", 0.0, 10.0, 2.5, 0.1)
|
| 50 |
+
lub_oil_temp = st.slider("Lub Oil Temperature (\u00b0C)", 60.0, 100.0, 77.0, 0.1)
|
| 51 |
+
coolant_temp = st.slider("Coolant Temperature (\u00b0C)", 60.0, 200.0, 78.0, 0.1)
|
| 52 |
|
| 53 |
# Create a DataFrame for prediction
|
| 54 |
input_data = pd.DataFrame(
|
|
|
|
| 72 |
|
| 73 |
st.subheader("Prediction Results:")
|
| 74 |
if prediction == 1:
|
| 75 |
+
st.error(f"**Prediction: Engine requires maintenance!** ({prediction_proba:.2f} probability of being faulty)")
|
|
|
|
|
|
|
|
|
|
| 76 |
st.markdown(
|
| 77 |
"*Proactive intervention is recommended based on sensor readings.*"
|
| 78 |
)
|
| 79 |
else:
|
| 80 |
+
st.success(f"**Prediction: Engine is operating normally.** ({prediction_proba:.2f} probability of being faulty)")
|
|
|
|
|
|
|
|
|
|
| 81 |
st.markdown(
|
| 82 |
"*Continue regular monitoring. No immediate maintenance is indicated.*"
|
| 83 |
)
|