Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto tests #30067

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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