Jegree commited on
Commit
1fc823d
·
verified ·
1 Parent(s): f4e6b6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -76,6 +76,8 @@ if "question_no" not in st.session_state:
76
 
77
  st.title(f"Know your diabetic status")
78
  if st.session_state.question_no == 1:
 
 
79
  name = st.text_input(f"What is your name?", key=st.session_state.question_no,placeholder="Type your answer here")
80
 
81
  if st.button("Next->"):
@@ -86,6 +88,7 @@ if st.session_state.question_no == 1:
86
  st.session_state.question_no += 1
87
 
88
  elif st.session_state.question_no == 2:
 
89
  age = st.text_input(f"How old are you?", key=st.session_state.question_no, placeholder="Type your answer")
90
  if st.button("Next->"):
91
  if not is_number(age):
@@ -95,6 +98,7 @@ elif st.session_state.question_no == 2:
95
  st.session_state.question_no += 1
96
 
97
  elif st.session_state.question_no == 3:
 
98
  gender = st.selectbox(f"What is your gender?", ["Male", "Female", "Other"], key=st.session_state.question_no)
99
  if st.button("Next->"):
100
  st.session_state.gender = gender
@@ -105,6 +109,7 @@ elif st.session_state.question_no == 3:
105
  st.session_state.question_no += 1
106
 
107
  elif st.session_state.question_no == 4:
 
108
  pregnancies = st.text_input(f"How many times have you been pregnant?", key=st.session_state.question_no)
109
  if st.button("Next->"):
110
  if not is_number(pregnancies):
@@ -114,6 +119,7 @@ elif st.session_state.question_no == 4:
114
  st.session_state.question_no += 1
115
 
116
  elif st.session_state.question_no == 5:
 
117
  glucose = st.text_input(f"{st.session_state.question_no}Enter your glucose level", key=st.session_state.question_no)
118
  if st.button("Next->"):
119
  if not is_number(glucose):
@@ -123,6 +129,7 @@ elif st.session_state.question_no == 5:
123
  st.session_state.question_no += 1
124
 
125
  elif st.session_state.question_no == 6:
 
126
  bp = st.text_input(f"Enter your blood pressure", key=st.session_state.question_no)
127
  if st.button("Next->"):
128
  if not is_number(bp):
@@ -132,6 +139,7 @@ elif st.session_state.question_no == 6:
132
  st.session_state.question_no += 1
133
 
134
  elif st.session_state.question_no == 7:
 
135
  height = st.text_input(f"Enter your height in cm:")
136
  if st.button("Next->"):
137
  if not is_number(height):
@@ -141,6 +149,7 @@ elif st.session_state.question_no == 7:
141
  st.session_state.question_no += 1
142
 
143
  elif st.session_state.question_no == 8:
 
144
  weight = st.text_input(f"{st.session_state.question_no}Enter your weight in KG")
145
  if st.button("Next->"):
146
  if not is_number(weight):
@@ -151,6 +160,7 @@ elif st.session_state.question_no == 8:
151
  st.session_state.question_no += 1
152
 
153
  elif st.session_state.question_no == 9:
 
154
  st.write("Select the members with diabetes in your family")
155
  diabeticMother = st.checkbox("Mother")
156
  diabeticFather = st.checkbox("Father")
@@ -167,7 +177,7 @@ elif st.session_state.question_no == 9:
167
 
168
  elif st.session_state.question_no == 10:
169
 
170
-
171
  input_name = scalerSession.get_inputs()[0].name
172
 
173
  # Transform the new data using the ONNX scaler
 
76
 
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"{st.session_state.question_no}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"{st.session_state.question_no}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