Fix auto tests (#30067)
* fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -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):
|
|||||||
|
|
||||||
@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):
|
|||||||
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):
|
|||||||
|
|
||||||
@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):
|
|||||||
|
|
||||||
@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):
|
|||||||
|
|
||||||
@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)
|
||||||
|
|||||||
Reference in New Issue
Block a user