pka007 commited on
Commit
d235a46
·
verified ·
1 Parent(s): 358176d

fixed vocab attribute issue

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,9 +4,11 @@ from huggingface_hub import from_pretrained_fastai
4
  import pathlib
5
 
6
  # loading the model
 
7
  pathlib.WindowsPath = pathlib.PosixPath
8
  learn = from_pretrained_fastai("pka007/flowerclassifier_model")
9
- labels = learn.dls.vocab
 
10
  def predict(img):
11
  img = PILImage.create(img)
12
  pred,pred_idx,probs = learn.predict(img)
 
4
  import pathlib
5
 
6
  # loading the model
7
+ windows_backup = pathlib.WindowsPath
8
  pathlib.WindowsPath = pathlib.PosixPath
9
  learn = from_pretrained_fastai("pka007/flowerclassifier_model")
10
+ pathlib.WindowsPath = windows_backup
11
+ labels = ['Jasmine', 'Marigold', 'Rose', 'sunflower', 'tulip']
12
  def predict(img):
13
  img = PILImage.create(img)
14
  pred,pred_idx,probs = learn.predict(img)