Upload folder using huggingface_hub
Browse files
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 =
|
| 28 |
-
'
|
| 29 |
-
'
|
| 30 |
-
'
|
| 31 |
-
'
|
| 32 |
-
'
|
| 33 |
-
'
|
| 34 |
-
'
|
| 35 |
-
'
|
| 36 |
-
'
|
| 37 |
-
'
|
| 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
|
| 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}")
|