karora1804 commited on
Commit
24693a4
·
verified ·
1 Parent(s): 2f7d4f4

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -24,22 +24,22 @@ store_type = st.selectbox("Store Type ", ["Supermarket Type1", "Supermarket Type
24
 
25
 
26
  # Convert user input into a DataFrame
27
- input_data = pd.DataFrame([{
28
- 'Product_Weight': product_weight,
29
- 'Product_Sugar_Content': product_sugar_content,
30
- 'Product_Allocated_Area': product_allocated_area,
31
- 'Product_Type': product_type,
32
- 'Product_MRP': product_mrp,
33
- 'Store_Id': store_id,
34
- 'Store_Establishment_Year': store_establishment_year,
35
- 'Store_Size': store_size,
36
- 'Store_Location_City_Type': store_location_city_type,
37
- 'Store_Type': store_type
38
- }])
39
 
40
  # Make prediction when the "Predict" button is clicked
41
  if st.button("Predict"):
42
- response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
43
  if response.status_code == 200:
44
  prediction = response.json()['Predicted Total Sales:']
45
  st.success(f"Predicted Store Total Sales: {prediction}")
 
24
 
25
 
26
  # Convert user input into a DataFrame
27
+ input_data = {
28
+ 'product_weight': product_weight,
29
+ 'product_sugar_content': product_sugar_content,
30
+ 'product_allocated_area': product_allocated_area,
31
+ 'product_type': product_type,
32
+ 'product_mrp': product_mrp,
33
+ 'store_id': store_id,
34
+ 'store_establishment_year': store_establishment_year,
35
+ 'store_size': store_size,
36
+ 'store_location_city_type': store_location_city_type,
37
+ 'store_type': store_type
38
+ }
39
 
40
  # Make prediction when the "Predict" button is clicked
41
  if st.button("Predict"):
42
+ response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSales", json=input_data) # Send data to Flask API
43
  if response.status_code == 200:
44
  prediction = response.json()['Predicted Total Sales:']
45
  st.success(f"Predicted Store Total Sales: {prediction}")