Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 =
|
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="
|
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()
|