Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,8 +35,8 @@ input_data = {
|
|
| 35 |
if st.button("Predict"):
|
| 36 |
try:
|
| 37 |
response = requests.post(
|
| 38 |
-
|
| 39 |
-
|
| 40 |
)
|
| 41 |
if response.status_code == 200:
|
| 42 |
prediction = response.json()['Predicted Sales '] # Adjust key if needed
|
|
@@ -44,6 +44,6 @@ if st.button("Predict"):
|
|
| 44 |
else:
|
| 45 |
st.error(f"Prediction failed: {response.status_code}")
|
| 46 |
except Exception as e:
|
| 47 |
-
|
| 48 |
|
| 49 |
|
|
|
|
| 35 |
if st.button("Predict"):
|
| 36 |
try:
|
| 37 |
response = requests.post(
|
| 38 |
+
"https://maddykan101-SalesPredictionBackend.hf.space/v1/prediction",
|
| 39 |
+
json=input_data
|
| 40 |
)
|
| 41 |
if response.status_code == 200:
|
| 42 |
prediction = response.json()['Predicted Sales '] # Adjust key if needed
|
|
|
|
| 44 |
else:
|
| 45 |
st.error(f"Prediction failed: {response.status_code}")
|
| 46 |
except Exception as e:
|
| 47 |
+
st.error(f"An error occurred: {str(e)}")
|
| 48 |
|
| 49 |
|