Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,18 +90,27 @@ def generate_bullets(number_of_bullets, target_audience, product, call_to_action
|
|
90 |
generation_config=generation_config,
|
91 |
)
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
# Configurar la interfaz de usuario con Streamlit
|
107 |
st.set_page_config(page_title="Quick Prompt", layout="wide")
|
|
|
90 |
generation_config=generation_config,
|
91 |
)
|
92 |
|
93 |
+
# Mostrar los beneficios generados con formato correcto en HTML
|
94 |
+
if submit:
|
95 |
+
if target_audience and product and call_to_action:
|
96 |
+
try:
|
97 |
+
# Obtener la respuesta del modelo
|
98 |
+
generated_bullets = generate_bullets(number_of_bullets, target_audience, product, call_to_action, temperature)
|
99 |
+
|
100 |
+
# Dividir los bullets por líneas y generar el HTML sin formato markdown
|
101 |
+
bullets_list = generated_bullets.split("*")
|
102 |
+
bullets_html = "".join([f"<li>{bullet.strip()}</li>" for bullet in bullets_list if bullet.strip()])
|
103 |
+
|
104 |
+
col2.markdown(f"""
|
105 |
+
<div class="generated-bullets">
|
106 |
+
<h4>Mira los bullets generados:</h4>
|
107 |
+
<ul>{bullets_html}</ul>
|
108 |
+
</div>
|
109 |
+
""", unsafe_allow_html=True)
|
110 |
+
except Exception as e:
|
111 |
+
st.error(f"Error al generar los bullets: {str(e)}")
|
112 |
+
else:
|
113 |
+
st.error("Por favor, completa todos los campos.")
|
114 |
|
115 |
# Configurar la interfaz de usuario con Streamlit
|
116 |
st.set_page_config(page_title="Quick Prompt", layout="wide")
|