Hali5 commited on
Commit
93544dd
·
1 Parent(s): 60cb054
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -46,7 +46,7 @@ def predict(image):
46
 
47
  with torch.no_grad():
48
  outputs = model(img_tensor)
49
- probabilities = torch.nn.functional.softmax(outputs[0], dim=0)
50
 
51
  return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
52
 
@@ -59,6 +59,4 @@ demo = gradio.Interface(
59
  )
60
 
61
  if __name__ == "__main__":
62
- demo.launch(server_name="0.0.0.0",
63
- server_port=7860,
64
- ssr_mode=False)
 
46
 
47
  with torch.no_grad():
48
  outputs = model(img_tensor)
49
+ probabilities = torch.nn.functional.softmax(outputs.squeeze(0), dim=0)
50
 
51
  return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
52
 
 
59
  )
60
 
61
  if __name__ == "__main__":
62
+ demo.launch()