smjain commited on
Commit
11c0599
1 Parent(s): 4f2b6cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,9 +8,9 @@ def classify(text,label):
8
  tkn_lgts = mdl(tkn_ids)[0]
9
  entail_contra_tkn_lgts = tkn_lgts[:,[0,2]]
10
  probab = entail_contra_tkn_lgts.softmax(dim=1)
11
- response = "Probablity of label being true is "+ probab [:,1].item() * 100
12
  return response
13
  txt=grad.Textbox(lines=1, label="English", placeholder="text to be classified")
14
  labels=grad.Textbox(lines=1, label="Label", placeholder="Input a Label")
15
- out=grad.Textbox(lines=1, label="Classification")
16
  grad.Interface(classify, inputs=[txt,labels], outputs=out).launch()
 
8
  tkn_lgts = mdl(tkn_ids)[0]
9
  entail_contra_tkn_lgts = tkn_lgts[:,[0,2]]
10
  probab = entail_contra_tkn_lgts.softmax(dim=1)
11
+ response = probab[:,1].item() * 100
12
  return response
13
  txt=grad.Textbox(lines=1, label="English", placeholder="text to be classified")
14
  labels=grad.Textbox(lines=1, label="Label", placeholder="Input a Label")
15
+ out=grad.Textbox(lines=1, label="Probablity of label being true is")
16
  grad.Interface(classify, inputs=[txt,labels], outputs=out).launch()