File size: 650 Bytes
edc2d41
 
 
eac07ff
6c5f1d9
 
 
eac07ff
 
 
 
 
 
 
b773934
eac07ff
 
6c5f1d9
edc2d41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()