Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def enviar_solicitud(nombre, telefono, servicio, descripcion):
|
| 4 |
+
return f"""
|
| 5 |
+
Solicitud recibida
|
| 6 |
+
|
| 7 |
+
Nombre: {nombre}
|
| 8 |
+
Tel茅fono: {telefono}
|
| 9 |
+
Servicio: {servicio}
|
| 10 |
+
|
| 11 |
+
Descripci贸n:
|
| 12 |
+
{descripcion}
|
| 13 |
+
|
| 14 |
+
Nos comunicaremos contigo pronto.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
with gr.Blocks() as demo:
|
| 18 |
+
|
| 19 |
+
gr.Markdown("# Servicios de Construcci贸n y Remodelaci贸n")
|
| 20 |
+
|
| 21 |
+
nombre = gr.Textbox(label="Nombre")
|
| 22 |
+
telefono = gr.Textbox(label="Tel茅fono")
|
| 23 |
+
|
| 24 |
+
servicio = gr.Dropdown(
|
| 25 |
+
["Construcci贸n", "Mantenimiento", "Remodelaci贸n"],
|
| 26 |
+
label="Tipo de servicio"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
descripcion = gr.Textbox(
|
| 30 |
+
label="Describe lo que necesitas",
|
| 31 |
+
lines=5
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
boton = gr.Button("Enviar solicitud")
|
| 35 |
+
|
| 36 |
+
resultado = gr.Textbox(label="Resultado")
|
| 37 |
+
|
| 38 |
+
boton.click(
|
| 39 |
+
enviar_solicitud,
|
| 40 |
+
inputs=[nombre, telefono, servicio, descripcion],
|
| 41 |
+
outputs=resultado
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
demo.launch()
|