Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ headline_types = {
|
|
77 |
}
|
78 |
|
79 |
# Función para generar titulares
|
80 |
-
def generate_headlines(number_of_headlines, target_audience, product, temperature, selected_types):
|
81 |
product_mention = get_random_product_mention()
|
82 |
mention_instruction = get_mention_instruction(product_mention, product)
|
83 |
|
@@ -100,7 +100,8 @@ def generate_headlines(number_of_headlines, target_audience, product, temperatur
|
|
100 |
headlines_instruction = (
|
101 |
f"Tu tarea es crear {number_of_headlines} ganchos o encabezados titulares llamativos diseñados para {target_audience} "
|
102 |
f"con el fin de generar interés en {product}. Usa la siguiente mención: {mention_instruction}. "
|
103 |
-
f"Asegúrate de utilizar los siguientes tipos de titulares: {', '.join(selected_types)}."
|
|
|
104 |
)
|
105 |
|
106 |
chat_session = model.start_chat(
|
@@ -199,7 +200,7 @@ if submit:
|
|
199 |
if target_audience and product and selected_types:
|
200 |
try:
|
201 |
# Obtener la respuesta del modelo
|
202 |
-
generated_headlines = generate_headlines(number_of_headlines, target_audience, product, temperature, selected_types)
|
203 |
col2.markdown(f"""
|
204 |
<div style="border: 1px solid #000000; padding: 5px; border-radius: 8px; background-color: #ffffff;">
|
205 |
<h4>Observa la magia en acción:</h4>
|
|
|
77 |
}
|
78 |
|
79 |
# Función para generar titulares
|
80 |
+
def generate_headlines(number_of_headlines, target_audience, product, temperature, selected_types, selected_formula):
|
81 |
product_mention = get_random_product_mention()
|
82 |
mention_instruction = get_mention_instruction(product_mention, product)
|
83 |
|
|
|
100 |
headlines_instruction = (
|
101 |
f"Tu tarea es crear {number_of_headlines} ganchos o encabezados titulares llamativos diseñados para {target_audience} "
|
102 |
f"con el fin de generar interés en {product}. Usa la siguiente mención: {mention_instruction}. "
|
103 |
+
f"Asegúrate de utilizar los siguientes tipos de titulares: {', '.join(selected_types)}. "
|
104 |
+
f"Y usa la fórmula de titular seleccionada: {selected_formula}"
|
105 |
)
|
106 |
|
107 |
chat_session = model.start_chat(
|
|
|
200 |
if target_audience and product and selected_types:
|
201 |
try:
|
202 |
# Obtener la respuesta del modelo
|
203 |
+
generated_headlines = generate_headlines(number_of_headlines, target_audience, product, temperature, selected_types, selected_formula)
|
204 |
col2.markdown(f"""
|
205 |
<div style="border: 1px solid #000000; padding: 5px; border-radius: 8px; background-color: #ffffff;">
|
206 |
<h4>Observa la magia en acción:</h4>
|