Spaces:
Runtime error
Runtime error
Update app.py
Browse files21 unmodified lines2223242526272888 unmodified lines11711811912012112212321 unmodified lines# Load the model once when starting the apptry:model = decode_file('./model.pkl') # Updated hereif model is not None:print("Model loaded successfully")else:88 unmodified linesprediction = model.predict_proba(processed_input)[0][1]return f"The probability of stroke is {prediction:.2%}"except Exception as e:return f"Error making prediction: {str(e)}, model is not valid" # updated here# Create the Gradio interfaceiface = gr.Interface(21 unmodified lines2223242526272888 unmodified lines11711811912012112212321 unmodified lines# Load the model once when starting the apptry:model = decode_file('./model.pkl')if model is not None:print("Model loaded successfully")else:88 unmodified linesprediction = model.predict_proba(processed_input)[0][1]return f"The probability of stroke is {prediction:.2%}"except Exception as e:return f"Error making prediction: {str(e)}, model is not valid"# Create the Gradio interfaceiface = gr.Interface(
app.py+2-2