posix path in app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,11 @@ import torch, torch.nn as nn
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
import gradio as gr
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# ---------- 1. load the trained learner ----------
|
| 7 |
learn = load_learner('bear_classifier.pkl')
|
| 8 |
#embedding_model = nn.Sequential(*list(learn.model.children())[:-2]) # Match notebook logic here
|
|
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
+
import pathlib
|
| 7 |
+
|
| 8 |
+
from pathlib import PosixPath
|
| 9 |
+
pathlib.PosixPath = pathlib.Path
|
| 10 |
+
|
| 11 |
# ---------- 1. load the trained learner ----------
|
| 12 |
learn = load_learner('bear_classifier.pkl')
|
| 13 |
#embedding_model = nn.Sequential(*list(learn.model.children())[:-2]) # Match notebook logic here
|