Testys commited on
Commit
3af4294
·
verified ·
1 Parent(s): 34bc61d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,13 +8,13 @@ import pickle
8
  @st.cache_resource
9
  def load_model():
10
  """
11
- Loads the saved model using pickle.
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(1).pkl', 'rb') as f:
17
- model = pickle.load(f)
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.")