sankhyikii commited on
Commit
39fa7a9
1 Parent(s): dc07155

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ def predict(img):
26
  probability = torch.nn.functional.softmax(out[0],dim=0)
27
 
28
  values, indices = torch.topk(probability,k=5)
29
- return {LABELS[i]: v.items() for i,v in zip(indices,values)}
30
 
31
 
32
  iface = gr.Interface(fn=predict, inputs=gr.inputs.Image(type='pil'), outputs="label").launch()
 
26
  probability = torch.nn.functional.softmax(out[0],dim=0)
27
 
28
  values, indices = torch.topk(probability,k=5)
29
+ return {LABELS[i]: v.item() for i,v in zip(indices,values)}
30
 
31
 
32
  iface = gr.Interface(fn=predict, inputs=gr.inputs.Image(type='pil'), outputs="label").launch()