import gradio as gr import sklearn # Step 1: Define input components input_component = gr.Textbox(label = "Input Text") # Step 2: Define output components output_components = gr.Textbox(label = "Output Text") # Step 3: Define a backend function to process input and get output def process_inputs(input): # do whatever you do final_output = input + ' received' return final_output demo = gr.Interface(fn=process_inputs, inputs=input_component, outputs=output_components) demo.launch(debug=True)