os path management for picking the model
Browse files
app.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from fastai.vision.all import *
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
learn = load_learner('export.pkl')
|
| 5 |
labels = learn.dls.vocab
|
| 6 |
|
|
@@ -18,4 +23,5 @@ iface = gr.Interface(
|
|
| 18 |
live=True,
|
| 19 |
enable_queue=True,
|
| 20 |
)
|
|
|
|
| 21 |
iface.launch()
|
|
|
|
| 1 |
+
import pathlib
|
| 2 |
import gradio as gr
|
| 3 |
from fastai.vision.all import *
|
| 4 |
|
| 5 |
+
# to solve the mismatch between windows (local) system and huggingspace (linux)
|
| 6 |
+
plt = platform.system()
|
| 7 |
+
if plt == 'Linux': pathlib.WindowsPath = pathlib.PosixPath
|
| 8 |
+
|
| 9 |
learn = load_learner('export.pkl')
|
| 10 |
labels = learn.dls.vocab
|
| 11 |
|
|
|
|
| 23 |
live=True,
|
| 24 |
enable_queue=True,
|
| 25 |
)
|
| 26 |
+
|
| 27 |
iface.launch()
|