Spaces:
Build error
Build error
fixed vocab attribute issue
Browse files
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 |
-
|
|
|
|
| 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)
|