Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 7, 2025
1 parent 8277e8f commit 8e5b96d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion detoxify/detoxify.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def predict(self, text):
for i, cla in enumerate(self.class_names):
results[cla] = (
# If the input is a single text, squeezing will remove the dimensionality from the tensor - so `.tolist()` will return a number instead. Otherwise, we'll get the list of scores of that class.
scores[:,i].squeeze().tolist()
scores[:, i]
.squeeze()
.tolist()
)
return results

Expand Down

0 comments on commit 8e5b96d

Please sign in to comment.