Spaces:
Runtime error
Runtime error
judebebo32
commited on
Commit
•
b4ca1c4
1
Parent(s):
154597f
Update app.py
Browse files
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 |
-
#
|
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
|