[WIP] Ensure TF model configs can be converted to proper JSON (#14415)

* test: make sure model configs are jsonifiable

* fix: return python dict instead of config object

* fix: accept pretrained config and use correct class

* Re-enabling slow tests and applying them to core models only

* Re-enabling slow tests and applying them to core models only

* Add new test file to fetcher

* Remove tooslow tests from test_modeling_tf_common.py

* make style

* Style fixes

* Style fixes

* Style fixes

* Style fixes

* Adding core tests to GPT2 and BART

* Removing unused imports

Co-authored-by: niklas.fruehauf <niklas.fruehauf@sovanta.com>
Co-authored-by: matt <rocketknight1@gmail.com>
This commit is contained in:
N
2021-11-17 21:24:39 +01:00
committed by GitHub
parent 754202de4f
commit 1991da07f7
7 changed files with 374 additions and 223 deletions

View File

@@ -23,6 +23,7 @@ from transformers.testing_utils import require_tf, slow
from .test_configuration_common import ConfigTester
from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
from .test_modeling_tf_core import TFCoreModelTesterMixin
if is_tf_available():
@@ -177,7 +178,7 @@ def prepare_bart_inputs_dict(
@require_tf
class TFBartModelTest(TFModelTesterMixin, unittest.TestCase):
class TFBartModelTest(TFModelTesterMixin, TFCoreModelTesterMixin, unittest.TestCase):
all_model_classes = (TFBartForConditionalGeneration, TFBartModel) if is_tf_available() else ()
all_generative_model_classes = (TFBartForConditionalGeneration,) if is_tf_available() else ()
is_encoder_decoder = True