Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -318,7 +318,7 @@ with gr.Blocks() as demo:
|
|
318 |
|
319 |
# Crear grupos de imágenes y descripciones
|
320 |
image_groups = [
|
321 |
-
|
322 |
images[3:6], # Carrusel 2
|
323 |
images[6:9], # Carrusel 3
|
324 |
images[9:12], # Carrusel 4
|
@@ -334,16 +334,28 @@ with gr.Blocks() as demo:
|
|
334 |
images[39:42], # Carrusel 14
|
335 |
images[42:45], # Carrusel 15
|
336 |
]
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
# Crear tres columnas de carruseles
|
339 |
with gr.Row():
|
340 |
-
for group in range(0, len(image_groups),
|
341 |
-
with gr.Column(scale=
|
342 |
with gr.Tabs():
|
343 |
-
for idx in range(
|
344 |
if group + idx < len(image_groups):
|
345 |
images_in_carousel = image_groups[group + idx]
|
346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
for image in images_in_carousel:
|
348 |
gr.Image(value=image["path"]) # Mostrar la imagen
|
349 |
gr.Markdown(image["description"]) # Mostrar la descripción debajo de la imagen
|
|
|
318 |
|
319 |
# Crear grupos de imágenes y descripciones
|
320 |
image_groups = [
|
321 |
+
[images[24], images[25]], # Carrusel 1
|
322 |
images[3:6], # Carrusel 2
|
323 |
images[6:9], # Carrusel 3
|
324 |
images[9:12], # Carrusel 4
|
|
|
334 |
images[39:42], # Carrusel 14
|
335 |
images[42:45], # Carrusel 15
|
336 |
]
|
337 |
+
|
338 |
+
carousel_titles = [
|
339 |
+
"Análisis Geográfico", # Título para el primer carrusel
|
340 |
+
"Estadísticas de Atención Neonatal", # Título para el segundo carrusel
|
341 |
+
]
|
342 |
|
343 |
# Crear tres columnas de carruseles
|
344 |
with gr.Row():
|
345 |
+
for group in range(0, len(image_groups), 3): # Iterar en sets de 3 carruseles
|
346 |
+
with gr.Column(scale=1): # Crear columna para cada carrusel
|
347 |
with gr.Tabs():
|
348 |
+
for idx in range(3): # Tres carruseles por columna
|
349 |
if group + idx < len(image_groups):
|
350 |
images_in_carousel = image_groups[group + idx]
|
351 |
+
|
352 |
+
# Comprobar si el título existe, de lo contrario usar uno predeterminado
|
353 |
+
if (group + idx) < len(carousel_titles):
|
354 |
+
title = carousel_titles[group + idx]
|
355 |
+
else:
|
356 |
+
title = f"Carrusel {group + idx + 1}" # Título predeterminado
|
357 |
+
|
358 |
+
with gr.Tab(title): # Usar el título personalizado o predeterminado
|
359 |
for image in images_in_carousel:
|
360 |
gr.Image(value=image["path"]) # Mostrar la imagen
|
361 |
gr.Markdown(image["description"]) # Mostrar la descripción debajo de la imagen
|