Spaces:
Sleeping
Sleeping
socd06
commited on
Commit
·
0e5e474
1
Parent(s):
49c2126
handle pathlib depending on the platform
Browse files
app.py
CHANGED
|
@@ -4,10 +4,13 @@ from fastai.vision.all import *
|
|
| 4 |
import gradio as gr
|
| 5 |
from gradio.components import Image
|
| 6 |
from gradio import Label
|
| 7 |
-
from pathlib import Path
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
labels = learner.dls.vocab
|
| 12 |
|
| 13 |
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from gradio.components import Image
|
| 6 |
from gradio import Label
|
|
|
|
| 7 |
|
| 8 |
+
import pathlib
|
| 9 |
+
plt = platform.system()
|
| 10 |
+
if plt == 'Linux':
|
| 11 |
+
pathlib.WindowsPath = pathlib.PosixPath
|
| 12 |
+
|
| 13 |
+
learner = load_learner('model.pkl')
|
| 14 |
labels = learner.dls.vocab
|
| 15 |
|
| 16 |
|