Update app.py
Browse files
app.py
CHANGED
|
@@ -21,9 +21,9 @@ def actualizar_tareas(modalidades_seleccionadas):
|
|
| 21 |
tareas_disponibles.extend(MODALIDAD_TAREAS[modalidad])
|
| 22 |
return {tarea: False for tarea in set(tareas_disponibles)}
|
| 23 |
|
| 24 |
-
# Funci贸n para generar el encabezado del CSV
|
| 25 |
def generar_encabezado(modalidades_seleccionadas, tareas_seleccionadas):
|
| 26 |
-
columnas = []
|
| 27 |
for modalidad in modalidades_seleccionadas:
|
| 28 |
columnas.append(f"{modalidad.lower()}_input")
|
| 29 |
columnas.append(f"{modalidad.lower()}_output")
|
|
@@ -60,9 +60,9 @@ with gr.Blocks() as demo:
|
|
| 60 |
modalidades = list(MODALIDAD_TAREAS.keys())
|
| 61 |
modalidades_seleccionadas = gr.CheckboxGroup(choices=modalidades, label="Selecciona Modalidades")
|
| 62 |
|
| 63 |
-
# Panel 2: Tareas
|
| 64 |
with gr.Row():
|
| 65 |
-
tareas_disponibles = gr.CheckboxGroup(choices=[], label="Tareas
|
| 66 |
modalidades_seleccionadas.change(actualizar_tareas, inputs=modalidades_seleccionadas, outputs=tareas_disponibles)
|
| 67 |
|
| 68 |
# Panel 3: Generar Encabezado del CSV
|
|
|
|
| 21 |
tareas_disponibles.extend(MODALIDAD_TAREAS[modalidad])
|
| 22 |
return {tarea: False for tarea in set(tareas_disponibles)}
|
| 23 |
|
| 24 |
+
# Funci贸n para generar el encabezado del CSV (ahora incluye 'id')
|
| 25 |
def generar_encabezado(modalidades_seleccionadas, tareas_seleccionadas):
|
| 26 |
+
columnas = ["id"] # A帽adimos 'id' como primer elemento
|
| 27 |
for modalidad in modalidades_seleccionadas:
|
| 28 |
columnas.append(f"{modalidad.lower()}_input")
|
| 29 |
columnas.append(f"{modalidad.lower()}_output")
|
|
|
|
| 60 |
modalidades = list(MODALIDAD_TAREAS.keys())
|
| 61 |
modalidades_seleccionadas = gr.CheckboxGroup(choices=modalidades, label="Selecciona Modalidades")
|
| 62 |
|
| 63 |
+
# Panel 2: Configuraci贸n de Tareas (CheckboxGroup)
|
| 64 |
with gr.Row():
|
| 65 |
+
tareas_disponibles = gr.CheckboxGroup(choices=[], label="Selecciona Tareas")
|
| 66 |
modalidades_seleccionadas.change(actualizar_tareas, inputs=modalidades_seleccionadas, outputs=tareas_disponibles)
|
| 67 |
|
| 68 |
# Panel 3: Generar Encabezado del CSV
|