Moaz715 commited on
Commit
0aa2ff0
·
1 Parent(s): e395d17
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -203,10 +203,13 @@ def classify_multimode_dt(image):
203
  prediction = dt_multimode_model.predict(processed_image)
204
  return "Decision Tree Multimode prediction: " + str(prediction[0])
205
 
206
-
207
  def classify_multimode_svm(image):
208
  if svm_multimode_model is None:
209
- return "SVM Multimode model placeholder: model is not inserted yet."
 
 
 
 
210
 
211
  processed_image = preprocess_image(image, "SVM", "Multimode")
212
  prediction = svm_multimode_model.predict(processed_image)
 
203
  prediction = dt_multimode_model.predict(processed_image)
204
  return "Decision Tree Multimode prediction: " + str(prediction[0])
205
 
 
206
  def classify_multimode_svm(image):
207
  if svm_multimode_model is None:
208
+ # Check if we caught a specific error for this file
209
+ if 'svm_hog.pkl' in loading_errors:
210
+ return f"ERROR: {loading_errors['svm_hog.pkl']}"
211
+ else:
212
+ return "SVM Multimode model placeholder: model is not inserted yet."
213
 
214
  processed_image = preprocess_image(image, "SVM", "Multimode")
215
  prediction = svm_multimode_model.predict(processed_image)