Skip to content

Commit

Permalink
Fix auto tests (#30067)
Browse files Browse the repository at this point in the history
* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
ydshieh and ydshieh authored Apr 5, 2024
1 parent d9fa13c commit 9b5a645
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/models/auto/test_modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_lmhead_model_from_pretrained(self):

@slow
def test_model_for_causal_lm(self):
model_name = "google-bert/bert-base-uncased"
model_name = "openai-community/gpt2"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, GPT2Config)
Expand All @@ -165,7 +165,7 @@ def test_model_for_masked_lm(self):

@slow
def test_model_for_encoder_decoder_lm(self):
model_name = "google-bert/bert-base-uncased"
model_name = "google-t5/t5-base"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config)
Expand Down
8 changes: 4 additions & 4 deletions tests/models/auto/test_modeling_tf_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ def test_lmhead_model_from_pretrained(self):
model_name = "openai-community/gpt2"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, BertConfig)
self.assertIsInstance(config, GPT2Config)

model = TFAutoModelWithLMHead.from_pretrained(model_name)
self.assertIsNotNone(model)
self.assertIsInstance(model, TFBertForMaskedLM)
self.assertIsInstance(model, TFGPT2LMHeadModel)

@slow
def test_model_for_masked_lm(self):
model_name = "openai-community/gpt2"
model_name = "google-bert/bert-base-uncased"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, BertConfig)
Expand All @@ -138,7 +138,7 @@ def test_model_for_masked_lm(self):

@slow
def test_model_for_encoder_decoder_lm(self):
model_name = "openai-community/gpt2"
model_name = "google-t5/t5-base"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config)
Expand Down
4 changes: 2 additions & 2 deletions tests/models/auto/test_modeling_tf_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_model_for_pretraining_from_pretrained(self):

@slow
def test_model_for_causal_lm(self):
model_name = "google-bert/bert-base-uncased"
model_name = "openai-community/gpt2"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, GPT2Config)
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_model_for_masked_lm(self):

@slow
def test_model_for_encoder_decoder_lm(self):
model_name = "google-bert/bert-base-uncased"
model_name = "google-t5/t5-base"
config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config)
Expand Down

0 comments on commit 9b5a645

Please sign in to comment.