awacke1 commited on
Commit
acabee3
Β·
verified Β·
1 Parent(s): 3b411be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -143,7 +143,6 @@ def create_dataframe_category(category, title, emoji_prefix):
143
  st.markdown(f"<div class='category-header'>{emoji_prefix} {title}</div>", unsafe_allow_html=True)
144
  st.markdown("<div class='dataframe-container'>", unsafe_allow_html=True)
145
 
146
- # Create 4 columns for layout
147
  cols = st.columns(4)
148
  for i, item in enumerate(data[f"{category}s"]):
149
  col = cols[i % 4]
@@ -204,13 +203,13 @@ with col1:
204
  value=st.session_state.selections['about'],
205
  placeholder="Enter what the content should be about")
206
 
207
- col1, col2 = st.columns(2)
208
- with col1:
 
209
  st.session_state.selections['inclusion'] = st.text_input("βœ… Include",
210
  value=st.session_state.selections['inclusion'],
211
  placeholder="What to include in the content")
212
-
213
- with col2:
214
  st.session_state.selections['exclusion'] = st.text_input("❌ Exclude",
215
  value=st.session_state.selections['exclusion'],
216
  placeholder="What to exclude from the content")
@@ -231,21 +230,20 @@ with col2:
231
  st.write(prompt)
232
  st.markdown("</div>", unsafe_allow_html=True)
233
 
234
- btn1, btn2, btn3 = st.columns(3)
235
- with btn1:
 
236
  if st.button("πŸ“‹ Copy", type="primary", use_container_width=True):
237
  st.code(prompt, language="")
238
-
239
- with btn2:
240
  if st.button("πŸ”„ Reset", type="secondary", use_container_width=True):
241
  for key in st.session_state.selections:
242
  if key in ['about', 'inclusion', 'exclusion', 'input_data']:
243
  st.session_state.selections[key] = ""
244
  else:
245
  st.session_state.selections[key] = None
246
- st.rerun() # Updated from st.experimental_rerun() to st.rerun() for newer Streamlit versions
247
-
248
- with btn3:
249
  if st.button("🎲 Random", type="secondary", use_container_width=True):
250
  for category in ['role', 'tone', 'instruction', 'length', 'content_type', 'audience', 'format']:
251
  st.session_state.selections[category] = random.choice(data[category+'s'])
@@ -270,7 +268,7 @@ Return as πŸ“ Markdown.</pre>
270
 
271
  st.markdown("""
272
  <div style="background-color: #e6ffed; border: 1px solid #b8e6cc; border-radius: 4px; padding: 6px; margin-bottom: 6px; font-size: 0.8em;">
273
- <b>πŸ’Ό Business</b><pre style="white-space: pre-wrap; font-size: 0.8em; margin: 3px 0px;">Act as a πŸ‘” Professional, use 🀝 Persuasive tone, Write a πŸ“§ Email for πŸ‘©β€πŸ’Ό Executives.
274
 
275
  It should be about a product launch.
276
  Include ROI metrics.
 
143
  st.markdown(f"<div class='category-header'>{emoji_prefix} {title}</div>", unsafe_allow_html=True)
144
  st.markdown("<div class='dataframe-container'>", unsafe_allow_html=True)
145
 
 
146
  cols = st.columns(4)
147
  for i, item in enumerate(data[f"{category}s"]):
148
  col = cols[i % 4]
 
203
  value=st.session_state.selections['about'],
204
  placeholder="Enter what the content should be about")
205
 
206
+ # Use a single-level column for Include/Exclude
207
+ include_exclude_cols = st.columns(2)
208
+ with include_exclude_cols[0]:
209
  st.session_state.selections['inclusion'] = st.text_input("βœ… Include",
210
  value=st.session_state.selections['inclusion'],
211
  placeholder="What to include in the content")
212
+ with include_exclude_cols[1]:
 
213
  st.session_state.selections['exclusion'] = st.text_input("❌ Exclude",
214
  value=st.session_state.selections['exclusion'],
215
  placeholder="What to exclude from the content")
 
230
  st.write(prompt)
231
  st.markdown("</div>", unsafe_allow_html=True)
232
 
233
+ # Define button columns at this level
234
+ button_cols = st.columns(3)
235
+ with button_cols[0]:
236
  if st.button("πŸ“‹ Copy", type="primary", use_container_width=True):
237
  st.code(prompt, language="")
238
+ with button_cols[1]:
 
239
  if st.button("πŸ”„ Reset", type="secondary", use_container_width=True):
240
  for key in st.session_state.selections:
241
  if key in ['about', 'inclusion', 'exclusion', 'input_data']:
242
  st.session_state.selections[key] = ""
243
  else:
244
  st.session_state.selections[key] = None
245
+ st.rerun()
246
+ with button_cols[2]:
 
247
  if st.button("🎲 Random", type="secondary", use_container_width=True):
248
  for category in ['role', 'tone', 'instruction', 'length', 'content_type', 'audience', 'format']:
249
  st.session_state.selections[category] = random.choice(data[category+'s'])
 
268
 
269
  st.markdown("""
270
  <div style="background-color: #e6ffed; border: 1px solid #b8e6cc; border-radius: 4px; padding: 6px; margin-bottom: 6px; font-size: 0.8em;">
271
+ <b>πŸ’Ό Business</b><pre style="white-space: pre-wrap; font-size: 0.8em; margin: 3px 0px;">Act as a πŸ‘” Professional, use 🀝 Persuasive tone, Write a πŸ“§ Email for πŸ’Ό Business Owners.
272
 
273
  It should be about a product launch.
274
  Include ROI metrics.