Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,13 +8,13 @@ import pickle
|
|
| 8 |
@st.cache_resource
|
| 9 |
def load_model():
|
| 10 |
"""
|
| 11 |
-
Loads the saved model
|
| 12 |
Using st.cache_resource to load the model only once.
|
| 13 |
"""
|
| 14 |
try:
|
| 15 |
# Load the pre-trained model from a pickle file
|
| 16 |
-
with open('voting_classifier_model
|
| 17 |
-
model =
|
| 18 |
return model
|
| 19 |
except FileNotFoundError:
|
| 20 |
st.error("The model file 'voting_classifier_model.pkl' was not found.")
|
|
|
|
| 8 |
@st.cache_resource
|
| 9 |
def load_model():
|
| 10 |
"""
|
| 11 |
+
Loads the saved model.
|
| 12 |
Using st.cache_resource to load the model only once.
|
| 13 |
"""
|
| 14 |
try:
|
| 15 |
# Load the pre-trained model from a pickle file
|
| 16 |
+
with open('voting_classifier_model.joblib', 'rb') as f:
|
| 17 |
+
model = joblib.load(f)
|
| 18 |
return model
|
| 19 |
except FileNotFoundError:
|
| 20 |
st.error("The model file 'voting_classifier_model.pkl' was not found.")
|