judebebo32 commited on
Commit
b4ca1c4
1 Parent(s): 154597f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -19,8 +19,10 @@ def load_pickle_file(file_name):
19
  model = load_pickle_file('best_model.pkl')
20
  label_encoder = load_pickle_file('label_encoder.pkl')
21
 
22
- # Ensure model and label encoder are loaded correctly
23
  if isinstance(model, str) or isinstance(label_encoder, str):
 
 
24
  raise Exception(f"Error loading model or label encoder: {model} | {label_encoder}")
25
 
26
  # Define the prediction function
 
19
  model = load_pickle_file('best_model.pkl')
20
  label_encoder = load_pickle_file('label_encoder.pkl')
21
 
22
+ # Check if the model and label encoder were loaded successfully
23
  if isinstance(model, str) or isinstance(label_encoder, str):
24
+ # Print the error message for debugging
25
+ print(f"Error loading model or label encoder: {model} | {label_encoder}")
26
  raise Exception(f"Error loading model or label encoder: {model} | {label_encoder}")
27
 
28
  # Define the prediction function