Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
-
import json
|
4 |
|
5 |
st.title("Predictive Model App")
|
6 |
|
@@ -29,10 +28,12 @@ if st.button("Predict"):
|
|
29 |
# Parse the response and display the result
|
30 |
if response.status_code == 200:
|
31 |
result_data = response.json()
|
32 |
-
|
|
|
|
|
|
|
33 |
else:
|
34 |
st.error(f"API Error: {response.status_code}. {response.text}")
|
35 |
|
36 |
except Exception as e:
|
37 |
st.error(f"Error: {e}")
|
38 |
-
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
|
|
3 |
|
4 |
st.title("Predictive Model App")
|
5 |
|
|
|
28 |
# Parse the response and display the result
|
29 |
if response.status_code == 200:
|
30 |
result_data = response.json()
|
31 |
+
|
32 |
+
# Display the result in a bigger font and inside a text box
|
33 |
+
st.markdown(f"## Result")
|
34 |
+
st.markdown(f"<div style='background-color: #f5f5f5; padding: 20px; border-radius: 5px;'><span style='font-size: 24px;'>{result_data.get('res')}</span></div>", unsafe_allow_html=True)
|
35 |
else:
|
36 |
st.error(f"API Error: {response.status_code}. {response.text}")
|
37 |
|
38 |
except Exception as e:
|
39 |
st.error(f"Error: {e}")
|
|