Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -44,10 +44,10 @@ input_data = pd.DataFrame([{
|
|
| 44 |
if st.button("Predict"):
|
| 45 |
response = requests.post("https://cheeka84-SalesPredictionBackend.hf.space/v1/sales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 46 |
if response.status_code == 200:
|
| 47 |
-
prediction = response.json()['Predicted
|
| 48 |
-
st.success(f"Predicted
|
| 49 |
else:
|
| 50 |
-
st.error(
|
| 51 |
|
| 52 |
# Section for batch prediction
|
| 53 |
st.subheader("Batch Prediction")
|
|
|
|
| 44 |
if st.button("Predict"):
|
| 45 |
response = requests.post("https://cheeka84-SalesPredictionBackend.hf.space/v1/sales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 46 |
if response.status_code == 200:
|
| 47 |
+
prediction = response.json()['Predicted Sales (in dollars)']
|
| 48 |
+
st.success(f"Predicted Sales (in dollars): {prediction}")
|
| 49 |
else:
|
| 50 |
+
st.error(response.status_code)
|
| 51 |
|
| 52 |
# Section for batch prediction
|
| 53 |
st.subheader("Batch Prediction")
|