gigcode commited on
Commit
ea264ae
·
verified ·
1 Parent(s): 862d209

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -3,14 +3,14 @@ import requests
3
  from datetime import datetime
4
 
5
  # App title and description
6
- st.set_page_config(page_title="SuperKart Sales Forecasting", page_icon="🛒", layout="centered")
7
- st.title("🛒 SuperKart Sales Forecasting App")
8
  st.markdown("Enter product and store attributes to forecast monthly product sales revenue.")
9
  st.markdown("*All sales are reported in ($) USD.*")
10
 
11
 
12
- # --- Input fields for product and store data (matching screenshot) ---
13
- # Corrected input widgets to align with the model's training data
14
  product_weight = st.number_input("Product Weight (oz)", min_value=0.0, value=12.66, step=0.1)
15
  product_sugar_content = st.selectbox("Product Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
16
  product_allocated_area = st.number_input("Product Allocated Area (linear in.)", min_value=0.0, value=100.00, step=1.0)
@@ -20,7 +20,7 @@ store_location_city_type = st.selectbox("Store Location City Type", ["Tier 1", "
20
  store_type = st.selectbox("Store Type", ["Supermarket Type1", "Supermarket Type2", "Departmental Store", "Food Mart"])
21
  store_age_years = st.slider("Store Age (years)", min_value=0, max_value=30, value=10, step=1)
22
 
23
- # Corrected Product Type categories to match the dataset
24
  product_type_category = st.selectbox(
25
  "Product Type Category",
26
  [
@@ -44,7 +44,7 @@ payload = {
44
  "Product_Type": product_type_category
45
  }
46
 
47
- # ---- Call your backend Space (URL is now correct and hardcoded) ----
48
  API_URL = "https://gigcode-superkartbackend.hf.space/v1/sales"
49
 
50
  if st.button("Predict", type="primary"):
 
3
  from datetime import datetime
4
 
5
  # App title and description
6
+ st.set_page_config(page_title="SuperKart Sales Forecasting", layout="centered")
7
+ st.title("SuperKart Sales Forecasting App")
8
  st.markdown("Enter product and store attributes to forecast monthly product sales revenue.")
9
  st.markdown("*All sales are reported in ($) USD.*")
10
 
11
 
12
+ # --- Input fields for product and store data ---
13
+
14
  product_weight = st.number_input("Product Weight (oz)", min_value=0.0, value=12.66, step=0.1)
15
  product_sugar_content = st.selectbox("Product Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
16
  product_allocated_area = st.number_input("Product Allocated Area (linear in.)", min_value=0.0, value=100.00, step=1.0)
 
20
  store_type = st.selectbox("Store Type", ["Supermarket Type1", "Supermarket Type2", "Departmental Store", "Food Mart"])
21
  store_age_years = st.slider("Store Age (years)", min_value=0, max_value=30, value=10, step=1)
22
 
23
+ # Product Type categories to match the dataset
24
  product_type_category = st.selectbox(
25
  "Product Type Category",
26
  [
 
44
  "Product_Type": product_type_category
45
  }
46
 
47
+ # ---- Call backend Space ----
48
  API_URL = "https://gigcode-superkartbackend.hf.space/v1/sales"
49
 
50
  if st.button("Predict", type="primary"):