Arman511 commited on
Commit
bd77e63
·
1 Parent(s): d5a33ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,8 +7,8 @@ categories = ('Negative', 'Positive')
7
  label = gr.outputs.Label()
8
  def classify(text):
9
  pred,pred_idx,probs = learn.predict(text)
10
- return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
 
12
 
13
- intf = gr.Interface(classify,"text",label)
14
  intf.launch()
 
7
  label = gr.outputs.Label()
8
  def classify(text):
9
  pred,pred_idx,probs = learn.predict(text)
10
+ return dict(zip(categories, map(float,probs)))
11
 
12
 
13
+ intf = gr.Interface(fn=classify,inputs="text",outputs=label)
14
  intf.launch()