anik faisal commited on
Commit
e0145a3
·
1 Parent(s): e224db5

trying custom_load_learner

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -177,12 +177,12 @@ categories = ('ABBOTTS BABBLER', 'ABBOTTS BOOBY', 'ABYSSINIAN GROUND HORNBILL',
177
 
178
  def load_learner_custom(fname):
179
  distrib_barrier()
180
- res = torch.load(fname, map_location=torch.device('cpu'))
181
  if hasattr(res, 'to_fp32'): res = res.to_fp32()
182
  return res
183
 
184
 
185
- learn = load_learner('best_model.pt')
186
 
187
  def classify_image(img):
188
  pred, idx, prbs = learn.predict(img)
 
177
 
178
  def load_learner_custom(fname):
179
  distrib_barrier()
180
+ res = torch.load(fname)
181
  if hasattr(res, 'to_fp32'): res = res.to_fp32()
182
  return res
183
 
184
 
185
+ learn = load_learner_custom('best_model.pt')
186
 
187
  def classify_image(img):
188
  pred, idx, prbs = learn.predict(img)