-
Notifications
You must be signed in to change notification settings - Fork 12
Description
AssertionError: Found 2808 elements outside tolerance
assert np.int64(2808) == 0
Lines 87 to 102 in 68de6f7
| def test_embedding_equivalence(snapshot): | |
| snap_same = load_snapshot_value( | |
| snapshot, "hallucination_response_large_same_text_embedding.json" | |
| ) | |
| snap_different = load_snapshot_value( | |
| snapshot, "hallucination_response_large_different_text_embedding.json" | |
| ) | |
| # assert snap_same == snap_different | |
| diff_val = np.subtract(snap_same["embedding"], snap_different["embedding"]) | |
| outside_tolerance_count = np.sum(np.abs(diff_val) >= 0.001) | |
| # Assert a specific count (replace 0 with your expected count) | |
| assert outside_tolerance_count == 0, ( | |
| f"Found {outside_tolerance_count} elements outside tolerance" | |
| ) |
File "/home/runner/work/continuous-alignment-testing/continuous-alignment-testing/examples/team_recommender/tests/example_1_text_response/test_compute_cosine_similarity.py", line 100, in test_embedding_equivalence
assert outside_tolerance_count == 0, (
f"Found {outside_tolerance_count} elements outside tolerance"
)
AssertionError: Found 2808 elements outside tolerance
assert np.int64(2808) == 0
=========================== short test summary info ============================
FAILED examples/team_recommender/tests/example_1_text_response/test_compute_cosine_similarity.py::test_embedding_equivalence - AssertionError: Found 2808 elements outside tolerance
assert np.int64(2808) == 0
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
================== 1 failed, 4 passed, 5 deselected in 1.08s ===================
Error: Process completed with exit code 1.