Skip to content

Commit

Permalink
fix bt bark test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jul 25, 2024
1 parent 5ece6e8 commit 9333b58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/bettertransformer/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

MODELS_DICT = {
"albert": "hf-internal-testing/tiny-random-AlbertModel",
"bark": "ylacombe/bark-small", # TODO: put a smaller model, this one is 1.7GB...
"bark": "hf-internal-testing/tiny-random-BarkModel",
"bart": "hf-internal-testing/tiny-random-bart",
"bert": "hf-internal-testing/tiny-random-BertModel",
"bert-generation": "ybelkada/random-tiny-BertGenerationModel",
Expand Down Expand Up @@ -359,7 +359,8 @@ def _test_save_load_invertible(self, model_id, keep_original_model=True):
for name, param in bt_model.named_parameters():
self.assertFalse(param.device.type == "meta", f"Parameter {name} is on the meta device.")

bt_model.save_pretrained(tmpdirname)
# saving a normal transformers bark model fails because of shared tensors
bt_model.save_pretrained(tmpdirname, safe_serialization=hf_model.config.model_type != "bark")

bt_model_from_load = AutoModel.from_pretrained(tmpdirname)

Expand Down

0 comments on commit 9333b58

Please sign in to comment.