Unverified Commit 9b5a6450 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix auto tests (#30067)



* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent d9fa13ce
...@@ -141,7 +141,7 @@ class AutoModelTest(unittest.TestCase): ...@@ -141,7 +141,7 @@ class AutoModelTest(unittest.TestCase):
@slow @slow
def test_model_for_causal_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, GPT2Config) self.assertIsInstance(config, GPT2Config)
...@@ -165,7 +165,7 @@ class AutoModelTest(unittest.TestCase): ...@@ -165,7 +165,7 @@ class AutoModelTest(unittest.TestCase):
@slow @slow
def test_model_for_encoder_decoder_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config) self.assertIsInstance(config, T5Config)
......
...@@ -118,15 +118,15 @@ class TFAutoModelTest(unittest.TestCase): ...@@ -118,15 +118,15 @@ class TFAutoModelTest(unittest.TestCase):
model_name = "openai-community/gpt2" model_name = "openai-community/gpt2"
config = AutoConfig.from_pretrained(model_name) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, BertConfig) self.assertIsInstance(config, GPT2Config)
model = TFAutoModelWithLMHead.from_pretrained(model_name) model = TFAutoModelWithLMHead.from_pretrained(model_name)
self.assertIsNotNone(model) self.assertIsNotNone(model)
self.assertIsInstance(model, TFBertForMaskedLM) self.assertIsInstance(model, TFGPT2LMHeadModel)
@slow @slow
def test_model_for_masked_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, BertConfig) self.assertIsInstance(config, BertConfig)
...@@ -138,7 +138,7 @@ class TFAutoModelTest(unittest.TestCase): ...@@ -138,7 +138,7 @@ class TFAutoModelTest(unittest.TestCase):
@slow @slow
def test_model_for_encoder_decoder_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config) self.assertIsInstance(config, T5Config)
......
...@@ -103,7 +103,7 @@ class TFPTAutoModelTest(unittest.TestCase): ...@@ -103,7 +103,7 @@ class TFPTAutoModelTest(unittest.TestCase):
@slow @slow
def test_model_for_causal_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, GPT2Config) self.assertIsInstance(config, GPT2Config)
...@@ -156,7 +156,7 @@ class TFPTAutoModelTest(unittest.TestCase): ...@@ -156,7 +156,7 @@ class TFPTAutoModelTest(unittest.TestCase):
@slow @slow
def test_model_for_encoder_decoder_lm(self): 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) config = AutoConfig.from_pretrained(model_name)
self.assertIsNotNone(config) self.assertIsNotNone(config)
self.assertIsInstance(config, T5Config) self.assertIsInstance(config, T5Config)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment