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
Files changed (1) hide show
  1. 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
- output_1 = predict(text_1)
12
- output_2 = predict(text_2)
13
 
14
- print(f"Prediction 1: {output_1}")
15
- print(f"Prediction 2: {output_2}")
16
 
17
- assert output_1 in ["toxique", "non-toxique"]
18
- assert output_2 in ["toxique", "non-toxique"]
 
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"]