Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -595,34 +595,38 @@ with col1:
|
|
595 |
if submit_sales_page:
|
596 |
# Validar entradas
|
597 |
if validate_inputs(sales_page_audience, sales_page_product):
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
613 |
|
614 |
-
#
|
615 |
-
generator_func = section_functions[sales_page_section]
|
616 |
|
617 |
-
#
|
618 |
-
generated_content = generator_func(
|
619 |
-
audience=sales_page_audience,
|
620 |
-
product=sales_page_product,
|
621 |
-
temperature=sales_page_temperature,
|
622 |
-
offer=sales_page_offer if sales_page_offer.strip() else None
|
623 |
-
)
|
624 |
-
|
625 |
-
# Mostrar el contenido generado
|
626 |
display_generated_content(col2, generated_content, "sales_page_section")
|
627 |
|
628 |
except Exception as e:
|
|
|
595 |
if submit_sales_page:
|
596 |
# Validar entradas
|
597 |
if validate_inputs(sales_page_audience, sales_page_product):
|
598 |
+
# Crear un contenedor para el spinner en la columna 2
|
599 |
+
with col2:
|
600 |
+
with st.spinner("Generando sección de página de ventas...", show_time=True):
|
601 |
+
try:
|
602 |
+
# Mapear la selección a la función correspondiente
|
603 |
+
section_functions = {
|
604 |
+
"Above the Fold (Encabezado)": generate_above_the_fold,
|
605 |
+
"Problem (Problema)": generate_problem_section,
|
606 |
+
"Solution & Benefits (Solución y Beneficios)": generate_solution_section,
|
607 |
+
"Authority (Autoridad)": generate_authority_section,
|
608 |
+
"Offer & Bonus (Oferta y Bonus)": generate_offer_section,
|
609 |
+
"Social Proof (Prueba Social)": generate_social_proof_section,
|
610 |
+
"Guarantees (Garantías)": generate_guarantees_section,
|
611 |
+
"Call to Action (Llamada a la Acción)": generate_cta_section,
|
612 |
+
"P.S. (Post-Data)": generate_ps_section,
|
613 |
+
"Final Call to Action (Llamada Final)": generate_final_cta_section
|
614 |
+
}
|
615 |
+
|
616 |
+
# Obtener la función correspondiente
|
617 |
+
generator_func = section_functions[sales_page_section]
|
618 |
+
|
619 |
+
# Generar el contenido
|
620 |
+
generated_content = generator_func(
|
621 |
+
audience=sales_page_audience,
|
622 |
+
product=sales_page_product,
|
623 |
+
temperature=sales_page_temperature,
|
624 |
+
offer=sales_page_offer if sales_page_offer.strip() else None
|
625 |
+
)
|
626 |
|
627 |
+
# El spinner desaparecerá automáticamente cuando salga del bloque with
|
|
|
628 |
|
629 |
+
# Mostrar el contenido generado fuera del bloque del spinner
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
630 |
display_generated_content(col2, generated_content, "sales_page_section")
|
631 |
|
632 |
except Exception as e:
|