Skip to content

Commit

Permalink
Included the test of max_length parameter value
Browse files Browse the repository at this point in the history
Signed-off-by: yerzhaisang <tasqali1697@gmail.com>
  • Loading branch information
Yerzhaisang committed Jul 17, 2023
1 parent a11fc02 commit d2714d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ml_models/test_sentencetransformermodel_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import shutil

import pytest
from sentence_transformers import SentenceTransformer

from opensearch_py_ml.ml_models import SentenceTransformerModel

Expand Down Expand Up @@ -476,6 +477,11 @@ def test_truncation_parameter():
"truncation"
], "truncation parameter in tokenizer.json is null"

model11 = SentenceTransformer(model_id)
assert (
tokenizer_json["truncation"]["max_length"] == model11.tokenizer.model_max_length
), "max_length is not properly set"

clean_test_folder(TEST_FOLDER)


Expand Down

0 comments on commit d2714d6

Please sign in to comment.