jcmachicao commited on
Commit
9756c62
verified
1 Parent(s): 9fd05e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
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("# Foro Din谩mico con Visualizaci贸n de Red")
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
- texto = gr.Textbox(label="Tu aporte")
 
28
 
29
- # 馃搶 Submit Button (Now Uses `normativa_dropdown` Directly)
30
  submit_button = gr.Button("Agregar Aporte")
 
 
31
  submit_button.click(
32
- fn=agregar_aporte,
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