import gradio as gr def predict_length(sep_length, sep_width, pet_length, pet_width): return f"Sepal Length: {sep_length}, Sepal Width: {sep_width}, Petal Length: {pet_length}, Petal Width: {pet_width}" with gr.Blocks() as iface: sep_length = gr.Textbox(label="Sepal Length") sep_width = gr.Textbox(label="Sepal Width") pet_length = gr.Textbox(label="Petal Length") pet_width = gr.Textbox(label="Petal Width") button = gr.Button(label="Predict") button.click(fn=predict_length, inputs=["text", "text", "text", "text"], outputs="text", api_name="predict_length") # Launch the interface iface.launch()