shubham680 commited on
Commit
fb13bc5
ยท
verified ยท
1 Parent(s): b76e765

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -213,28 +213,28 @@ with st.container():
213
 
214
  st.markdown("</div>", unsafe_allow_html=True) # Close glass card
215
 
216
- #--------- Prediction Button ---------
217
- with st.container():
218
- with st.container():
219
- predict_btn = st.container()
220
- with predict_btn:
221
- if st.button("๐Ÿ” Predict", key="predict", help="Click to see your personality"):
222
- prediction = knn.predict(final_input)[0]
223
- label = prediction_labels.get(prediction, "โ“ Unknown")
224
- st.markdown(f"<div class='result-box'>๐Ÿ”ฎ Predicted Personality: <strong>{label}</strong></div>", unsafe_allow_html=True)
225
-
226
-
227
- # # --- Prediction Button & Result ---
228
- # result_placeholder = st.empty() # ๐Ÿ‘ˆ Reserve space near the button
229
-
230
- # if st.button("๐Ÿ” Predict", key="predict", help="Click to see your personality"):
231
- # prediction = knn.predict(final_input)[0]
232
- # label = prediction_labels.get(prediction, "โ“ Unknown")
233
-
234
- # result_html = f"""
235
- # <div class='result-box'>
236
- # ๐Ÿ”ฎ <strong>Predicted Personality:</strong> {label}
237
- # </div>
238
- # """
239
- # result_placeholder.markdown(result_html, unsafe_allow_html=True) # ๐Ÿ‘ˆ result shows instantly in place
240
 
 
213
 
214
  st.markdown("</div>", unsafe_allow_html=True) # Close glass card
215
 
216
+ # #--------- Prediction Button ---------
217
+ # with st.container():
218
+ # with st.container():
219
+ # predict_btn = st.container()
220
+ # with predict_btn:
221
+ # if st.button("๐Ÿ” Predict", key="predict", help="Click to see your personality"):
222
+ # prediction = knn.predict(final_input)[0]
223
+ # label = prediction_labels.get(prediction, "โ“ Unknown")
224
+ # st.markdown(f"<div class='result-box'>๐Ÿ”ฎ Predicted Personality: <strong>{label}</strong></div>", unsafe_allow_html=True)
225
+
226
+
227
+ # --- Prediction Button & Result ---
228
+ result_placeholder = st.empty() # ๐Ÿ‘ˆ Reserve space near the button
229
+
230
+ if st.button("๐Ÿ” Predict", key="predict", help="Click to see your personality"):
231
+ prediction = knn.predict(final_input)[0]
232
+ label = prediction_labels.get(prediction, "โ“ Unknown")
233
+
234
+ result_html = f"""
235
+ <div class='result-box'>
236
+ ๐Ÿ”ฎ <strong>Predicted Personality:</strong> {label}
237
+ </div>
238
+ """
239
+ result_placeholder.markdown(result_html, unsafe_allow_html=True) # ๐Ÿ‘ˆ result shows instantly in place
240