Update app.py
Browse files
app.py
CHANGED
@@ -8,29 +8,27 @@ students = ["Alice", "Bob", "Charlie"]
|
|
8 |
# Initialize graph before launching UI
|
9 |
inicializar_grafo()
|
10 |
|
|
|
11 |
# Gradio Interface
|
12 |
iface = gr.Blocks()
|
13 |
|
14 |
with iface:
|
15 |
-
gr.Markdown("#
|
16 |
-
|
17 |
-
# 馃搶 Graph Display
|
18 |
-
with gr.Row():
|
19 |
-
gr.Markdown("## Red de Aportes:")
|
20 |
-
graph_output = gr.Image(visualizar_grafo(), label="Red de Aportes")
|
21 |
|
22 |
-
# 馃搶 Input Fields
|
23 |
with gr.Row():
|
24 |
nombre = gr.Dropdown(choices=students, label="Nombre del Estudiante")
|
|
|
25 |
|
26 |
with gr.Row():
|
27 |
-
|
|
|
28 |
|
29 |
-
# 馃搶 Submit Button (Now Uses `normativa_dropdown` Directly)
|
30 |
submit_button = gr.Button("Agregar Aporte")
|
|
|
|
|
31 |
submit_button.click(
|
32 |
-
fn=
|
33 |
-
inputs=[texto],
|
34 |
outputs=graph_output
|
35 |
)
|
36 |
|
|
|
8 |
# Initialize graph before launching UI
|
9 |
inicializar_grafo()
|
10 |
|
11 |
+
|
12 |
# Gradio Interface
|
13 |
iface = gr.Blocks()
|
14 |
|
15 |
with iface:
|
16 |
+
gr.Markdown("# Diagrama de Aportes de Participantes")
|
|
|
|
|
|
|
|
|
|
|
17 |
|
|
|
18 |
with gr.Row():
|
19 |
nombre = gr.Dropdown(choices=students, label="Nombre del Estudiante")
|
20 |
+
texto = gr.Textbox(label="Tu aporte")
|
21 |
|
22 |
with gr.Row():
|
23 |
+
gr.Markdown("## Red de Aportes:")
|
24 |
+
graph_output = gr.Image(label="Red de Aportes") # Placeholder for the image
|
25 |
|
|
|
26 |
submit_button = gr.Button("Agregar Aporte")
|
27 |
+
|
28 |
+
# Fix: Now passing both inputs and updating the graph output properly
|
29 |
submit_button.click(
|
30 |
+
fn=chat_interface,
|
31 |
+
inputs=[nombre, texto], # Fix: Now passing both inputs
|
32 |
outputs=graph_output
|
33 |
)
|
34 |
|