[GPTJ] enable common tests and few fixes (#14190)

* enable common tests, small fixes

* don't tie word embeds

* don't ignore lm_head
This commit is contained in:
Suraj Patil
2021-11-01 22:38:52 +05:30
committed by GitHub
parent 70d5711848
commit ce91bf9a34
3 changed files with 15 additions and 10 deletions

View File

@@ -21,7 +21,8 @@ from transformers import GPTJConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, tooslow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import floats_tensor, ids_tensor, random_attention_mask
from .test_generation_utils import GenerationTesterMixin
from .test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
if is_torch_available():
@@ -350,7 +351,7 @@ class GPTJModelTester:
@require_torch
class GPTJModelTest(unittest.TestCase):
class GPTJModelTest(ModelTesterMixin, GenerationTesterMixin, unittest.TestCase):
all_model_classes = (GPTJModel, GPTJForCausalLM, GPTJForSequenceClassification) if is_torch_available() else ()
all_generative_model_classes = (GPTJForCausalLM,) if is_torch_available() else ()
@@ -358,6 +359,7 @@ class GPTJModelTest(unittest.TestCase):
test_pruning = False
test_missing_keys = False
test_model_parallel = False
test_head_masking = False
# special case for DoubleHeads model
def _prepare_for_class(self, inputs_dict, model_class, return_labels=False):