Fix auto tests (#30067)

* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2024-04-05 17:49:46 +02:00
committed by GitHub
parent d9fa13ce62
commit 9b5a6450d4
3 changed files with 8 additions and 8 deletions

View File

@@ -118,15 +118,15 @@ class TFAutoModelTest(unittest.TestCase):
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)
@@ -138,7 +138,7 @@ class TFAutoModelTest(unittest.TestCase):
@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)