umair894's picture
Update app.py
662d5a3 verified
raw
history blame
649 Bytes
import gradio as gr
import sklearn
#['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']
import joblib
loaded_model = joblib.load('trained_model.pkl')
def predict(preg, plas, pres, skin, test, mass, pedi, age):
result = loaded_model.predict([[int(preg), int(plas), int(pres), int(skin), int(test), int(mass), int(pedi), int(age)]])
if int(result[0]) == 1:
return "The person is diabetic"
else:
return "The person is not diabetic"
#return str(result)
demo = gr.Interface(
fn=predict,
inputs=["text", "text","text", "text","text", "text","text", "text"],
outputs=["text"],
)
demo.launch()