AhmedSaghir commited on
Commit
e1fe808
·
verified ·
1 Parent(s): 01d7977

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import joblib
3
+ our_trained_model =joblib.load("our_model.sav")
4
+
5
+ def greet(preg, plas, pres, skin, test, mass, pedi, age):
6
+
7
+ result = our_trained_model.predict([[int(preg), int(plas), int(pres), int(skin), int(test), int(mass), int(pedi), int(age)]])
8
+
9
+ var = int(result[0])
10
+ if var == 0:
11
+ result = "Negative"
12
+ else:
13
+ result = "Positive"
14
+
15
+ return "Is the Patient Diabetic: " + str(result)
16
+
17
+ demo = gr.Interface(
18
+ fn=greet,
19
+ inputs=["text", "text","text", "text","text", "text","text", "text"],
20
+ outputs=["text"],
21
+ )
22
+
23
+ demo.launch()