Graziela commited on
Commit
24b3899
·
1 Parent(s): 5713c08
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import joblib as jb
3
+
4
+ def predict(sex, age, pclass):
5
+ model = jb.load('model-teste.pkl')
6
+ pclass = int(pclass)
7
+ p = model.predict({{sex, age, pclass}})[0]
8
+
9
+ return {"Did not survive": p[0], "Survived": p[1]}
10
+
11
+
12
+ demo = gr.Interface(fn=predict,
13
+ inputs=[gr.Dropdown(choices=["male", "female"], type="index"),
14
+ "number",
15
+ gr.Dropdown(choices=["1", "2", "3"], type="value")
16
+ ],
17
+ outputs="label")
18
+
19
+ demo.launch()