TokenTutor commited on
Commit
9ef4a35
·
verified ·
1 Parent(s): 0fa1b98

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +29 -29
  2. requirements.txt +0 -1
app.py CHANGED
@@ -60,37 +60,37 @@ st.title("Product Revenue prediction")
60
  st.subheader("Online Prediction")
61
 
62
  #Collect user input for features
63
- Product_Weight = st.number_input("Product Weight", min_value=4.0, max_value=25.0, step=0.5)
64
- Product_Sugar_Content = st.selectbox("Product Sugar Content", ["No Sugar", "Low Sugar", "Regular"])
65
- Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.001, max_value=0.3)
66
- Product_Type = st.selectbox("Product Type", product_types)
67
- Product_MRP = st.number_input("Product MRP", min_value=30.0, max_value=300.0)
68
- Store_Id = st.selectbox("Store Id", store_ids)
69
- Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1988, max_value=2010, step=1)
70
- Store_Size = st.selectbox("Store Size", store_sizes)
71
- Store_Location_City_Type = st.selectbox("Store Location City Type", store_Location_City_Types)
72
- Store_Type = st.selectbox("Store Type", store_types)
73
 
74
- payload = {
75
- 'Product_Weight': Product_Weight,
76
- 'Product_Sugar_Content': Product_Sugar_Content,
77
- 'Product_Allocated_Area': Product_Allocated_Area,
78
- 'Product_Type': Product_Type ,
79
- 'Product_MRP': Product_MRP,
80
- 'Store_Id': Store_Id,
81
- 'Store_Establishment_Year': Store_Establishment_Year,
82
- 'Store_Size': Store_Size,
83
- 'Store_Location_City_Type': Store_Location_City_Type,
84
- 'Store_Type': Store_Type
85
- }
86
 
87
 
88
- if st.button("Predict"):
89
- response = requests.post(API_ENDPOINT, json=payload)
90
- if response.status_code == 200:
91
- json_data= response.json()
92
- st.write('Predicted Sales revenue ', json_data.get('Prediction'))
93
- else:
94
- st.write(f"Error making prediction: {response.status_code}")
95
 
96
 
 
60
  st.subheader("Online Prediction")
61
 
62
  #Collect user input for features
63
+ # Product_Weight = st.number_input("Product Weight", min_value=4.0, max_value=25.0, step=0.5)
64
+ # Product_Sugar_Content = st.selectbox("Product Sugar Content", ["No Sugar", "Low Sugar", "Regular"])
65
+ # Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.001, max_value=0.3)
66
+ # Product_Type = st.selectbox("Product Type", product_types)
67
+ # Product_MRP = st.number_input("Product MRP", min_value=30.0, max_value=300.0)
68
+ # Store_Id = st.selectbox("Store Id", store_ids)
69
+ # Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1988, max_value=2010, step=1)
70
+ # Store_Size = st.selectbox("Store Size", store_sizes)
71
+ # Store_Location_City_Type = st.selectbox("Store Location City Type", store_Location_City_Types)
72
+ # Store_Type = st.selectbox("Store Type", store_types)
73
 
74
+ # payload = {
75
+ # 'Product_Weight': Product_Weight,
76
+ # 'Product_Sugar_Content': Product_Sugar_Content,
77
+ # 'Product_Allocated_Area': Product_Allocated_Area,
78
+ # 'Product_Type': Product_Type ,
79
+ # 'Product_MRP': Product_MRP,
80
+ # 'Store_Id': Store_Id,
81
+ # 'Store_Establishment_Year': Store_Establishment_Year,
82
+ # 'Store_Size': Store_Size,
83
+ # 'Store_Location_City_Type': Store_Location_City_Type,
84
+ # 'Store_Type': Store_Type
85
+ # }
86
 
87
 
88
+ # if st.button("Predict"):
89
+ # response = requests.post(API_ENDPOINT, json=payload)
90
+ # if response.status_code == 200:
91
+ # json_data= response.json()
92
+ # st.write('Predicted Sales revenue ', json_data.get('Prediction'))
93
+ # else:
94
+ # st.write(f"Error making prediction: {response.status_code}")
95
 
96
 
requirements.txt CHANGED
@@ -2,5 +2,4 @@ pandas==2.2.2
2
  numpy==2.0.2
3
  scikit-learn==1.6.1
4
  requests==2.28.1
5
- joblib==1.4.2
6
  streamlit==1.43.2
 
2
  numpy==2.0.2
3
  scikit-learn==1.6.1
4
  requests==2.28.1
 
5
  streamlit==1.43.2