Easonwangzk commited on
Commit
2b44bcc
·
1 Parent(s): 0fe5085

Remove manual rerun() - use Streamlit's auto-rerun

Browse files
Files changed (1) hide show
  1. src/app.py +0 -3
src/app.py CHANGED
@@ -115,19 +115,16 @@ with st.expander("Try Example Texts"):
115
  if st.button("Example 1: Product Review", key="ex1"):
116
  st.session_state.example_text = """This product is absolutely amazing! I've been using it for three months now and couldn't be happier. The quality is outstanding, and the customer service is excellent. The design is beautiful and modern. However, the price is a bit high, but I think it's worth every penny. Highly recommended for anyone looking for a reliable solution. The features are innovative and user-friendly. I love how easy it is to use!"""
117
  st.session_state.example_question = "What is the overall sentiment and what are the main topics discussed?"
118
- rerun()
119
 
120
  with col2:
121
  if st.button("Example 2: News Article", key="ex2"):
122
  st.session_state.example_text = """The new technology breakthrough announced today promises to revolutionize the industry. Scientists have developed an innovative approach that could solve long-standing problems. The research team, led by experts from multiple universities, demonstrated significant improvements in efficiency. However, some critics argue that implementation challenges remain. The project received substantial funding from government agencies and private investors. Initial tests show promising results, though more research is needed."""
123
  st.session_state.example_question = "Extract the key topics and analyze the sentiment"
124
- rerun()
125
 
126
  with col3:
127
  if st.button("Example 3: Short Story", key="ex3"):
128
  st.session_state.example_text = """The old lighthouse stood tall against the stormy night. Waves crashed violently against the rocks below. Inside, the keeper tended the light, ensuring it never went out. For years, he had performed this duty faithfully. Tonight felt different somehow. The wind howled louder than ever before. Yet he remained calm, focused on his purpose. Ships depended on that light. Lives depended on his vigilance."""
129
  st.session_state.example_question = "How many words are in this text and what is the mood?"
130
- rerun()
131
 
132
  # Text input
133
  st.markdown("#### Text to Analyze")
 
115
  if st.button("Example 1: Product Review", key="ex1"):
116
  st.session_state.example_text = """This product is absolutely amazing! I've been using it for three months now and couldn't be happier. The quality is outstanding, and the customer service is excellent. The design is beautiful and modern. However, the price is a bit high, but I think it's worth every penny. Highly recommended for anyone looking for a reliable solution. The features are innovative and user-friendly. I love how easy it is to use!"""
117
  st.session_state.example_question = "What is the overall sentiment and what are the main topics discussed?"
 
118
 
119
  with col2:
120
  if st.button("Example 2: News Article", key="ex2"):
121
  st.session_state.example_text = """The new technology breakthrough announced today promises to revolutionize the industry. Scientists have developed an innovative approach that could solve long-standing problems. The research team, led by experts from multiple universities, demonstrated significant improvements in efficiency. However, some critics argue that implementation challenges remain. The project received substantial funding from government agencies and private investors. Initial tests show promising results, though more research is needed."""
122
  st.session_state.example_question = "Extract the key topics and analyze the sentiment"
 
123
 
124
  with col3:
125
  if st.button("Example 3: Short Story", key="ex3"):
126
  st.session_state.example_text = """The old lighthouse stood tall against the stormy night. Waves crashed violently against the rocks below. Inside, the keeper tended the light, ensuring it never went out. For years, he had performed this duty faithfully. Tonight felt different somehow. The wind howled louder than ever before. Yet he remained calm, focused on his purpose. Ships depended on that light. Lives depended on his vigilance."""
127
  st.session_state.example_question = "How many words are in this text and what is the mood?"
 
128
 
129
  # Text input
130
  st.markdown("#### Text to Analyze")