File size: 1,299 Bytes
29fefec
d3d8124
 
29fefec
 
 
d3d8124
29fefec
 
 
 
 
 
 
d3d8124
29fefec
d3d8124
29fefec
 
 
 
 
d3d8124
29fefec
 
 
 
 
 
 
d3d8124
227fa34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# UI.py (VERSIÓN DE DEPURACIÓN)
import gradio as gr

def create_interface(process_function_for_button): # Mantenemos la firma
    with gr.Blocks(theme='gradio/soft') as demo:
        gr.Markdown("# Prueba de API de Gradio Simplificada")
        
        name_input = gr.Textbox(label="Ingresa tu nombre")
        greeting_output = gr.Textbox(label="Saludo")
        
        def simple_greet(name):
            if not name:
                return "Por favor, ingresa un nombre."
            return f"Hola, {name}!"

        greet_button = gr.Button("Saludar")
        
        greet_button.click(
            fn=simple_greet, # Usa una función local simple para probar
            inputs=[name_input],
            outputs=[greeting_output]
        )
        
        # --- SIMULACIÓN DE TUS OUTPUTS ESPERADOS ---
        # Para asegurar que la función principal (process_and_plot) tenga outputs compatibles
        # si la conectamos a esta UI simplificada (aunque no lo haremos directamente ahora).
        # Esto es solo para que Gradio no se queje si intentara analizar process_and_plot
        # con una UI que no tuviera los outputs correctos.
        # gr.Image(label="Gráfico Dummy", visible=False) 
        # gr.Markdown(label="Análisis Dummy", visible=False)
        
    return demo