Skip to content

Commit

Permalink
test: remove outdated tests with pretrained_class parameter (#4308)
Browse files Browse the repository at this point in the history
remove outdated tests with pretrained_class parameter
  • Loading branch information
MingLiangDai authored Nov 30, 2023
1 parent cc765bb commit 1b27ecc
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions tests/integration/frameworks/test_transformers_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,30 +344,3 @@ def test_import_model_has_required_files():
assert os.path.exists(bento_model.path_of("model.yaml"))
assert bento_model.info.labels == labels
bentoml.models.delete("tiny-bert:3956d303d3cddf0708ff20660c1ea5f6ec30e434")


def test_import_model_with_pretrained_class():
revision = "3956d303d3cddf0708ff20660c1ea5f6ec30e434"
pretrained_class = transformers.BertForMaskedLM
bento_model = bentoml.transformers.import_model(
"tiny-bert",
"hf-internal-testing/tiny-random-BertModel",
sync_with_hub_version=True,
pretrained_model_class=pretrained_class,
revision=revision,
)

assert bento_model.info.metadata["_pretrained_class"] == pretrained_class.__name__
bentoml.models.delete("tiny-bert:3956d303d3cddf0708ff20660c1ea5f6ec30e434")

pretrained_class = transformers.BertForNextSentencePrediction
bento_model = bentoml.transformers.import_model(
"tiny-bert",
"hf-internal-testing/tiny-random-BertModel",
sync_with_hub_version=True,
pretrained_model_class=pretrained_class,
revision=revision,
)

assert bento_model.info.metadata["_pretrained_class"] == pretrained_class.__name__
bentoml.models.delete("tiny-bert:3956d303d3cddf0708ff20660c1ea5f6ec30e434")

0 comments on commit 1b27ecc

Please sign in to comment.