Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def model_classifier(text):
|
|
17 |
return f"the input text is {text}"
|
18 |
else:
|
19 |
encoded_input=tokenizer(text) #this is where the encoding happens
|
20 |
-
logits=model(
|
21 |
probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
|
22 |
id2label=model.config.id2label
|
23 |
return_probs={id2label[i]:probs.item() for i,probs in enumerate(probs_label[0])}
|
|
|
17 |
return f"the input text is {text}"
|
18 |
else:
|
19 |
encoded_input=tokenizer(text) #this is where the encoding happens
|
20 |
+
logits=model(encoded_input).logits #this is the logits of the labels
|
21 |
probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
|
22 |
id2label=model.config.id2label
|
23 |
return_probs={id2label[i]:probs.item() for i,probs in enumerate(probs_label[0])}
|