Spaces:
Running
Running
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=1000,
|
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=[
|
@@ -37,7 +37,7 @@ def generate_headlines(number_of_headlines, target_audience, product, temperatur
|
|
37 |
def gradio_generate_headlines(number_of_headlines, target_audience, product, temperature):
|
38 |
return generate_headlines(number_of_headlines, target_audience, product, temperature)
|
39 |
|
40 |
-
with gr.Blocks(
|
41 |
gr.Markdown(
|
42 |
"""
|
43 |
<h1 style="color: #2c7be5; text-align: center;">Generador de Titulares</h1>
|
@@ -54,7 +54,7 @@ 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.Textbox(label="Titulares Generados")
|
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=1000, # Configurado a 1000 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=[
|
|
|
37 |
def gradio_generate_headlines(number_of_headlines, target_audience, product, temperature):
|
38 |
return generate_headlines(number_of_headlines, target_audience, product, temperature)
|
39 |
|
40 |
+
with gr.Blocks() as demo:
|
41 |
gr.Markdown(
|
42 |
"""
|
43 |
<h1 style="color: #2c7be5; text-align: center;">Generador de Titulares</h1>
|
|
|
54 |
submit_btn = gr.Button("Generar Titulares")
|
55 |
|
56 |
with gr.Column(scale=2):
|
57 |
+
output = gr.Textbox(label="Titulares Generados", lines=20, placeholder="Los titulares aparecerán aquí...")
|
58 |
|
59 |
submit_btn.click(
|
60 |
fn=gradio_generate_headlines,
|