Skip to content

Vector calculations produce different results on different machines #66

@paulz

Description

@paulz

https://github.com/thisisartium/continuous-alignment-testing/actions/runs/14091713400/job/39469743309#step:8:117

AssertionError: Found 2808 elements outside tolerance
assert np.int64(2808) == 0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions