Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# app.py
|
2 |
import gradio as gr
|
3 |
import anthropic
|
4 |
import os # Importa el módulo os para manejar variables de entorno
|
@@ -45,7 +44,25 @@ logo_colors = {
|
|
45 |
"text_color": "#212529"
|
46 |
}
|
47 |
|
48 |
-
with gr.Blocks(css="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
gr.Markdown(
|
50 |
f"""
|
51 |
<h1 style="color: {logo_colors['primary']}; text-align: center;">Generador de Titulares</h1>
|
@@ -54,13 +71,14 @@ with gr.Blocks(css=".gradio-container { background-color: " + logo_colors["backg
|
|
54 |
)
|
55 |
|
56 |
with gr.Row():
|
57 |
-
with gr.Column():
|
58 |
number_of_headlines = gr.Number(label="Número de Titulares", value=5)
|
59 |
target_audience = gr.Textbox(label="Público Objetivo", placeholder="Ejemplo: Estudiantes Universitarios")
|
60 |
product = gr.Textbox(label="Producto", placeholder="Ejemplo: Curso de Inglés")
|
|
|
|
|
61 |
submit_btn = gr.Button("Generar Titulares", elem_id="submit-btn")
|
62 |
-
|
63 |
-
output = gr.Textbox(label="Titulares Generados", lines=10)
|
64 |
|
65 |
submit_btn.click(
|
66 |
fn=gradio_generate_headlines,
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import anthropic
|
3 |
import os # Importa el módulo os para manejar variables de entorno
|
|
|
44 |
"text_color": "#212529"
|
45 |
}
|
46 |
|
47 |
+
with gr.Blocks(css="""
|
48 |
+
.gradio-container { background-color: """ + logo_colors["background"] + """; }
|
49 |
+
@media (max-width: 768px) {
|
50 |
+
.gradio-column {
|
51 |
+
width: 100% !important;
|
52 |
+
margin-bottom: 20px;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
@media (min-width: 769px) {
|
56 |
+
.gradio-row {
|
57 |
+
display: flex;
|
58 |
+
flex-wrap: wrap;
|
59 |
+
}
|
60 |
+
.gradio-column {
|
61 |
+
flex: 1;
|
62 |
+
padding: 10px;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
""") as demo:
|
66 |
gr.Markdown(
|
67 |
f"""
|
68 |
<h1 style="color: {logo_colors['primary']}; text-align: center;">Generador de Titulares</h1>
|
|
|
71 |
)
|
72 |
|
73 |
with gr.Row():
|
74 |
+
with gr.Column(scale=2, elem_id="input-col"):
|
75 |
number_of_headlines = gr.Number(label="Número de Titulares", value=5)
|
76 |
target_audience = gr.Textbox(label="Público Objetivo", placeholder="Ejemplo: Estudiantes Universitarios")
|
77 |
product = gr.Textbox(label="Producto", placeholder="Ejemplo: Curso de Inglés")
|
78 |
+
|
79 |
+
with gr.Column(scale=1, elem_id="result-col", align="end"):
|
80 |
submit_btn = gr.Button("Generar Titulares", elem_id="submit-btn")
|
81 |
+
output = gr.Textbox(label="Titulares Generados", lines=10)
|
|
|
82 |
|
83 |
submit_btn.click(
|
84 |
fn=gradio_generate_headlines,
|