Spaces:
Runtime error
Runtime error
| 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 ana(Gender ,Hemoglobin, MCH, MCHC, MCV): | |
| prediction = model.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=ana, | |
| inputs=[input1, input2, input3, input4, input5], | |
| outputs=output).launch(debug=True) |