Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,17 @@ import numpy as np
|
|
3 |
import pickle
|
4 |
import streamlit.components.v1 as components
|
5 |
from sklearn.preprocessing import LabelEncoder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Load the pickled model
|
8 |
def load_model():
|
|
|
3 |
import pickle
|
4 |
import streamlit.components.v1 as components
|
5 |
from sklearn.preprocessing import LabelEncoder
|
6 |
+
import os
|
7 |
+
|
8 |
+
if os.path.exists('label_encoder.pkl'):
|
9 |
+
try:
|
10 |
+
with open('label_encoder.pkl', 'rb') as f:
|
11 |
+
le = pickle.load(f)
|
12 |
+
except Exception as e:
|
13 |
+
print(f"Error loading the label encoder: {e}")
|
14 |
+
else:
|
15 |
+
print("File 'label_encoder.pkl' does not exist.")
|
16 |
+
|
17 |
|
18 |
# Load the pickled model
|
19 |
def load_model():
|