JeCabrera commited on
Commit
442cfe7
verified
1 Parent(s): 6169209

Upload 14 files

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -291,6 +291,8 @@ with col1:
291
  """, unsafe_allow_html=True)
292
 
293
  # Mostrar el anuncio generado
 
 
294
  if submit_ad:
295
  if ad_target_audience and ad_product:
296
  # Mostrar el spinner en la segunda columna
@@ -304,9 +306,6 @@ if submit_ad:
304
  emotional_angle
305
  )
306
 
307
- # Store the headline in session state
308
- st.session_state.current_headline = headline
309
-
310
  # Generate the ad with the headline
311
  generated_ad = generate_fb_ad(
312
  ad_target_audience,
@@ -326,13 +325,12 @@ if submit_ad:
326
  if not isinstance(generated_ad, str):
327
  st.error("Error al generar el anuncio")
328
  else:
329
- # Store the generated ad in session state to preserve it
330
  st.session_state.current_ad = generated_ad
331
 
332
- # Display the headline and ad
333
  st.markdown(f"""
334
  <div style="{styles['results_container']}">
335
- <h2>{headline}</h2>
336
  <h3>Anuncio Generado:</h3>
337
  <p>{generated_ad}</p>
338
  </div>
@@ -345,8 +343,8 @@ if submit_ad:
345
  import datetime
346
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
347
 
348
- # Prepare content with headline for download
349
- download_content = f"TITULAR: {headline}\n\n{generated_ad}"
350
 
351
  # Bot贸n de descarga with timestamp in filename
352
  st.download_button(
 
291
  """, unsafe_allow_html=True)
292
 
293
  # Mostrar el anuncio generado
294
+ # In the submit_ad section, modify how the headline and ad are displayed
295
+ # Modify the submit_ad section to fix the headline display issue
296
  if submit_ad:
297
  if ad_target_audience and ad_product:
298
  # Mostrar el spinner en la segunda columna
 
306
  emotional_angle
307
  )
308
 
 
 
 
309
  # Generate the ad with the headline
310
  generated_ad = generate_fb_ad(
311
  ad_target_audience,
 
325
  if not isinstance(generated_ad, str):
326
  st.error("Error al generar el anuncio")
327
  else:
328
+ # Store only the generated ad in session state
329
  st.session_state.current_ad = generated_ad
330
 
331
+ # Display only the ad without separate headline
332
  st.markdown(f"""
333
  <div style="{styles['results_container']}">
 
334
  <h3>Anuncio Generado:</h3>
335
  <p>{generated_ad}</p>
336
  </div>
 
343
  import datetime
344
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
345
 
346
+ # Prepare content for download (without separate headline)
347
+ download_content = f"{generated_ad}"
348
 
349
  # Bot贸n de descarga with timestamp in filename
350
  st.download_button(