|
import gradio as gr |
|
import joblib |
|
import sklearn |
|
our_trained_model =joblib.load("our_model.sav") |
|
|
|
def greet(preg, plas, pres, skin, test, mass, pedi, age): |
|
|
|
result = our_trained_model.predict([[int(preg), int(plas), int(pres), int(skin), int(test), int(mass), int(pedi), int(age)]]) |
|
|
|
var = int(result[0]) |
|
if var == 0: |
|
result = "Negative" |
|
else: |
|
result = "Positive" |
|
|
|
return "Is the Patient Diabetic: " + str(result) |
|
|
|
demo = gr.Interface( |
|
fn=greet, |
|
inputs=["text", "text","text", "text","text", "text","text", "text"], |
|
outputs=["text"], |
|
) |
|
|
|
demo.launch() |
|
|