Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -51,11 +51,23 @@ input_data_1 = pd.DataFrame([{
|
|
| 51 |
'Store_Type': store_type
|
| 52 |
}])
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
input_data_1 = input_data_1.to_dict(orient='records')[0]
|
| 55 |
st.write("Json input:", input_data_1)
|
| 56 |
# Make prediction when the "Predict" button is clicked
|
| 57 |
if st.button("Predict"):
|
| 58 |
-
response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSales", json=
|
| 59 |
if response.status_code == 200:
|
| 60 |
prediction = response.json()['Predicted Total Sales:']
|
| 61 |
st.success(f"Predicted Store Total Sales: {prediction}")
|
|
|
|
| 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("Json input:", input_data_1)
|
| 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}")
|