From 8e5b96d7b5e793172815ead6ca113ff77f21e65a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:00:07 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- detoxify/detoxify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/detoxify/detoxify.py b/detoxify/detoxify.py index c97fa95..8733c19 100644 --- a/detoxify/detoxify.py +++ b/detoxify/detoxify.py @@ -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