Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ def decode_file(file_path):
|
|
| 22 |
|
| 23 |
# Load the model once when starting the app
|
| 24 |
try:
|
| 25 |
-
model = decode_file('./model.pkl')
|
| 26 |
if model is not None:
|
| 27 |
print("Model loaded successfully")
|
| 28 |
else:
|
|
@@ -117,7 +117,7 @@ def predict(gender, age, hypertension, ever_married, work_type, heart_disease,
|
|
| 117 |
prediction = model.predict_proba(processed_input)[0][1]
|
| 118 |
return f"The probability of stroke is {prediction:.2%}"
|
| 119 |
except Exception as e:
|
| 120 |
-
return f"Error making prediction: {str(e)}, model is not valid"
|
| 121 |
|
| 122 |
# Create the Gradio interface
|
| 123 |
iface = gr.Interface(
|
|
|
|
| 22 |
|
| 23 |
# Load the model once when starting the app
|
| 24 |
try:
|
| 25 |
+
model = decode_file('./model.pkl')
|
| 26 |
if model is not None:
|
| 27 |
print("Model loaded successfully")
|
| 28 |
else:
|
|
|
|
| 117 |
prediction = model.predict_proba(processed_input)[0][1]
|
| 118 |
return f"The probability of stroke is {prediction:.2%}"
|
| 119 |
except Exception as e:
|
| 120 |
+
return f"Error making prediction: {str(e)}, model is not valid"
|
| 121 |
|
| 122 |
# Create the Gradio interface
|
| 123 |
iface = gr.Interface(
|