premswan commited on
Commit
e50caeb
·
verified ·
1 Parent(s): e22e3b5

Deploy predictive maintenance Streamlit app

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. app.py +0 -3
Dockerfile CHANGED
@@ -6,7 +6,8 @@ ENV PYTHONUNBUFFERED=1
6
  WORKDIR /app
7
 
8
  COPY requirements.txt /app/requirements.txt
9
- RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt
 
10
 
11
  COPY app.py /app/app.py
12
 
 
6
  WORKDIR /app
7
 
8
  COPY requirements.txt /app/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade pip && \
10
+ pip install --no-cache-dir -r /app/requirements.txt
11
 
12
  COPY app.py /app/app.py
13
 
app.py CHANGED
@@ -16,7 +16,6 @@ LABEL_MAP = {
16
 
17
  @st.cache_resource
18
  def load_model():
19
- # Download and load the trained model from Hugging Face Model Hub.
20
  token = os.getenv("HF_TOKEN")
21
  model_path = hf_hub_download(
22
  repo_id=HF_MODEL_REPO_ID,
@@ -55,9 +54,7 @@ with st.form("prediction_form"):
55
  submitted = st.form_submit_button("Predict Engine Condition")
56
 
57
  if submitted:
58
- # Rubric requirement: get inputs and save them into a DataFrame.
59
  input_df = pd.DataFrame([sensor_values], columns=FEATURE_COLUMNS)
60
-
61
  prediction = int(MODEL.predict(input_df)[0])
62
 
63
  if hasattr(MODEL, "predict_proba"):
 
16
 
17
  @st.cache_resource
18
  def load_model():
 
19
  token = os.getenv("HF_TOKEN")
20
  model_path = hf_hub_download(
21
  repo_id=HF_MODEL_REPO_ID,
 
54
  submitted = st.form_submit_button("Predict Engine Condition")
55
 
56
  if submitted:
 
57
  input_df = pd.DataFrame([sensor_values], columns=FEATURE_COLUMNS)
 
58
  prediction = int(MODEL.predict(input_df)[0])
59
 
60
  if hasattr(MODEL, "predict_proba"):