Skip to content

Commit

Permalink
Update goldens
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 666504510
  • Loading branch information
talumbau authored and copybara-github committed Aug 22, 2024
1 parent a82d59e commit ff6aabb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
16 changes: 10 additions & 6 deletions mediapipe/tasks/python/test/text/text_classifier_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,23 @@
categories=[
_Category(
index=1,
score=0.9995,
score=0.9994,
display_name='',
category_name='positive'),
category_name='positive',
),
_Category(
index=0,
score=0.0005,
score=0.0006,
display_name='',
category_name='negative')
category_name='negative',
),
],
head_index=0,
head_name='probability')
head_name='probability',
)
],
timestamp_ms=0)
timestamp_ms=0,
)
_REGEX_NEGATIVE_RESULTS = TextClassifierResult(
classifications=[
_Classifications(
Expand Down
18 changes: 9 additions & 9 deletions mediapipe/tasks/python/test/text/text_embedder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ def _check_cosine_similarity(self, result0, result1, expected_similarity):
False,
_BERT_MODEL_FILE,
ModelFileType.FILE_NAME,
0.969514,
0.965793,
512,
(19.9016, 22.626251),
(21.1785, 20.32263),
),
(
True,
False,
_BERT_MODEL_FILE,
ModelFileType.FILE_NAME,
0.969514,
0.965793,
512,
(0.0585837, 0.0723035),
(0.062262, 0.065280),
),
(
False,
Expand Down Expand Up @@ -201,18 +201,18 @@ def test_embed(self, l2_normalize, quantize, model_name, model_file_type,
False,
_BERT_MODEL_FILE,
ModelFileType.FILE_NAME,
0.969514,
0.965793,
512,
(19.9016, 22.626251),
(21.1785, 20.322639),
),
(
True,
False,
_BERT_MODEL_FILE,
ModelFileType.FILE_NAME,
0.969514,
0.965793,
512,
(0.0585837, 0.0723035),
(0.0622627, 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.98077),
(_BERT_MODEL_FILE, 0.97564),
(_USE_MODEL_FILE, 0.780334),
)
def test_embed_with_different_themes(self, model_file, expected_similarity):
Expand Down

0 comments on commit ff6aabb

Please sign in to comment.