Quantum9999 commited on
Commit
05637c2
·
verified ·
1 Parent(s): a8ead6d

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -25,7 +25,7 @@ Product_Sugar_Content = st.selectbox("Product Sugar Content", ["Low Sugar", "Reg
25
  Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 2", "Tier 1", "Tier 3"])
26
  Store_Size = st.selectbox("Store Size", ["Medium", "High", "Small"])
27
  Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.0, value=50.0, step=1.0)
28
- Product_id = st.text_input("Product ID (Unique Code)", "FD6114")
29
  Store_Type = st.selectbox("Store Type", ["Supermarket Type2", "Supermarket Type1", "Departmental Store", "Food Mart"])
30
 
31
  # Convert user input into DataFrame
@@ -39,7 +39,7 @@ input_data = pd.DataFrame([{
39
  'Store_Location_City_Type': Store_Location_City_Type,
40
  'Store_Size': Store_Size,
41
  'Product_Allocated_Area': Product_Allocated_Area,
42
- 'Product_id': Product_id,
43
  'Store_Type': Store_Type
44
  }])
45
 
@@ -69,8 +69,8 @@ if uploaded_file is not None:
69
  files={"file": uploaded_file}
70
  )
71
  if response.status_code == 200:
72
- predictions = response.json()
73
- st.success("Batch predictions completed!")
74
- st.write(predictions)
75
  else:
76
- st.error("Error making batch prediction.")
 
 
25
  Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 2", "Tier 1", "Tier 3"])
26
  Store_Size = st.selectbox("Store Size", ["Medium", "High", "Small"])
27
  Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.0, value=50.0, step=1.0)
28
+ Product_Id = st.text_input("Product ID (Unique Code)", "FD6114")
29
  Store_Type = st.selectbox("Store Type", ["Supermarket Type2", "Supermarket Type1", "Departmental Store", "Food Mart"])
30
 
31
  # Convert user input into DataFrame
 
39
  'Store_Location_City_Type': Store_Location_City_Type,
40
  'Store_Size': Store_Size,
41
  'Product_Allocated_Area': Product_Allocated_Area,
42
+ 'Product_Id': Product_Id,
43
  'Store_Type': Store_Type
44
  }])
45
 
 
69
  files={"file": uploaded_file}
70
  )
71
  if response.status_code == 200:
72
+ prediction = response.json()['Predicted_Sales']
73
+ st.success(f"Predicted Sales: {prediction}")
 
74
  else:
75
+ st.error(f"Error making prediction: {response.text}")
76
+