Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ if "question_no" not in st.session_state:
|
|
77 |
st.title(f"Know your diabetic status")
|
78 |
if st.session_state.question_no == 1:
|
79 |
|
80 |
-
progress = st.progress((st.session_state.question_no) / 10
|
81 |
name = st.text_input(f"What is your name?", key=st.session_state.question_no,placeholder="Type your answer here")
|
82 |
|
83 |
if st.button("Next->"):
|
@@ -88,7 +88,7 @@ if st.session_state.question_no == 1:
|
|
88 |
st.session_state.question_no += 1
|
89 |
|
90 |
elif st.session_state.question_no == 2:
|
91 |
-
progress = st.progress((st.session_state.question_no) / 10
|
92 |
age = st.text_input(f"How old are you?", key=st.session_state.question_no, placeholder="Type your answer")
|
93 |
if st.button("Next->"):
|
94 |
if not is_number(age):
|
@@ -98,7 +98,7 @@ elif st.session_state.question_no == 2:
|
|
98 |
st.session_state.question_no += 1
|
99 |
|
100 |
elif st.session_state.question_no == 3:
|
101 |
-
progress = st.progress((st.session_state.question_no) / 10
|
102 |
gender = st.selectbox(f"What is your gender?", ["Male", "Female", "Other"], key=st.session_state.question_no)
|
103 |
if st.button("Next->"):
|
104 |
st.session_state.gender = gender
|
@@ -109,7 +109,7 @@ elif st.session_state.question_no == 3:
|
|
109 |
st.session_state.question_no += 1
|
110 |
|
111 |
elif st.session_state.question_no == 4:
|
112 |
-
progress = st.progress((st.session_state.question_no) / 10
|
113 |
pregnancies = st.text_input(f"How many times have you been pregnant?", key=st.session_state.question_no)
|
114 |
if st.button("Next->"):
|
115 |
if not is_number(pregnancies):
|
@@ -119,7 +119,7 @@ elif st.session_state.question_no == 4:
|
|
119 |
st.session_state.question_no += 1
|
120 |
|
121 |
elif st.session_state.question_no == 5:
|
122 |
-
progress = st.progress((st.session_state.question_no) / 10
|
123 |
glucose = st.text_input(f"Enter your glucose level", key=st.session_state.question_no)
|
124 |
if st.button("Next->"):
|
125 |
if not is_number(glucose):
|
@@ -129,7 +129,7 @@ elif st.session_state.question_no == 5:
|
|
129 |
st.session_state.question_no += 1
|
130 |
|
131 |
elif st.session_state.question_no == 6:
|
132 |
-
progress = st.progress((st.session_state.question_no) / 10
|
133 |
bp = st.text_input(f"Enter your blood pressure", key=st.session_state.question_no)
|
134 |
if st.button("Next->"):
|
135 |
if not is_number(bp):
|
@@ -139,7 +139,7 @@ elif st.session_state.question_no == 6:
|
|
139 |
st.session_state.question_no += 1
|
140 |
|
141 |
elif st.session_state.question_no == 7:
|
142 |
-
progress = st.progress((st.session_state.question_no) / 10
|
143 |
height = st.text_input(f"Enter your height in cm:")
|
144 |
if st.button("Next->"):
|
145 |
if not is_number(height):
|
@@ -149,7 +149,7 @@ elif st.session_state.question_no == 7:
|
|
149 |
st.session_state.question_no += 1
|
150 |
|
151 |
elif st.session_state.question_no == 8:
|
152 |
-
progress = st.progress((st.session_state.question_no) / 10
|
153 |
weight = st.text_input(f"Enter your weight in KG")
|
154 |
if st.button("Next->"):
|
155 |
if not is_number(weight):
|
@@ -160,7 +160,7 @@ elif st.session_state.question_no == 8:
|
|
160 |
st.session_state.question_no += 1
|
161 |
|
162 |
elif st.session_state.question_no == 9:
|
163 |
-
progress = st.progress((st.session_state.question_no) / 10
|
164 |
st.write("Select the members with diabetes in your family")
|
165 |
diabeticMother = st.checkbox("Mother")
|
166 |
diabeticFather = st.checkbox("Father")
|
@@ -177,7 +177,7 @@ elif st.session_state.question_no == 9:
|
|
177 |
|
178 |
elif st.session_state.question_no == 10:
|
179 |
|
180 |
-
progress = st.progress((st.session_state.question_no) / 10
|
181 |
input_name = scalerSession.get_inputs()[0].name
|
182 |
|
183 |
# Transform the new data using the ONNX scaler
|
|
|
77 |
st.title(f"Know your diabetic status")
|
78 |
if st.session_state.question_no == 1:
|
79 |
|
80 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
81 |
name = st.text_input(f"What is your name?", key=st.session_state.question_no,placeholder="Type your answer here")
|
82 |
|
83 |
if st.button("Next->"):
|
|
|
88 |
st.session_state.question_no += 1
|
89 |
|
90 |
elif st.session_state.question_no == 2:
|
91 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
92 |
age = st.text_input(f"How old are you?", key=st.session_state.question_no, placeholder="Type your answer")
|
93 |
if st.button("Next->"):
|
94 |
if not is_number(age):
|
|
|
98 |
st.session_state.question_no += 1
|
99 |
|
100 |
elif st.session_state.question_no == 3:
|
101 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
102 |
gender = st.selectbox(f"What is your gender?", ["Male", "Female", "Other"], key=st.session_state.question_no)
|
103 |
if st.button("Next->"):
|
104 |
st.session_state.gender = gender
|
|
|
109 |
st.session_state.question_no += 1
|
110 |
|
111 |
elif st.session_state.question_no == 4:
|
112 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
113 |
pregnancies = st.text_input(f"How many times have you been pregnant?", key=st.session_state.question_no)
|
114 |
if st.button("Next->"):
|
115 |
if not is_number(pregnancies):
|
|
|
119 |
st.session_state.question_no += 1
|
120 |
|
121 |
elif st.session_state.question_no == 5:
|
122 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
123 |
glucose = st.text_input(f"Enter your glucose level", key=st.session_state.question_no)
|
124 |
if st.button("Next->"):
|
125 |
if not is_number(glucose):
|
|
|
129 |
st.session_state.question_no += 1
|
130 |
|
131 |
elif st.session_state.question_no == 6:
|
132 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
133 |
bp = st.text_input(f"Enter your blood pressure", key=st.session_state.question_no)
|
134 |
if st.button("Next->"):
|
135 |
if not is_number(bp):
|
|
|
139 |
st.session_state.question_no += 1
|
140 |
|
141 |
elif st.session_state.question_no == 7:
|
142 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
143 |
height = st.text_input(f"Enter your height in cm:")
|
144 |
if st.button("Next->"):
|
145 |
if not is_number(height):
|
|
|
149 |
st.session_state.question_no += 1
|
150 |
|
151 |
elif st.session_state.question_no == 8:
|
152 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
153 |
weight = st.text_input(f"Enter your weight in KG")
|
154 |
if st.button("Next->"):
|
155 |
if not is_number(weight):
|
|
|
160 |
st.session_state.question_no += 1
|
161 |
|
162 |
elif st.session_state.question_no == 9:
|
163 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
164 |
st.write("Select the members with diabetes in your family")
|
165 |
diabeticMother = st.checkbox("Mother")
|
166 |
diabeticFather = st.checkbox("Father")
|
|
|
177 |
|
178 |
elif st.session_state.question_no == 10:
|
179 |
|
180 |
+
progress = st.progress((st.session_state.question_no) / 10)
|
181 |
input_name = scalerSession.get_inputs()[0].name
|
182 |
|
183 |
# Transform the new data using the ONNX scaler
|