jonathanIckovich commited on
Commit
ede734c
·
1 Parent(s): 6b12563
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -3,8 +3,16 @@ from fastai.vision.all import *
3
 
4
  model_path = Path('ImageDifferentiator.pkl')
5
 
6
- # Explicitly specify map_location and use cpu if needed
7
- learn = load_learner(model_path, cpu=True)
 
 
 
 
 
 
 
 
8
  labels = learn.dls.vocab
9
  def predict(img):
10
 
 
3
 
4
  model_path = Path('ImageDifferentiator.pkl')
5
 
6
+
7
+
8
+ # Re-save the model on a non-Windows system
9
+ learn = load_learner(model_path)
10
+ learn.export('ImageDifferentiator_export.pkl')
11
+
12
+ # Load the model using Fastai's load_learner
13
+ learn = load_learner('ImageDifferentiator_export.pkl')
14
+ labels = learn.dls.vocab
15
+
16
  labels = learn.dls.vocab
17
  def predict(img):
18