KaburaJ commited on
Commit
8fbfe88
·
1 Parent(s): d89adef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -101,10 +101,14 @@ def main():
101
  pred_button = st.button("Predict")
102
 
103
  model=load_model()
 
 
 
104
  # label = ['Zebra', 'Horse']
105
  # label = np.array(label).reshape(1, -1)
106
  # ohe= OneHotEncoder()
107
  # labels = ohe.fit_transform(label).toarray()
 
108
 
109
  if pred_button:
110
  outputs = model.predict(int(image_pred))
 
101
  pred_button = st.button("Predict")
102
 
103
  model=load_model()
104
+ if model is None:
105
+ st.error("Error: Model could not be loaded")
106
+ return
107
  # label = ['Zebra', 'Horse']
108
  # label = np.array(label).reshape(1, -1)
109
  # ohe= OneHotEncoder()
110
  # labels = ohe.fit_transform(label).toarray()
111
+
112
 
113
  if pred_button:
114
  outputs = model.predict(int(image_pred))