Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -22,19 +22,17 @@ Product_Type = st.selectbox(
|
|
| 22 |
)
|
| 23 |
Product_MRP = st.number_input("Product MRP (Maximum Retail Price)", min_value=0.0, step=0.5)
|
| 24 |
Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1900, max_value=2025, step=1, value=2000)
|
| 25 |
-
Store_Size = st.selectbox("Store Size", ["High", "Medium", "
|
| 26 |
Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 1", "Tier 2", "Tier 3"])
|
| 27 |
Store_Type = st.selectbox("Store Type", ["Departmental Store", "Supermarket Type 1", "Supermarket Type 2", "Food Mart"])
|
| 28 |
|
| 29 |
# Convert user input into a DataFrame
|
| 30 |
input_data = pd.DataFrame([{
|
| 31 |
-
'Product_Id': Product_Id,
|
| 32 |
'Product_Weight': Product_Weight,
|
| 33 |
'Product_Sugar_Content': Product_Sugar_Content,
|
| 34 |
'Product_Allocated_Area': Product_Allocated_Area,
|
| 35 |
'Product_Type': Product_Type,
|
| 36 |
'Product_MRP': Product_MRP,
|
| 37 |
-
'Store_Id': Store_Id,
|
| 38 |
'Store_Establishment_Year': Store_Establishment_Year,
|
| 39 |
'Store_Size': Store_Size,
|
| 40 |
'Store_Location_City_Type': Store_Location_City_Type,
|
|
@@ -45,7 +43,7 @@ input_data = pd.DataFrame([{
|
|
| 45 |
if st.button("Predict"):
|
| 46 |
response = requests.post("https://Anu159-SuperKartSalesForecastPredictionBackend.hf.space/v1/sales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 47 |
if response.status_code == 200:
|
| 48 |
-
prediction = response.json()['
|
| 49 |
st.success(f"Predicted Product Revenue (in dollars): {prediction}")
|
| 50 |
else:
|
| 51 |
st.error("Error making prediction.")
|
|
@@ -66,3 +64,4 @@ if uploaded_file is not None:
|
|
| 66 |
st.write(predictions) # Display the predictions
|
| 67 |
else:
|
| 68 |
st.error("Error making batch prediction.")
|
|
|
|
|
|
| 22 |
)
|
| 23 |
Product_MRP = st.number_input("Product MRP (Maximum Retail Price)", min_value=0.0, step=0.5)
|
| 24 |
Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1900, max_value=2025, step=1, value=2000)
|
| 25 |
+
Store_Size = st.selectbox("Store Size", ["High", "Medium", "Small"])
|
| 26 |
Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 1", "Tier 2", "Tier 3"])
|
| 27 |
Store_Type = st.selectbox("Store Type", ["Departmental Store", "Supermarket Type 1", "Supermarket Type 2", "Food Mart"])
|
| 28 |
|
| 29 |
# Convert user input into a DataFrame
|
| 30 |
input_data = pd.DataFrame([{
|
|
|
|
| 31 |
'Product_Weight': Product_Weight,
|
| 32 |
'Product_Sugar_Content': Product_Sugar_Content,
|
| 33 |
'Product_Allocated_Area': Product_Allocated_Area,
|
| 34 |
'Product_Type': Product_Type,
|
| 35 |
'Product_MRP': Product_MRP,
|
|
|
|
| 36 |
'Store_Establishment_Year': Store_Establishment_Year,
|
| 37 |
'Store_Size': Store_Size,
|
| 38 |
'Store_Location_City_Type': Store_Location_City_Type,
|
|
|
|
| 43 |
if st.button("Predict"):
|
| 44 |
response = requests.post("https://Anu159-SuperKartSalesForecastPredictionBackend.hf.space/v1/sales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 45 |
if response.status_code == 200:
|
| 46 |
+
prediction = response.json()['Predicted Price (in dollars)']
|
| 47 |
st.success(f"Predicted Product Revenue (in dollars): {prediction}")
|
| 48 |
else:
|
| 49 |
st.error("Error making prediction.")
|
|
|
|
| 64 |
st.write(predictions) # Display the predictions
|
| 65 |
else:
|
| 66 |
st.error("Error making batch prediction.")
|
| 67 |
+
|