ABAAS1 commited on
Commit
e893d21
·
verified ·
1 Parent(s): 502a531

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,10 +1,11 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
 
3
 
4
  learn = load_learner('model.pkl')
5
-
6
  labels = learn.dls.vocab
7
 
 
8
  def predict(img):
9
  pred, pred_idx, probs = learn.predict(img)
10
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
+ import spaces
4
 
5
  learn = load_learner('model.pkl')
 
6
  labels = learn.dls.vocab
7
 
8
+ @spaces.GPU
9
  def predict(img):
10
  pred, pred_idx, probs = learn.predict(img)
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}