ankanghosh commited on
Commit
2dcc9f9
·
verified ·
1 Parent(s): fa625c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -190,16 +190,14 @@ div.stInfo {
190
  # Centered button layout without columns
191
  _, center_col, _ = st.columns([1, 2, 1]) # Create a wider center column
192
  with center_col: # Put everything in the center column
193
- if st.session_state.show_acknowledgment:
194
- st.markdown('<div class="thank-you-button">', unsafe_allow_html=True)
195
- if st.button("Hide Thank You Note", on_click=toggle_acknowledgment, disabled=st.session_state.is_processing, use_container_width=True):
196
- pass
197
- st.markdown('</div>', unsafe_allow_html=True)
198
- else:
199
- st.markdown('<div class="thank-you-button">', unsafe_allow_html=True)
200
- if st.button("Show Thank You Note", on_click=toggle_acknowledgment, disabled=st.session_state.is_processing, use_container_width=True):
201
- pass
202
- st.markdown('</div>', unsafe_allow_html=True)
203
 
204
  # Preload resources during initialization
205
  # This ensures the model, index, and data are loaded before the user interacts with the app
@@ -320,7 +318,7 @@ common_questions = [
320
  st.markdown("### Few questions to try:")
321
 
322
  # Group questions into rows and create buttons (disabled if processing)
323
- question_rows = group_buttons(common_questions, max_chars_per_row=80)
324
  for row_idx, row in enumerate(question_rows):
325
  cols = st.columns(len(row))
326
  for i, (col, q) in enumerate(zip(cols, row)):
 
190
  # Centered button layout without columns
191
  _, center_col, _ = st.columns([1, 2, 1]) # Create a wider center column
192
  with center_col: # Put everything in the center column
193
+ st.markdown('<div class="thank-you-button">', unsafe_allow_html=True)
194
+
195
+ button_text = "Hide Thank You Note" if st.session_state.show_acknowledgment else "Show Thank You Note"
196
+ if st.button(button_text, on_click=toggle_acknowledgment,
197
+ disabled=st.session_state.is_processing, use_container_width=True):
198
+ pass
199
+
200
+ st.markdown('</div>', unsafe_allow_html=True)
 
 
201
 
202
  # Preload resources during initialization
203
  # This ensures the model, index, and data are loaded before the user interacts with the app
 
318
  st.markdown("### Few questions to try:")
319
 
320
  # Group questions into rows and create buttons (disabled if processing)
321
+ question_rows = group_buttons(common_questions)
322
  for row_idx, row in enumerate(question_rows):
323
  cols = st.columns(len(row))
324
  for i, (col, q) in enumerate(zip(cols, row)):