ABAAS1 commited on
Commit
8472192
·
verified ·
1 Parent(s): 9571d05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,8 +4,8 @@ import gradio as gr
4
  learn = load_learner('model.pkl')
5
 
6
  def predict(img):
7
- # fill in: call learn.predict(), build the dict for Gradio's Label output
8
- pass
9
 
10
  gr.Interface(
11
  fn=predict,
 
4
  learn = load_learner('model.pkl')
5
 
6
  def predict(img):
7
+ pred, pred_idx, probs = learn.predict(img)
8
+ return dict(zip(learn.dls.vocab, map(float, probs)))
9
 
10
  gr.Interface(
11
  fn=predict,