keerthas commited on
Commit
a75a6be
·
verified ·
1 Parent(s): 0fa5109

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -1
  2. requirements.txt +1 -1
  3. src/streamlit_app.py +5 -5
Dockerfile CHANGED
@@ -1,3 +1,4 @@
 
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
@@ -17,4 +18,4 @@ EXPOSE 8501
17
 
18
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
19
 
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.headless=true", "--browser.gatherUsageStats=false", "--server.address=0.0.0.0"]
 
1
+
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
 
18
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
21
+ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.headless=true", "--browser.gatherUsageStats=false", "--server.address=0.0.0.0"]
requirements.txt CHANGED
@@ -4,4 +4,4 @@ pandas==2.2.2
4
  scikit-learn==1.6.1
5
  xgboost==2.1.4
6
  mlflow==3.0.1
7
- streamlit==1.28.0
 
4
  scikit-learn==1.6.1
5
  xgboost==2.1.4
6
  mlflow==3.0.1
7
+ streamlit==1.28.0
src/streamlit_app.py CHANGED
@@ -10,11 +10,11 @@ import joblib
10
  st.set_page_config(page_title="SuperKart Sales Prediction")
11
 
12
  # ---- Read secrets ----
13
- Repo_ID = os.getenv("Repo_ID")
14
  HF_TOKEN = os.getenv("HF_TOKEN")
15
 
16
- if not Repo_ID:
17
- st.error("Repo_ID secret is missing in HF Space")
18
  st.stop()
19
 
20
  # ---- Render UI immediately ----
@@ -23,7 +23,7 @@ st.write("UI rendered successfully")
23
 
24
  # ---- Load model lazily ----
25
 
26
- repo_path=f"{Repo_ID}/superkart-sales-model"
27
 
28
  @st.cache_resource
29
  def load_model():
@@ -80,4 +80,4 @@ input_data = pd.DataFrame([{
80
 
81
  if st.button("Predict Sales"):
82
  prediction = model.predict(input_data)[0]
83
- st.success(f"Estimated Product Sales: **₹ {prediction:,.2f}**")
 
10
  st.set_page_config(page_title="SuperKart Sales Prediction")
11
 
12
  # ---- Read secrets ----
13
+ REPO_ID = os.getenv("REPO_ID")
14
  HF_TOKEN = os.getenv("HF_TOKEN")
15
 
16
+ if not REPO_ID:
17
+ st.error("REPO_ID secret is missing in HF Space")
18
  st.stop()
19
 
20
  # ---- Render UI immediately ----
 
23
 
24
  # ---- Load model lazily ----
25
 
26
+ repo_path=f"{REPO_ID}/superkart-sales-model"
27
 
28
  @st.cache_resource
29
  def load_model():
 
80
 
81
  if st.button("Predict Sales"):
82
  prediction = model.predict(input_data)[0]
83
+ st.success(f"Estimated Product Sales: **₹ {prediction:,.2f}**")