Skip to content

Commit

Permalink
Update text embedder test to match the output after XNNPack upgrade.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 681489960
  • Loading branch information
schmidt-sebastian authored and copybara-github committed Oct 2, 2024
1 parent 5a924c4 commit 0e634ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mediapipe/tasks/python/test/text/text_embedder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _check_cosine_similarity(self, result0, result1, expected_similarity):
ModelFileType.FILE_NAME,
0.965793,
512,
(21.1785, 20.32263),
(21.2054, 20.32263),
),
(
True,
Expand All @@ -119,7 +119,7 @@ def _check_cosine_similarity(self, result0, result1, expected_similarity):
ModelFileType.FILE_NAME,
0.965793,
512,
(0.062262, 0.065280),
(0.062578, 0.065280),
),
(
False,
Expand Down Expand Up @@ -203,7 +203,7 @@ def test_embed(self, l2_normalize, quantize, model_name, model_file_type,
ModelFileType.FILE_NAME,
0.965793,
512,
(21.1785, 20.322639),
(21.2054, 20.322639),
),
(
True,
Expand All @@ -212,7 +212,7 @@ def test_embed(self, l2_normalize, quantize, model_name, model_file_type,
ModelFileType.FILE_NAME,
0.965793,
512,
(0.0622627, 0.065280),
(0.0625787, 0.065280),
),
(
False,
Expand Down Expand Up @@ -287,7 +287,7 @@ def test_embed_in_context(self, l2_normalize, quantize, model_name,

@parameterized.parameters(
# TODO: The similarity should likely be lower
(_BERT_MODEL_FILE, 0.97564),
(_BERT_MODEL_FILE, 0.99025),
(_USE_MODEL_FILE, 0.780334),
)
def test_embed_with_different_themes(self, model_file, expected_similarity):
Expand Down

0 comments on commit 0e634ea

Please sign in to comment.