From 442579c21ccb14592fafd17b830361485ce7e9ae Mon Sep 17 00:00:00 2001 From: ydshieh Date: Fri, 5 Apr 2024 10:17:52 +0200 Subject: [PATCH 1/2] fix --- tests/models/auto/test_modeling_auto.py | 4 ++-- tests/models/auto/test_modeling_tf_auto.py | 6 +++--- tests/models/auto/test_modeling_tf_pytorch.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/models/auto/test_modeling_auto.py b/tests/models/auto/test_modeling_auto.py index a8e42d77f90e3..363028c7f2297 100644 --- a/tests/models/auto/test_modeling_auto.py +++ b/tests/models/auto/test_modeling_auto.py @@ -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) @@ -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) diff --git a/tests/models/auto/test_modeling_tf_auto.py b/tests/models/auto/test_modeling_tf_auto.py index 53a07b197057e..48a8bcba1a872 100644 --- a/tests/models/auto/test_modeling_tf_auto.py +++ b/tests/models/auto/test_modeling_tf_auto.py @@ -118,11 +118,11 @@ 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): @@ -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) diff --git a/tests/models/auto/test_modeling_tf_pytorch.py b/tests/models/auto/test_modeling_tf_pytorch.py index 5b9036cbf1cf1..2c59c906db6b4 100644 --- a/tests/models/auto/test_modeling_tf_pytorch.py +++ b/tests/models/auto/test_modeling_tf_pytorch.py @@ -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) @@ -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) From 0e507bccf25e2eee2e08a28ac10ef3457fda8195 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Fri, 5 Apr 2024 11:00:05 +0200 Subject: [PATCH 2/2] fix --- tests/models/auto/test_modeling_tf_auto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/models/auto/test_modeling_tf_auto.py b/tests/models/auto/test_modeling_tf_auto.py index 48a8bcba1a872..a63d9fbe4cf14 100644 --- a/tests/models/auto/test_modeling_tf_auto.py +++ b/tests/models/auto/test_modeling_tf_auto.py @@ -126,7 +126,7 @@ def test_lmhead_model_from_pretrained(self): @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)