Alex Martin commited on
Commit
1e1ae33
1 Parent(s): 0ce143e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -18,7 +18,7 @@ def create_dict(prob, text):
18
  def get_cats(text):
19
  tokenizer = AutoTokenizer.from_pretrained("aim9061/fine-tuned-toxic-tweet-dilbert")
20
  token = tokenizer(text, return_tensors="pt")
21
-
22
  outputs = model(**token)
23
 
24
  prob = torch.sigmoid(output.logits).detach().numpy()[0]
 
18
  def get_cats(text):
19
  tokenizer = AutoTokenizer.from_pretrained("aim9061/fine-tuned-toxic-tweet-dilbert")
20
  token = tokenizer(text, return_tensors="pt")
21
+ model = AutoModelForSequenceClassification.from_pretrained("aim9061/fine-tuned-toxic-tweet-dilbert")
22
  outputs = model(**token)
23
 
24
  prob = torch.sigmoid(output.logits).detach().numpy()[0]