com3dian commited on
Commit
659f042
·
verified ·
1 Parent(s): d7d64d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -91,12 +91,14 @@ def format(text_list):
91
  if 'page_index' not in st.session_state:
92
  st.session_state.page_index = 0
93
 
94
- if 'current_text' not in st.session_state:
95
- st.session_state.current_text = summ_text[st.session_state.page_index]
96
-
97
  if 'summ_text' not in st.session_state:
98
  st.session_state.summ_text = format(summ_text)
99
 
 
 
 
 
 
100
  # Function to handle page turn
101
  def turn_page(direction):
102
  if direction == "next" and st.session_state.page_index < len(summ_text) - 1:
@@ -115,7 +117,7 @@ def update_text():
115
  text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
116
 
117
  # Display page turner controls
118
- col1, col2, col3 = st.columns([2, 6, 1])
119
 
120
  # Previous button in col1
121
  with col1:
 
91
  if 'page_index' not in st.session_state:
92
  st.session_state.page_index = 0
93
 
 
 
 
94
  if 'summ_text' not in st.session_state:
95
  st.session_state.summ_text = format(summ_text)
96
 
97
+ if 'current_text' not in st.session_state:
98
+ st.session_state.current_text = st.session_state.summ_text[st.session_state.page_index]
99
+
100
+
101
+
102
  # Function to handle page turn
103
  def turn_page(direction):
104
  if direction == "next" and st.session_state.page_index < len(summ_text) - 1:
 
117
  text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
118
 
119
  # Display page turner controls
120
+ col1, col2, col3 = st.columns([2, 12, 1])
121
 
122
  # Previous button in col1
123
  with col1: