MichaelNieto commited on
Commit
ca9fc52
·
verified ·
1 Parent(s): 536c063

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +14 -12
  2. requirements.txt +1 -1
app.py CHANGED
@@ -1,18 +1,20 @@
 
1
  import streamlit as st
2
  import requests
3
 
4
- st.title("Product Sales Prediction")
5
 
 
6
  Product_Weight = st.number_input("Product Weight", min_value=0.0, value=12.66)
7
  Product_Sugar_Content = st.selectbox("Product Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
8
- Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.0, value=0.0)
9
- Product_MRP = st.number_input("Product MRP", min_value=0.0, value=0.0)
10
- Store_Size = st.number_input("Store Size", min_value=0.0, value=0.0)
11
- Store_Location_City_Type = st.selectbox("Store Location City Type", ["Type 1", "Type 2", "Type 3"])
12
- Store_Type = st.selectbox("Store Type", ["Type A", "Type B", "Type C"])
13
- Product_Id_char = st.text_input("Product Id char", "")
14
- Store_Age_Years = st.number_input("Store Age Years", min_value=0.0, value=0.0)
15
- Product_Type_Category = st.selectbox("Product Type Category", ["Category A", "Category B", "Category C"])
16
 
17
  product_data = {
18
  "Product_Weight": Product_Weight,
@@ -27,14 +29,14 @@ product_data = {
27
  "Product_Type_Category": Product_Type_Category
28
  }
29
 
30
- if st.button("Predict", type="primary"):
31
  response = requests.post(
32
- "https://MichaelNieto-superkart-backend.hf.space/v1/predict",
33
  json=product_data
34
  )
35
  if response.status_code == 200:
36
  result = response.json()
37
  predicted_sales = result["Sales"]
38
- st.write(f"Predicted Product Sales Total: {predicted_sales:.2f}")
39
  else:
40
  st.error("Error in API request")
 
1
+
2
  import streamlit as st
3
  import requests
4
 
5
+ st.title("SuperKart Sales Predictor")
6
 
7
+ # Input fields for product and store data
8
  Product_Weight = st.number_input("Product Weight", min_value=0.0, value=12.66)
9
  Product_Sugar_Content = st.selectbox("Product Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
10
+ Product_Allocated_Area = st.number_input("Product Allocated Area (sq.ft)", min_value=0.0)
11
+ Product_MRP = st.number_input("Product MRP (₹)", min_value=0.0)
12
+ Store_Size = st.selectbox("Store Size", ["Small", "Medium", "High"])
13
+ Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 1", "Tier 2", "Tier 3"])
14
+ Store_Type = st.selectbox("Store Type", ["Supermarket", "Grocery", "Convenience", "Department"])
15
+ Product_Id_char = st.text_input("Product ID Character")
16
+ Store_Age_Years = st.number_input("Store Age (Years)", min_value=0)
17
+ Product_Type_Category = st.selectbox("Product Type Category", ["Food", "Non-Consumable", "Drinks"])
18
 
19
  product_data = {
20
  "Product_Weight": Product_Weight,
 
29
  "Product_Type_Category": Product_Type_Category
30
  }
31
 
32
+ if st.button("Predict", type='primary'):
33
  response = requests.post(
34
+ "https://MichaelNieto-superkart_backend.hf.space/v1/predict",
35
  json=product_data
36
  )
37
  if response.status_code == 200:
38
  result = response.json()
39
  predicted_sales = result["Sales"]
40
+ st.write(f"Predicted Product Store Sales Total: {predicted_sales:.2f}")
41
  else:
42
  st.error("Error in API request")
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- streamlit==1.32.2
2
  requests==2.32.3
 
 
 
1
  requests==2.32.3
2
+ streamlit==1.43.2