Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
|
@@ -59,7 +59,7 @@ if st.button("Predict Sales"):
|
|
| 59 |
st.subheader("π Raw Backend Response")
|
| 60 |
st.json(result) # SHOW FULL JSON RETURNED
|
| 61 |
|
| 62 |
-
prediction = result.get("
|
| 63 |
except ValueError:
|
| 64 |
prediction = response.text
|
| 65 |
st.warning("β Backend did not return JSON, showing raw text:")
|
|
@@ -67,7 +67,7 @@ if st.button("Predict Sales"):
|
|
| 67 |
|
| 68 |
try:
|
| 69 |
prediction = float(prediction)
|
| 70 |
-
st.success(f"β
Predicted Sales: **{
|
| 71 |
except (ValueError, TypeError):
|
| 72 |
st.error(f"β Could not convert prediction to number: {prediction}")
|
| 73 |
else:
|
|
|
|
| 59 |
st.subheader("π Raw Backend Response")
|
| 60 |
st.json(result) # SHOW FULL JSON RETURNED
|
| 61 |
|
| 62 |
+
prediction = result.get("Predicted_Sales", None)
|
| 63 |
except ValueError:
|
| 64 |
prediction = response.text
|
| 65 |
st.warning("β Backend did not return JSON, showing raw text:")
|
|
|
|
| 67 |
|
| 68 |
try:
|
| 69 |
prediction = float(prediction)
|
| 70 |
+
st.success(f"β
Predicted Sales: **{prediction:.2f} units**")
|
| 71 |
except (ValueError, TypeError):
|
| 72 |
st.error(f"β Could not convert prediction to number: {prediction}")
|
| 73 |
else:
|