Spaces:
Sleeping
Sleeping
Update binoculars/detector.py
Browse files- binoculars/detector.py +1 -2
binoculars/detector.py
CHANGED
@@ -96,8 +96,7 @@ class Binoculars(object):
|
|
96 |
encodings.to(DEVICE_1), self.tokenizer.pad_token_id)
|
97 |
binoculars_scores = ppl / x_ppl
|
98 |
binoculars_scores = binoculars_scores.tolist()
|
99 |
-
|
100 |
-
return binoculars_scores
|
101 |
|
102 |
def predict(self, input_text: Union[list[str], str]) -> Union[list[str], str]:
|
103 |
# binoculars_scores = np.array(self.compute_score(input_text))
|
|
|
96 |
encodings.to(DEVICE_1), self.tokenizer.pad_token_id)
|
97 |
binoculars_scores = ppl / x_ppl
|
98 |
binoculars_scores = binoculars_scores.tolist()
|
99 |
+
return binoculars_scores[0] if isinstance(input_text, str) else binoculars_scores
|
|
|
100 |
|
101 |
def predict(self, input_text: Union[list[str], str]) -> Union[list[str], str]:
|
102 |
# binoculars_scores = np.array(self.compute_score(input_text))
|