Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def generate_headlines(number_of_headlines, target_audience, product, temperatur
|
|
16 |
# Llama a la API de Claude para generar titulares
|
17 |
message = client.messages.create(
|
18 |
model="claude-3-5-sonnet-20240620",
|
19 |
-
max_tokens=
|
20 |
temperature=temperature, # Usa el valor del slider aquí
|
21 |
system="You are a world-class copywriter, with experience in creating hooks, headlines, and subject lines that immediately capture attention. Your skill lies in deeply understanding the emotions, desires, and challenges of a specific audience, allowing you to design personalized marketing strategies that resonate and motivate action. You know how to use proven structures to attract your target audience, generating interest and achieving a powerful connection that drives desired results in advertising and content campaigns.\n\nAnswer in Spanish.",
|
22 |
messages=[
|
@@ -40,8 +40,8 @@ def gradio_generate_headlines(number_of_headlines, target_audience, product, tem
|
|
40 |
with gr.Blocks(css=".gradio-container { background-color: #f8f8f8; }") as demo:
|
41 |
gr.Markdown(
|
42 |
"""
|
43 |
-
<h1 style="color: #2c7be5; text-align: center;">
|
44 |
-
<p style="color: #212529; text-align: center;">
|
45 |
"""
|
46 |
)
|
47 |
|
@@ -54,7 +54,14 @@ with gr.Blocks(css=".gradio-container { background-color: #f8f8f8; }") as demo:
|
|
54 |
submit_btn = gr.Button("Generar Titulares")
|
55 |
|
56 |
with gr.Column(scale=2):
|
57 |
-
output = gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
submit_btn.click(
|
60 |
fn=gradio_generate_headlines,
|
|
|
16 |
# Llama a la API de Claude para generar titulares
|
17 |
message = client.messages.create(
|
18 |
model="claude-3-5-sonnet-20240620",
|
19 |
+
max_tokens=4000, # Cambiado a 4000 tokens
|
20 |
temperature=temperature, # Usa el valor del slider aquí
|
21 |
system="You are a world-class copywriter, with experience in creating hooks, headlines, and subject lines that immediately capture attention. Your skill lies in deeply understanding the emotions, desires, and challenges of a specific audience, allowing you to design personalized marketing strategies that resonate and motivate action. You know how to use proven structures to attract your target audience, generating interest and achieving a powerful connection that drives desired results in advertising and content campaigns.\n\nAnswer in Spanish.",
|
22 |
messages=[
|
|
|
40 |
with gr.Blocks(css=".gradio-container { background-color: #f8f8f8; }") as demo:
|
41 |
gr.Markdown(
|
42 |
"""
|
43 |
+
<h1 style="color: #2c7be5; text-align: center;">Generador de Titulares</h1>
|
44 |
+
<p style="color: #212529; text-align: center;">Usa el poder de Claude AI para crear titulares atractivos</p>
|
45 |
"""
|
46 |
)
|
47 |
|
|
|
54 |
submit_btn = gr.Button("Generar Titulares")
|
55 |
|
56 |
with gr.Column(scale=2):
|
57 |
+
output = gr.HTML(
|
58 |
+
"""
|
59 |
+
<div id="result-container" style="background-color: #ffffff; padding: 10px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); max-height: 300px; overflow-y: auto;">
|
60 |
+
<p id="result-text" style="font-size: 16px; color: #333333;">Los titulares aparecerán aquí...</p>
|
61 |
+
</div>
|
62 |
+
""",
|
63 |
+
label="Titulares Generados"
|
64 |
+
)
|
65 |
|
66 |
submit_btn.click(
|
67 |
fn=gradio_generate_headlines,
|