Spaces:
Runtime error
Runtime error
Dane Summers
commited on
Commit
·
c105490
1
Parent(s):
325c700
Remove unneeded load_learner
Browse files
app.py
CHANGED
@@ -1,15 +1,12 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.learner import load_learner
|
3 |
from fastai.vision.core import PILImage
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
|
6 |
-
learner = load_learner(
|
7 |
-
hf_hub_download("pinkpekoe/lesson2-bear-classifier", "export.pkl")
|
8 |
-
)
|
9 |
-
|
10 |
-
|
11 |
-
learner = load_learner("export.pkl")
|
12 |
|
|
|
13 |
|
14 |
def predict_bear_type(img_path):
|
15 |
img = PILImage.create(img_path)
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import gradio as gr
|
4 |
from fastai.learner import load_learner
|
5 |
from fastai.vision.core import PILImage
|
6 |
from huggingface_hub import hf_hub_download
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
learner = load_learner(hf_hub_download("pinkpekoe/lesson2-bear-classifier", "export.pkl"))
|
10 |
|
11 |
def predict_bear_type(img_path):
|
12 |
img = PILImage.create(img_path)
|