Jegree commited on
Commit
3e0e420
·
verified ·
1 Parent(s): 2609dac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -78,7 +78,7 @@ if st.session_state.question_no == 2:
78
  st.rerun()
79
 
80
  elif st.session_state.question_no == 3:
81
- progress = st.progress((st.session_state.question_no) / 8)
82
  gender = st.selectbox(f"What is your gender?", ["Male", "Female", "Other"], key=st.session_state.question_no)
83
  if st.button("Next->"):
84
  st.session_state.gender = gender
@@ -90,7 +90,7 @@ elif st.session_state.question_no == 3:
90
  st.rerun()
91
 
92
  elif st.session_state.question_no == 4:
93
- progress = st.progress((st.session_state.question_no) / 8)
94
  pregnancies = st.text_input(f"How many times have you been pregnant?", key=st.session_state.question_no)
95
  if st.button("Next->"):
96
  if not is_number(pregnancies):
@@ -101,7 +101,7 @@ elif st.session_state.question_no == 4:
101
  st.rerun()
102
 
103
  elif st.session_state.question_no == 5:
104
- progress = st.progress((st.session_state.question_no) / 8)
105
  glucose = st.text_input(f"Enter your glucose level", key=st.session_state.question_no)
106
  if st.button("Next->"):
107
  if not is_number(glucose):
@@ -112,7 +112,7 @@ elif st.session_state.question_no == 5:
112
  st.rerun()
113
 
114
  elif st.session_state.question_no == 6:
115
- progress = st.progress((st.session_state.question_no) / 8)
116
  bp = st.text_input(f"Enter your blood pressure", key=st.session_state.question_no)
117
  if st.button("Next->"):
118
  if not is_number(bp):
@@ -123,7 +123,7 @@ elif st.session_state.question_no == 6:
123
  st.rerun()
124
 
125
  elif st.session_state.question_no == 7:
126
- progress = st.progress((st.session_state.question_no) / 8)
127
  height = st.text_input(f"Enter your height in cm:")
128
  if st.button("Next->"):
129
  if not is_number(height):
@@ -134,7 +134,7 @@ elif st.session_state.question_no == 7:
134
  st.rerun()
135
 
136
  elif st.session_state.question_no == 8:
137
- progress = st.progress((st.session_state.question_no) / 8)
138
  weight = st.text_input(f"Enter your weight in KG")
139
  if st.button("Next->"):
140
  if not is_number(weight):
@@ -146,7 +146,7 @@ elif st.session_state.question_no == 8:
146
  st.rerun()
147
 
148
  elif st.session_state.question_no == 9:
149
- progress = st.progress((st.session_state.question_no) / 8)
150
  st.write("Select the members with diabetes in your family")
151
  diabeticMother = st.checkbox("Mother")
152
  diabeticFather = st.checkbox("Father")
@@ -164,7 +164,7 @@ elif st.session_state.question_no == 9:
164
 
165
  elif st.session_state.question_no == 10:
166
 
167
- progress = st.progress((st.session_state.question_no) / 8)
168
  input_name = scalerSession.get_inputs()[0].name
169
 
170
  # Transform the new data using the ONNX scaler
 
78
  st.rerun()
79
 
80
  elif st.session_state.question_no == 3:
81
+ progress = st.progress((st.session_state.question_no -2 )/ 8)
82
  gender = st.selectbox(f"What is your gender?", ["Male", "Female", "Other"], key=st.session_state.question_no)
83
  if st.button("Next->"):
84
  st.session_state.gender = gender
 
90
  st.rerun()
91
 
92
  elif st.session_state.question_no == 4:
93
+ progress = st.progress((st.session_state.question_no - 2) / 8)
94
  pregnancies = st.text_input(f"How many times have you been pregnant?", key=st.session_state.question_no)
95
  if st.button("Next->"):
96
  if not is_number(pregnancies):
 
101
  st.rerun()
102
 
103
  elif st.session_state.question_no == 5:
104
+ progress = st.progress((st.session_state.question_no -2) / 8)
105
  glucose = st.text_input(f"Enter your glucose level", key=st.session_state.question_no)
106
  if st.button("Next->"):
107
  if not is_number(glucose):
 
112
  st.rerun()
113
 
114
  elif st.session_state.question_no == 6:
115
+ progress = st.progress((st.session_state.question_no-2) / 8)
116
  bp = st.text_input(f"Enter your blood pressure", key=st.session_state.question_no)
117
  if st.button("Next->"):
118
  if not is_number(bp):
 
123
  st.rerun()
124
 
125
  elif st.session_state.question_no == 7:
126
+ progress = st.progress((st.session_state.question_no-2) / 8)
127
  height = st.text_input(f"Enter your height in cm:")
128
  if st.button("Next->"):
129
  if not is_number(height):
 
134
  st.rerun()
135
 
136
  elif st.session_state.question_no == 8:
137
+ progress = st.progress((st.session_state.question_no-2) / 8)
138
  weight = st.text_input(f"Enter your weight in KG")
139
  if st.button("Next->"):
140
  if not is_number(weight):
 
146
  st.rerun()
147
 
148
  elif st.session_state.question_no == 9:
149
+ progress = st.progress((st.session_state.question_no-2) / 8)
150
  st.write("Select the members with diabetes in your family")
151
  diabeticMother = st.checkbox("Mother")
152
  diabeticFather = st.checkbox("Father")
 
164
 
165
  elif st.session_state.question_no == 10:
166
 
167
+ progress = st.progress((st.session_state.question_no-2) / 8)
168
  input_name = scalerSession.get_inputs()[0].name
169
 
170
  # Transform the new data using the ONNX scaler