Spaces:
Runtime error
Runtime error
Artur Janik
commited on
Commit
·
6ac528f
1
Parent(s):
84b2bc0
list unpacking compat
Browse files
language_models_project/app.py
CHANGED
@@ -52,7 +52,7 @@ def infer(text: str) -> List[float]:
|
|
52 |
predictions[np.where(probs >= 0.5)] = 1
|
53 |
predictions = pd.Series(predictions == 1)
|
54 |
predictions.index = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
|
55 |
-
return {"label": str(predictions), "score": str(probs)}
|
56 |
|
57 |
|
58 |
def wrapper(*args, **kwargs):
|
|
|
52 |
predictions[np.where(probs >= 0.5)] = 1
|
53 |
predictions = pd.Series(predictions == 1)
|
54 |
predictions.index = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
|
55 |
+
return [{"label": str(predictions), "score": str(probs)}]
|
56 |
|
57 |
|
58 |
def wrapper(*args, **kwargs):
|