karora1804 commited on
Commit
56f8edf
·
verified ·
1 Parent(s): 9018fec

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +1 -29
app.py CHANGED
@@ -37,37 +37,9 @@ input_data = {
37
  'store_type': store_type
38
  }
39
 
40
- # Convert user input into a DataFrame
41
- input_data_1 = pd.DataFrame([{
42
- 'Product_Weight': product_weight,
43
- 'Product_Sugar_Content': product_sugar_content,
44
- 'Product_Allocated_Area': product_allocated_area,
45
- 'Product_Type': product_type,
46
- 'Product_MRP': product_mrp,
47
- 'Store_Id': store_id,
48
- 'Store_Establishment_Year': store_establishment_year,
49
- 'Store_Size': store_size,
50
- 'Store_Location_City_Type': store_location_city_type,
51
- 'Store_Type': store_type
52
- }])
53
-
54
- input_data_2 = {
55
- "Product_Weight":5,
56
- "Product_Sugar_Content":"Low Sugar",
57
- "Product_Allocated_Area":0.01,
58
- "Product_Type":"Frozen Foods",
59
- "Product_MRP":50,
60
- "Store_Id":"OUT001",
61
- "Store_Establishment_Year":"1987",
62
- "Store_Size":"Small",
63
- "Store_Location_City_Type":"Tier 1",
64
- "Store_Type":"Supermarket Type1",
65
- }
66
- input_data_1 = input_data_1.to_dict(orient='records')[0]
67
- st.write("input_data_2:", input_data_2)
68
  # Make prediction when the "Predict" button is clicked
69
  if st.button("Predict"):
70
- response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSales", json=input_data_2) # Send data to Flask API
71
  if response.status_code == 200:
72
  prediction = response.json()['Predicted Total Sales:']
73
  st.success(f"Predicted Store Total Sales: {prediction}")
 
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}")