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}" | |
iface = gr.Interface( | |
fn=predict_length, | |
inputs=[ | |
gr.Textbox(label="Sepal Length"), | |
gr.Textbox(label="Sepal Width"), | |
gr.Textbox(label="Petal Length"), | |
gr.Textbox(label="Petal Width"), | |
], | |
outputs="text", | |
live=True | |
) | |
iface.launch() | |