File size: 638 Bytes
b19dcad
 
f0deeb2
b19dcad
f0deeb2
 
b19dcad
f0deeb2
 
 
b19dcad
f0deeb2
 
 
b19dcad
 
f0deeb2
b19dcad
 
7628508
b19dcad
0345a77
 
 
 
b19dcad
 
f0deeb2
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
import pandas as pd
from joblib import load

def predict_bodymass(FlipperLength):
    model = load("penguin_predictor.jb")

    # Create DataFrame from input
    data = {
        "FlipperLength": [FlipperLength]
    }
    xin = pd.DataFrame(data)
    
    bodymass = model.predict(xin)
    return bodymass[0]

iface = gr.Interface(
    fn=predict_bodymass,
    inputs=[
          gr.inputs.Textbox(placeholder="Enter Flipper Length(mm)",numeric=True,label="FLIPPER LENGTH")
    ],
     title="PENGUIN REGRESSION",
     outputs="text",
     examples=[[195],
     [183]]
)

if __name__ == "__main__":
    iface.launch()