Spaces:
Build error
Build error
danielp1402
commited on
Commit
•
2d84bf4
1
Parent(s):
4e7c582
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,16 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
|
2 |
-
|
3 |
__all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
|
4 |
|
5 |
from fastai.vision.all import *
|
6 |
import gradio as gr
|
7 |
import timm
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Upload your model
|
10 |
learn = load_learner('model.pkl')
|
11 |
|
|
|
|
|
|
|
1 |
__all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
|
2 |
|
3 |
from fastai.vision.all import *
|
4 |
import gradio as gr
|
5 |
import timm
|
6 |
|
7 |
+
# Some magic according to https://forums.fast.ai/t/lesson-2-official-topic/96033/376?page=17
|
8 |
+
def is_cat(x):
|
9 |
+
return x[0].isupper() # Used by model
|
10 |
+
|
11 |
+
import sys
|
12 |
+
sys.modules["__main__"].is_cat = is_cat
|
13 |
+
|
14 |
# Upload your model
|
15 |
learn = load_learner('model.pkl')
|
16 |
|