Spaces:
Sleeping
Sleeping
File size: 392 Bytes
0c5e2cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
from fastai.vision.all import *
from pathlib import Path, WindowsPath
def is_cat(x): return x[0].isupper()
# Load the learner
learn = load_learner('model.pkl')
# Replace the WindowsPath object with the platform-independent Path object
if isinstance(learn.path, WindowsPath):
learn.path = Path(learn.path)
# Save the learner with the modified path object
learn.export('model_fixed.pkl') |