busebaser commited on
Commit
c5b14f4
·
1 Parent(s): 46b22e9

Fix: Added missing function is_cat before loading model

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -2,8 +2,16 @@ from fastai.vision.all import load_learner, PILImage
2
  import gradio as gr
3
  from PIL import Image
4
 
 
 
 
 
5
  # Load the trained model
6
- model = load_learner('model.pkl')
 
 
 
 
7
 
8
  # Define a function to make predictions
9
  def predict(image):
 
2
  import gradio as gr
3
  from PIL import Image
4
 
5
+ # Define the missing function
6
+ def is_cat(x):
7
+ return x[0].isupper()
8
+
9
  # Load the trained model
10
+ try:
11
+ model = load_learner('model.pkl')
12
+ print("✅ Model loaded successfully")
13
+ except Exception as e:
14
+ print(f"❌ Error loading model: {e}")
15
 
16
  # Define a function to make predictions
17
  def predict(image):