Tbruand
commited on
Commit
·
52e008b
1
Parent(s):
748fe90
test(handler): adapte le test aux nouvelles prédictions du modèle zero-shot (label + score)
Browse files- tests/test_handler.py +6 -6
tests/test_handler.py
CHANGED
@@ -8,11 +8,11 @@ def test_zero_shot_prediction_output():
|
|
8 |
text_1 = "Tu es complètement stupide"
|
9 |
text_2 = "Je te remercie pour ton aide"
|
10 |
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
print(f"Prediction 1: {
|
15 |
-
print(f"Prediction 2: {
|
16 |
|
17 |
-
assert
|
18 |
-
assert
|
|
|
8 |
text_1 = "Tu es complètement stupide"
|
9 |
text_2 = "Je te remercie pour ton aide"
|
10 |
|
11 |
+
label_1, score_1 = predict(text_1)
|
12 |
+
label_2, score_2 = predict(text_2)
|
13 |
|
14 |
+
print(f"Prediction 1: {label_1} ({score_1:.2f})")
|
15 |
+
print(f"Prediction 2: {label_2} ({score_2:.2f})")
|
16 |
|
17 |
+
assert label_1 in ["toxique", "non-toxique"]
|
18 |
+
assert label_2 in ["toxique", "non-toxique"]
|