nicholasKluge commited on
Commit
2085a67
·
verified ·
1 Parent(s): 0c79856

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -6
README.md CHANGED
@@ -66,15 +66,13 @@ with torch.no_grad():
66
  logits = model_output.logits.squeeze(-1).float().cpu().numpy()
67
 
68
  # scores are produced in the range [0, 4]. To convert to the range [1, 5], we can simply add 1 to the score.
69
- score = logits.item() + 1
70
 
71
- result = {
72
  "text": text,
73
  "score": score,
74
- "toxic_score": int(round(max(0, min(score, 4)))) + 1,
75
- }
76
-
77
- print(result)
78
  ```
79
 
80
 
 
66
  logits = model_output.logits.squeeze(-1).float().cpu().numpy()
67
 
68
  # scores are produced in the range [0, 4]. To convert to the range [1, 5], we can simply add 1 to the score.
69
+ score = [x + 1 for x in logits.tolist()][0]
70
 
71
+ print({
72
  "text": text,
73
  "score": score,
74
+ "int_score": [int(round(max(0, min(score, 4)))) + 1 for score in logits][0],
75
+ })
 
 
76
  ```
77
 
78