from logging import STREAM_LOGGER from controller import EventsHandler from gradio import Blocks, Button, Row, Markdown, Textbox, Column, Files with Blocks() as demo: Markdown("Start typing below and then click **Run** to see the output.") with Row(): with Column(): input_text = Textbox(placeholder="Escriba la búsqueda aquí", label= "Búsqueda") with Row(): run_btn, clear_btn = Button("Buscar", variant= "primary"), Button("Clear", variant= "secondary") with Column(): out_files = Files(interactive= False, file_count= "multiple", visible= False) with Row(): appr_btn, disappr_btn = Button(value= "✅", visible= False), Button(value= "❌", visible= False) events_handler = EventsHandler() run_btn.click(events_handler.click_run_button, inputs=input_text, outputs= [input_text, out_files, appr_btn, disappr_btn]) clear_btn.click(events_handler.click_clear_button, inputs= [], outputs= [input_text, out_files, appr_btn, disappr_btn]) appr_btn.click(events_handler.click_appr_button, inputs= [input_text, out_files], outputs= None) disappr_btn.click(events_handler.click_disappr_button, inputs= [input_text, out_files], outputs= None)