Spaces:
Runtime error
Runtime error
Download app.py from Matthew2/Matthew_Chubi: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Matthew2/Matthew_Chubi/resolve/63baa7eea8ff552bee2bcfe99d55aacdf084a915/app.py
- Command line
-
hf download hf://spaces/Matthew2/Matthew_Chubi@63baa7eea8ff552bee2bcfe99d55aacdf084a915/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Matthew2/Matthew_Chubi/resolve/63baa7eea8ff552bee2bcfe99d55aacdf084a915/app.py
1.09 kB
| import gradio as gr | |
| import numpy as np | |
| import pandas as pd | |
| import tensorflow as tf | |
| from tensorflow import keras | |
| #loading the saved model | |
| from keras.models import load_model | |
| model = load_model('Model.h5') | |
| def iris(Gender ,Hemoglobin, MCH, MCHC, MCV): | |
| prediction = model_rfc.predict([[Gender ,Hemoglobin, MCH, MCHC, MCV]]) | |
| if (prediction[0] ==0): | |
| return "Positive" | |
| elif (prediction[0] ==1): | |
| return "Negative" | |
| else: | |
| return "Error" | |
| #create input and output objects | |
| #input object1 | |
| input1 = gr.inputs.Number(label="Gender") | |
| #input object 2 | |
| input2 = gr.inputs.Number(label="Hemoglobin") | |
| #input object3 | |
| input3 = gr.inputs.Number(label="Mean Corpusular Hemoglobin (MCH)") | |
| #input object 3 | |
| input4 = gr.inputs.Number(label="Mean Corpusular Hemoglobin Concentration (MCH") | |
| #input object | |
| input5 = gr.inputs.Number(label="Mean Corpusular Volume (MCV)") | |
| output = gr.outputs.Textbox(label= "RESULT") | |
| #create interface | |
| gui = gr.Interface(fn=iris, | |
| inputs=[input1, input2, input3, input4, input5], | |
| outputs=output).launch(debug=True) |