Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,16 +73,22 @@ def generate_opening_paragraph(target_audience, product, temperature, text_type,
|
|
| 73 |
return to_markdown(response.text)
|
| 74 |
|
| 75 |
# Configurar la interfaz de usuario con Gradio
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
with gr.Row():
|
| 81 |
with gr.Column():
|
| 82 |
target_audience = gr.Textbox(label="Público Objetivo", placeholder="Ejemplo: Estudiantes Universitarios")
|
| 83 |
product = gr.Textbox(label="Producto", placeholder="Ejemplo: Curso de Inglés")
|
| 84 |
temperature = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label="Creatividad")
|
| 85 |
text_type = gr.Dropdown(choices=["Página de Ventas", "Correo", "Historia"], label="Tipo de Texto", value="Página de Ventas")
|
|
|
|
| 86 |
|
| 87 |
with gr.Column():
|
| 88 |
output_text = gr.Markdown(label="Párrafo de Apertura Generado")
|
|
|
|
| 73 |
return to_markdown(response.text)
|
| 74 |
|
| 75 |
# Configurar la interfaz de usuario con Gradio
|
| 76 |
+
css = """
|
| 77 |
+
<style>
|
| 78 |
+
body { font-family: Arial, sans-serif; }
|
| 79 |
+
.gradio-container { max-width: 800px; margin: auto; }
|
| 80 |
+
</style>
|
| 81 |
+
"""
|
| 82 |
+
|
| 83 |
+
with gr.Blocks(css=css) as iface:
|
| 84 |
+
gr.HTML("<h1 class='text-3xl font-bold text-center mb-6'>Generador de Párrafos de Apertura</h1>")
|
| 85 |
with gr.Row():
|
| 86 |
with gr.Column():
|
| 87 |
target_audience = gr.Textbox(label="Público Objetivo", placeholder="Ejemplo: Estudiantes Universitarios")
|
| 88 |
product = gr.Textbox(label="Producto", placeholder="Ejemplo: Curso de Inglés")
|
| 89 |
temperature = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label="Creatividad")
|
| 90 |
text_type = gr.Dropdown(choices=["Página de Ventas", "Correo", "Historia"], label="Tipo de Texto", value="Página de Ventas")
|
| 91 |
+
model_selector = gr.Dropdown(choices=["gemini-1.5-pro", "gemini-1.5-flash"], value="gemini-1.5-pro", label="Selecciona el modelo")
|
| 92 |
|
| 93 |
with gr.Column():
|
| 94 |
output_text = gr.Markdown(label="Párrafo de Apertura Generado")
|