Spaces:
Runtime error
Runtime error
Rob Caamano commited on
App 2.9
Browse files
app.py
CHANGED
|
@@ -31,8 +31,7 @@ def get_highest_toxicity_class(prediction):
|
|
| 31 |
return model.config.id2label[max_index], prediction[max_index]
|
| 32 |
|
| 33 |
input = tokenizer(text, return_tensors="tf")
|
| 34 |
-
|
| 35 |
-
prediction = logits / logits.sum()
|
| 36 |
|
| 37 |
if st.button("Submit", type="primary"):
|
| 38 |
label, probability = get_highest_toxicity_class(prediction)
|
|
|
|
| 31 |
return model.config.id2label[max_index], prediction[max_index]
|
| 32 |
|
| 33 |
input = tokenizer(text, return_tensors="tf")
|
| 34 |
+
prediction = model(input, return_dict=True).logits.numpy()[0]
|
|
|
|
| 35 |
|
| 36 |
if st.button("Submit", type="primary"):
|
| 37 |
label, probability = get_highest_toxicity_class(prediction)
|